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

Commit 8ef45e8

Browse files
committed
1 parent be85c12 commit 8ef45e8

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

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-2022-02-26"
3+
channel = "nightly-2022-03-13"
44
components = ["llvm-tools-preview", "rustc-dev"]

src/mismatch.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
151151
let matching = match (a.kind(), b.kind()) {
152152
(&TyKind::Adt(a_def, a_substs), &TyKind::Adt(b_def, b_substs)) => {
153153
if self.check_substs(a_substs, b_substs) {
154-
let _ = self.relate_item_substs(a_def.did, a_substs, b_substs)?;
155-
let a_adt = self.tcx.adt_def(a_def.did);
156-
let b_adt = self.tcx.adt_def(b_def.did);
154+
let _ = self.relate_item_substs(a_def.did(), a_substs, b_substs)?;
155+
let a_adt = self.tcx.adt_def(a_def.did());
156+
let b_adt = self.tcx.adt_def(b_def.did());
157157

158158
let b_fields: HashMap<_, _> = b_adt.all_fields().map(|f| (f.did, f)).collect();
159159

@@ -172,19 +172,19 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
172172
}
173173

174174
let a = if a_def.is_struct() {
175-
Res::Def(DefKind::Struct, a_def.did)
175+
Res::Def(DefKind::Struct, a_def.did())
176176
} else if a_def.is_union() {
177-
Res::Def(DefKind::Union, a_def.did)
177+
Res::Def(DefKind::Union, a_def.did())
178178
} else {
179-
Res::Def(DefKind::Enum, a_def.did)
179+
Res::Def(DefKind::Enum, a_def.did())
180180
};
181181

182182
let b = if b_def.is_struct() {
183-
Res::Def(DefKind::Struct, b_def.did)
183+
Res::Def(DefKind::Struct, b_def.did())
184184
} else if b_def.is_union() {
185-
Res::Def(DefKind::Union, b_def.did)
185+
Res::Def(DefKind::Union, b_def.did())
186186
} else {
187-
Res::Def(DefKind::Enum, b_def.did)
187+
Res::Def(DefKind::Enum, b_def.did())
188188
};
189189

190190
Some((a, b))

src/translate.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,18 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
164164
use rustc_middle::ty::ExistentialPredicate::*;
165165
use rustc_middle::ty::TyKind;
166166
use rustc_middle::ty::TypeAndMut;
167-
use rustc_middle::ty::{AdtDef, Binder, ExistentialProjection, ExistentialTraitRef};
167+
use rustc_middle::ty::{Binder, ExistentialProjection, ExistentialTraitRef};
168168

169169
orig.fold_with(&mut BottomUpFolder {
170170
tcx: self.tcx,
171171
ty_op: |ty| {
172172
match *ty.kind() {
173-
TyKind::Adt(&AdtDef { ref did, .. }, substs)
174-
if self.needs_translation(*did) =>
175-
{
173+
TyKind::Adt(adt_def, substs) if self.needs_translation(adt_def.did()) => {
176174
// we fold bottom-up, so the code above is invalid, as it assumes the
177175
// substs (that have been folded already) are yet untranslated
178-
if let Some(target_def_id) = (self.translate_orig)(self.id_mapping, *did) {
176+
if let Some(target_def_id) =
177+
(self.translate_orig)(self.id_mapping, adt_def.did())
178+
{
179179
let target_adt = self.tcx.adt_def(target_def_id);
180180
self.tcx.mk_adt(target_adt, substs)
181181
} else {

src/traverse.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,14 @@ fn diff_adts(changes: &mut ChangeSet, id_mapping: &mut IdMapping, tcx: TyCtxt, o
428428
let mut variants = BTreeMap::new();
429429
let mut fields = BTreeMap::new();
430430

431-
for variant in &old_def.variants {
431+
for variant in old_def.variants() {
432432
variants
433433
.entry(variant.ident(tcx).name)
434434
.or_insert((None, None))
435435
.0 = Some(variant);
436436
}
437437

438-
for variant in &new_def.variants {
438+
for variant in new_def.variants() {
439439
variants
440440
.entry(variant.ident(tcx).name)
441441
.or_insert((None, None))
@@ -1106,7 +1106,7 @@ fn diff_inherent_impls<'tcx>(
11061106
fn is_impl_trait_public<'tcx>(tcx: TyCtxt<'tcx>, impl_def_id: DefId) -> bool {
11071107
fn type_visibility(tcx: TyCtxt, ty: Ty) -> Visibility {
11081108
match ty.kind() {
1109-
TyKind::Adt(def, _) => tcx.visibility(def.did),
1109+
TyKind::Adt(def, _) => tcx.visibility(def.did()),
11101110

11111111
TyKind::Array(t, _)
11121112
| TyKind::Slice(t)

0 commit comments

Comments
 (0)