Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 25b6836

Browse files
committed
Auto merge of #281 - JohnTitor:rustup-2022-04-11, r=JohnTitor
Rustup to nightly-2021-12-31
2 parents 546045f + e1c419a commit 25b6836

File tree

6 files changed

+26
-30
lines changed

6 files changed

+26
-30
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ repository and compiled from source or installed from
2727
of the nightly toolchain is supported at any given time.
2828

2929
<!-- NOTE: Keep in sync with nightly date on rust-toolchain. -->
30-
It's recommended to use `nightly-2021-11-30` toolchain.
31-
You can install it by using `rustup install nightly-2021-11-30` if you already have rustup.
30+
It's recommended to use `nightly-2021-12-31` toolchain.
31+
You can install it by using `rustup install nightly-2021-12-31` if you already have rustup.
3232
Then you can do:
3333

3434
```sh
35-
$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-11-30
36-
$ cargo +nightly-2021-11-30 install --git https://github.com/rust-lang/rust-semverver
35+
$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-12-31
36+
$ cargo +nightly-2021-12-31 install --git https://github.com/rust-lang/rust-semverver
3737
```
3838

3939
You'd also need `cmake` for some dependencies, and a few common libraries (if you hit

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# NOTE: Keep in sync with nightly date on README
22
[toolchain]
3-
channel = "nightly-2021-11-30"
3+
channel = "nightly-2021-12-31"
44
components = ["llvm-tools-preview", "rustc-dev"]

src/mismatch.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
198198
None
199199
}
200200
(&TyKind::RawPtr(a_mt), &TyKind::RawPtr(b_mt)) => {
201-
let _ = ty::relate::relate_type_and_mut(
202-
self,
203-
a_mt,
204-
b_mt,
205-
ty::VarianceDiagMutKind::RawPtr,
206-
)?;
201+
let _ = ty::relate::relate_type_and_mut(self, a_mt, b_mt, a)?;
207202
None
208203
}
209204
(&TyKind::Ref(a_r, a_ty, _), &TyKind::Ref(b_r, b_ty, _)) => {

src/translate.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
166166
use rustc_middle::ty::TypeAndMut;
167167
use rustc_middle::ty::{AdtDef, Binder, ExistentialProjection, ExistentialTraitRef};
168168

169-
let Ok(result) = orig.fold_with(&mut BottomUpFolder {
169+
orig.fold_with(&mut BottomUpFolder {
170170
tcx: self.tcx,
171171
ty_op: |ty| {
172172
match *ty.kind() {
@@ -327,8 +327,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
327327
},
328328
lt_op: |region| self.translate_region(region),
329329
ct_op: |konst| konst, // TODO: translate consts
330-
});
331-
result
330+
})
332331
}
333332

334333
/// Translate a region.
@@ -504,6 +503,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
504503
ParamEnv::new(
505504
self.tcx.intern_predicates(&target_preds),
506505
param_env.reveal(),
506+
param_env.constness(),
507507
)
508508
})
509509
}
@@ -559,12 +559,12 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
559559
self.infcx.tcx
560560
}
561561

562-
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Result<Ty<'tcx>, Self::Error> {
562+
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
563563
use rustc_middle::ty::TyKind;
564564
use rustc_middle::ty::TypeAndMut;
565565

566-
let t1 = ty.super_fold_with(self)?;
567-
Ok(match *t1.kind() {
566+
let t1 = ty.super_fold_with(self);
567+
match *t1.kind() {
568568
TyKind::Ref(region, ty, mutbl) if region.needs_infer() => {
569569
let ty_and_mut = TypeAndMut { ty, mutbl };
570570
self.infcx
@@ -573,15 +573,15 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
573573
}
574574
TyKind::Infer(_) => self.infcx.tcx.ty_error(),
575575
_ => t1,
576-
})
576+
}
577577
}
578578

579-
fn fold_region(&mut self, r: Region<'tcx>) -> Result<Region<'tcx>, Self::Error> {
580-
let r1 = r.super_fold_with(self)?;
581-
Ok(if r1.needs_infer() {
579+
fn fold_region(&mut self, r: Region<'tcx>) -> Region<'tcx> {
580+
let r1 = r.super_fold_with(self);
581+
if r1.needs_infer() {
582582
self.infcx.tcx.lifetimes.re_erased
583583
} else {
584584
r1
585-
})
585+
}
586586
}
587587
}

src/traverse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn run_traversal(tcx: TyCtxt, new: DefId) {
8585

8686
// Pull a module from the queue, with its global visibility.
8787
while let Some((new_def_id, idents, new_vis)) = mod_queue.pop_front() {
88-
for item in tcx.item_children(new_def_id).to_vec() {
88+
for item in tcx.item_children(new_def_id).iter().copied() {
8989
let n_vis = get_vis(new_vis, item);
9090
match item.res {
9191
Def(Mod, n_def_id) => {

src/typeck.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,12 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
254254
RegionckMode::default(),
255255
);
256256

257-
let Ok(folded) = self
257+
let err = self
258258
.infcx
259259
.resolve_vars_if_possible(err)
260-
.fold_with(&mut self.folder.clone());
261-
let err = folded.lift_to_tcx(lift_tcx).unwrap();
260+
.fold_with(&mut self.folder.clone())
261+
.lift_to_tcx(lift_tcx)
262+
.unwrap();
262263

263264
Some(err)
264265
} else {
@@ -287,11 +288,11 @@ impl<'a, 'tcx> TypeComparisonContext<'a, 'tcx> {
287288
errors
288289
.iter()
289290
.map(|err| {
290-
let Ok(folded) = self
291-
.infcx
291+
self.infcx
292292
.resolve_vars_if_possible(err.obligation.predicate)
293-
.fold_with(&mut self.folder.clone());
294-
folded.lift_to_tcx(lift_tcx).unwrap()
293+
.fold_with(&mut self.folder.clone())
294+
.lift_to_tcx(lift_tcx)
295+
.unwrap()
295296
})
296297
.collect()
297298
})

0 commit comments

Comments
 (0)