Skip to content

Commit c751c7a

Browse files
committed
Auto merge of #60329 - Centril:rollup-wv8g1ex, r=Centril
Rollup of 5 pull requests Successful merges: - #60292 (Replace the `&'tcx List<Ty<'tcx>>` in `TyKind::Tuple` with `SubstsRef<'tcx>`) - #60307 (Make "Implementations on Foreign Types" items in sidebar link to specific impls) - #60309 (Add 1.34.1 release notes) - #60315 (bootstrap: use correct version numbers for llvm-tools and lldb) - #60316 (Use "capacity" as parameter name in with_capacity() methods) Failed merges: r? @ghost
2 parents d4a32d5 + fa66b8a commit c751c7a

File tree

49 files changed

+210
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+210
-122
lines changed

RELEASES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Version 1.34.1 (2019-04-25)
2+
===========================
3+
4+
* [Fix false positives for the `redundant_closure` Clippy lint][clippy/3821]
5+
* [Fix false positives for the `missing_const_for_fn` Clippy lint][clippy/3844]
6+
* [Fix Clippy panic when checking some macros][clippy/3805]
7+
8+
[clippy/3821]: https://github.com/rust-lang/rust-clippy/pull/3821
9+
[clippy/3844]: https://github.com/rust-lang/rust-clippy/pull/3844
10+
[clippy/3805]: https://github.com/rust-lang/rust-clippy/pull/3805
11+
112
Version 1.34.0 (2019-04-11)
213
==========================
314

src/bootstrap/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,15 +1049,15 @@ impl Build {
10491049
}
10501050

10511051
fn llvm_tools_package_vers(&self) -> String {
1052-
self.package_vers(&self.rust_version())
1052+
self.package_vers(channel::CFG_RELEASE_NUM)
10531053
}
10541054

10551055
fn llvm_tools_vers(&self) -> String {
10561056
self.rust_version()
10571057
}
10581058

10591059
fn lldb_package_vers(&self) -> String {
1060-
self.package_vers(&self.rust_version())
1060+
self.package_vers(channel::CFG_RELEASE_NUM)
10611061
}
10621062

