Skip to content

Commit 9c99f14

Browse files
committed
1 parent 07a21d7 commit 9c99f14

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

rust-toolchain

Lines changed: 1 addition & 1 deletion
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-2022-03-13"
3+
channel = "nightly-2022-04-02"
44
components = ["llvm-tools-preview", "rustc-dev"]

src/mapping.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl NameMapping {
344344
Fn |
345345
Const |
346346
ConstParam |
347-
Static |
347+
Static(_) |
348348
Ctor(_, _) |
349349
AssocFn |
350350
AssocConst => Some(&mut self.value_map),

src/traverse.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res, Res::Def};
2121
use rustc_hir::def_id::DefId;
2222
use rustc_hir::hir_id::HirId;
2323
use rustc_hir::lang_items::LangItem;
24+
use rustc_hir::Mutability;
2425
use rustc_infer::infer::TyCtxtInferExt;
2526
use rustc_metadata::creader::CStore;
2627
use rustc_middle::{
@@ -244,12 +245,11 @@ fn diff_structure<'tcx>(
244245
| (ForeignTy, ForeignTy)
245246
| (ConstParam, ConstParam) => {}
246247
// statics are subject to mutability comparison
247-
(Static, Static) => {
248-
let old_mut = tcx.is_mutable_static(o_def_id);
249-
let new_mut = tcx.is_mutable_static(n_def_id);
248+
(Static(old_mut), Static(new_mut)) => {
250249
if old_mut != new_mut {
251-
let change_type =
252-
ChangeType::StaticMutabilityChanged { now_mut: new_mut };
250+
let change_type = ChangeType::StaticMutabilityChanged {
251+
now_mut: new_mut == Mutability::Mut,
252+
};
253253

254254
changes.add_change(change_type, o_def_id, None);
255255
}
@@ -888,7 +888,7 @@ fn diff_types<'tcx>(
888888

889889
match old {
890890
// type aliases, consts and statics just need their type to be checked
891-
Def(TyAlias | Const | Static, _) => {
891+
Def(TyAlias | Const | Static(_), _) => {
892892
cmp_types(
893893
changes,
894894
id_mapping,

0 commit comments

Comments
 (0)