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 diff --git a/rust-toolchain b/rust-toolchain index 6ad567dd..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-03-13" +channel = "nightly-2022-04-20" 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/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 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,