10631063
fn lldb_vers(&self) -> String {

src/liballoc/collections/vec_deque.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ impl<T> VecDeque<T> {
369369
VecDeque::with_capacity(INITIAL_CAPACITY)
370370
}
371371

372-
/// Creates an empty `VecDeque` with space for at least `n` elements.
372+
/// Creates an empty `VecDeque` with space for at least `capacity` elements.
373373
///
374374
/// # Examples
375375
///
@@ -379,10 +379,10 @@ impl<T> VecDeque<T> {
379379
/// let vector: VecDeque<u32> = VecDeque::with_capacity(10);
380380
/// ```
381381
#[stable(feature = "rust1", since = "1.0.0")]
382-
pub fn with_capacity(n: usize) -> VecDeque<T> {
382+
pub fn with_capacity(capacity: usize) -> VecDeque<T> {
383383
// +1 since the ringbuffer always leaves one space empty
384-
let cap = cmp::max(n + 1, MINIMUM_CAPACITY + 1).next_power_of_two();
385-
assert!(cap > n, "capacity overflow");
384+
let cap = cmp::max(capacity + 1, MINIMUM_CAPACITY + 1).next_power_of_two();
385+
assert!(cap > capacity, "capacity overflow");
386386

387387
VecDeque {
388388
tail: 0,

src/librustc/mir/tcx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<'a, 'gcx, 'tcx> PlaceTy<'tcx> {
4747
let field_def = &variant_def.fields[f.index()];
4848
field_def.ty(tcx, substs)
4949
}
50-
ty::Tuple(ref tys) => tys[f.index()],
50+
ty::Tuple(ref tys) => tys[f.index()].expect_ty(),
5151
_ => bug!("extracting field of non-tuple non-adt: {:?}", self),
5252
};
5353
debug!("field_ty self: {:?} f: {:?} yields: {:?}", self, f, answer);

src/librustc/traits/error_reporting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
875875
let expected_ty = expected_trait_ref.skip_binder().substs.type_at(1);
876876
let expected = match expected_ty.sty {
877877
ty::Tuple(ref tys) => tys.iter()
878-
.map(|t| ArgKind::from_expected_ty(t, Some(span))).collect(),
878+
.map(|t| ArgKind::from_expected_ty(t.expect_ty(), Some(span))).collect(),
879879
_ => vec![ArgKind::Arg("_".to_owned(), expected_ty.to_string())],
880880
};
881881

@@ -1247,7 +1247,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
12471247
let inputs = trait_ref.substs.type_at(1);
12481248
let sig = if let ty::Tuple(inputs) = inputs.sty {
12491249
tcx.mk_fn_sig(
1250-
inputs.iter().cloned(),
1250+
inputs.iter().map(|k| k.expect_ty()),
12511251
tcx.mk_infer(ty::TyVar(ty::TyVid { index: 0 })),
12521252
false,
12531253
hir::Unsafety::Normal,

src/librustc/traits/query/dropck_outlives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'_, '_, 'tcx>, ty: Ty<'tcx>) ->
217217

218218
// (T1..Tn) and closures have same properties as T1..Tn --
219219
// check if *any* of those are trivial.
220-
ty::Tuple(ref tys) => tys.iter().all(|t| trivial_dropck_outlives(tcx, t)),
220+
ty::Tuple(ref tys) => tys.iter().all(|t| trivial_dropck_outlives(tcx, t.expect_ty())),
221221
ty::Closure(def_id, ref substs) => substs
222222
.upvar_tys(def_id, tcx)
223223
.all(|t| trivial_dropck_outlives(tcx, t)),

src/librustc/traits/select.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,7 +2429,9 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
24292429

24302430
ty::Str | ty::Slice(_) | ty::Dynamic(..) | ty::Foreign(..) => None,
24312431

2432-
ty::Tuple(tys) => Where(ty::Binder::bind(tys.last().into_iter().cloned().collect())),
2432+
ty::Tuple(tys) => {
2433+
Where(ty::Binder::bind(tys.last().into_iter().map(|k| k.expect_ty()).collect()))
2434+
}
24332435

24342436
ty::Adt(def, substs) => {
24352437
let sized_crit = def.sized_constraint(self.tcx());
@@ -2503,7 +2505,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
25032505

25042506
ty::Tuple(tys) => {
25052507
// (*) binder moved here
2506-
Where(ty::Binder::bind(tys.to_vec()))
2508+
Where(ty::Binder::bind(tys.iter().map(|k| k.expect_ty()).collect()))
25072509
}
25082510

25092511
ty::Closure(def_id, substs) => {
@@ -2590,7 +2592,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
25902592

25912593
ty::Tuple(ref tys) => {
25922594
// (T1, ..., Tn) -- meets any bound that all of T1...Tn meet
2593-
tys.to_vec()
2595+
tys.iter().map(|k| k.expect_ty()).collect()
25942596
}
25952597

25962598
ty::Closure(def_id, ref substs) => substs.upvar_tys(def_id, self.tcx()).collect(),
@@ -3495,7 +3497,9 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
34953497

34963498
// Check that the source tuple with the target's
34973499
// last element is equal to the target.
3498-
let new_tuple = tcx.mk_tup(a_mid.iter().cloned().chain(iter::once(b_last)));
3500+
let new_tuple = tcx.mk_tup(
3501+
a_mid.iter().map(|k| k.expect_ty()).chain(iter::once(b_last.expect_ty())),
3502+
);
34993503
let InferOk { obligations, .. } = self.infcx
35003504
.at(&obligation.cause, obligation.param_env)
35013505
.eq(target, new_tuple)
@@ -3508,7 +3512,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
35083512
obligation.cause.clone(),
35093513
obligation.predicate.def_id(),
35103514
obligation.recursion_depth + 1,
3511-
a_last,
3515+
a_last.expect_ty(),
35123516
&[b_last.into()],
35133517
));
35143518
}

src/librustc/ty/context.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,7 +2431,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
24312431
let converted_sig = sig.map_bound(|s| {
24322432
let params_iter = match s.inputs()[0].sty {
24332433
ty::Tuple(params) => {
2434-
params.into_iter().cloned()
2434+
params.into_iter().map(|k| k.expect_ty())
24352435
}
24362436
_ => bug!(),
24372437
};
@@ -2573,11 +2573,15 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
25732573

25742574
#[inline]
25752575
pub fn intern_tup(self, ts: &[Ty<'tcx>]) -> Ty<'tcx> {
2576-
self.mk_ty(Tuple(self.intern_type_list(ts)))
2576+
let kinds: Vec<_> = ts.into_iter().map(|&t| Kind::from(t)).collect();
2577+
self.mk_ty(Tuple(self.intern_substs(&kinds)))
25772578
}
25782579

25792580
pub fn mk_tup<I: InternAs<[Ty<'tcx>], Ty<'tcx>>>(self, iter: I) -> I::Output {
2580-
iter.intern_with(|ts| self.mk_ty(Tuple(self.intern_type_list(ts))))
2581+
iter.intern_with(|ts| {
2582+
let kinds: Vec<_> = ts.into_iter().map(|&t| Kind::from(t)).collect();
2583+
self.mk_ty(Tuple(self.intern_substs(&kinds)))
2584+
})
25812585
}
25822586

25832587
#[inline]

src/librustc/ty/flags.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ impl FlagComputation {
195195
self.add_ty(ty);
196196
}
197197

198-
&ty::Tuple(ref ts) => {
199-
self.add_tys(&ts[..]);
198+
&ty::Tuple(ref substs) => {
199+
self.add_substs(substs);
200200
}
201201

202202
&ty::FnDef(_, substs) => {

src/librustc/ty/inhabitedness/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
181181

182182
Tuple(ref tys) => {
183183
DefIdForest::union(tcx, tys.iter().map(|ty| {
184-
ty.uninhabited_from(tcx)
184+
ty.expect_ty().uninhabited_from(tcx)
185185
}))
186186
}
187187

0 commit comments

Comments
 (0)