From 9c99f14e407ae9206d72cc0cef1c9b8d2fe373f0 Mon Sep 17 00:00:00 2001 From: Johannes Schilling Date: Mon, 9 May 2022 00:18:11 +0200 Subject: [PATCH 1/3] Rustup to rust-lang/rust#95436 --- rust-toolchain | 2 +- src/mapping.rs | 2 +- src/traverse.rs | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 6ad567dd..9248bcad 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ # NOTE: Keep in sync with nightly date on README [toolchain] -channel = "nightly-2022-03-13" +channel = "nightly-2022-04-02" components = ["llvm-tools-preview", "rustc-dev"] diff --git a/src/mapping.rs b/src/mapping.rs index edb11068..6e84c81e 100644 --- a/src/mapping.rs +++ b/src/mapping.rs @@ -344,7 +344,7 @@ impl NameMapping { Fn | Const | ConstParam | - Static | + Static(_) | Ctor(_, _) | AssocFn | AssocConst => Some(&mut self.value_map), diff --git a/src/traverse.rs b/src/traverse.rs index a049f356..ab15c075 100644 --- a/src/traverse.rs +++ b/src/traverse.rs @@ -21,6 +21,7 @@ use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res, Res::Def}; use rustc_hir::def_id::DefId; use rustc_hir::hir_id::HirId; use rustc_hir::lang_items::LangItem; +use rustc_hir::Mutability; use rustc_infer::infer::TyCtxtInferExt; use rustc_metadata::creader::CStore; use rustc_middle::{ @@ -244,12 +245,11 @@ fn diff_structure<'tcx>( | (ForeignTy, ForeignTy) | (ConstParam, ConstParam) => {} // statics are subject to mutability comparison - (Static, Static) => { - let old_mut = tcx.is_mutable_static(o_def_id); - let new_mut = tcx.is_mutable_static(n_def_id); + (Static(old_mut), Static(new_mut)) => { if old_mut != new_mut { - let change_type = - ChangeType::StaticMutabilityChanged { now_mut: new_mut }; + let change_type = ChangeType::StaticMutabilityChanged { + now_mut: new_mut == Mutability::Mut, + }; changes.add_change(change_type, o_def_id, None); } @@ -888,7 +888,7 @@ fn diff_types<'tcx>( match old { // type aliases, consts and statics just need their type to be checked - Def(TyAlias | Const | Static, _) => { + Def(TyAlias | Const | Static(_), _) => { cmp_types( changes, id_mapping, From 40e27beff505c463324b19b9aa6d82ee3443ea47 Mon Sep 17 00:00:00 2001 From: Johannes Schilling Date: Mon, 9 May 2022 00:26:54 +0200 Subject: [PATCH 2/3] Rustup to rust-lang/rust#96020 --- rust-toolchain | 2 +- src/mismatch.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 9248bcad..87504523 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ # NOTE: Keep in sync with nightly date on README [toolchain] -channel = "nightly-2022-04-02" +channel = "nightly-2022-04-20" components = ["llvm-tools-preview", "rustc-dev"] diff --git a/src/mismatch.rs b/src/mismatch.rs index 2ba6d2bd..b58b74df 100644 --- a/src/mismatch.rs +++ b/src/mismatch.rs @@ -255,7 +255,7 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> { } (&TyKind::Opaque(_a_def_id, a_substs), &TyKind::Opaque(_b_def_id, b_substs)) => { if self.check_substs(a_substs, b_substs) { - let _ = ty::relate::relate_substs(self, None, a_substs, b_substs)?; + let _ = ty::relate::relate_substs(self, a_substs, b_substs)?; } // TODO: we are talking impl trait here, so we can build a Res for that or the From 00a1d645f24787a580b3b7176ab8b9259a087d33 Mon Sep 17 00:00:00 2001 From: Johannes Schilling Date: Mon, 9 May 2022 00:29:00 +0200 Subject: [PATCH 3/3] Update README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7a2e5b62..b385e5ca 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ repository and compiled from source or installed from of the nightly toolchain is supported at any given time. -It's recommended to use `nightly-2022-03-13` toolchain. -You can install it by using `rustup install nightly-2022-03-13` if you already have rustup. +It's recommended to use `nightly-2022-04-20` toolchain. +You can install it by using `rustup install nightly-2022-04-20` if you already have rustup. Then you can do: ```sh -$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2022-03-13 -$ cargo +nightly-2022-03-13 install --git https://github.com/rust-lang/rust-semverver +$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2022-04-20 +$ cargo +nightly-2022-04-20 install --git https://github.com/rust-lang/rust-semverver ``` You'd also need `cmake` for some dependencies, and a few common libraries (if you hit