Skip to content

Commit fc19590

Browse files
committed
Auto merge of #51248 - fabric-and-ink:newtype_index_debrujin, r=nikomatsakis
Declare DebruijnIndex via newtype_index macro Part of #49887 Declare `DebruijnIndex` via the `newtype_index` macro.
2 parents 5230979 + 862d25c commit fc19590

27 files changed

+50
-56
lines changed

Diff for: src/librustc/infer/error_reporting/nice_region_error/find_anon_type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
7777
tcx: self.tcx,
7878
bound_region: *br,
7979
found_type: None,
80-
current_index: ty::DebruijnIndex::INNERMOST,
80+
current_index: ty::INNERMOST,
8181
};
8282
nested_visitor.visit_ty(arg);
8383
nested_visitor.found_type

Diff for: src/librustc/infer/higher_ranked/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,7 @@ impl<'a, 'gcx, 'tcx> CombineFields<'a, 'gcx, 'tcx> {
417417
{
418418
for (a_br, a_r) in a_map {
419419
if *a_r == r {
420-
return infcx.tcx.mk_region(ty::ReLateBound(ty::DebruijnIndex::INNERMOST,
421-
*a_br));
420+
return infcx.tcx.mk_region(ty::ReLateBound(ty::INNERMOST, *a_br));
422421
}
423422
}
424423
span_bug!(
@@ -735,7 +734,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
735734
// trait checking, and all of the skolemized regions
736735
// appear inside predicates, which always have
737736
// binders, so this assert is satisfied.
738-
assert!(current_depth > ty::DebruijnIndex::INNERMOST);
737+
assert!(current_depth > ty::INNERMOST);
739738

740739
// since leak-check passed, this skolemized region
741740
// should only have incoming edges from variables

Diff for: src/librustc/middle/resolve_lifetime.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl Region {
9898
}
9999

100100
fn late(hir_map: &Map, def: &hir::LifetimeDef) -> (hir::LifetimeName, Region) {
101-
let depth = ty::DebruijnIndex::INNERMOST;
101+
let depth = ty::INNERMOST;
102102
let def_id = hir_map.local_def_id(def.lifetime.id);
103103
let origin = LifetimeDefOrigin::from_is_in_band(def.in_band);
104104
debug!(
@@ -114,7 +114,7 @@ impl Region {
114114
fn late_anon(index: &Cell<u32>) -> Region {
115115
let i = index.get();
116116
index.set(i + 1);
117-
let depth = ty::DebruijnIndex::INNERMOST;
117+
let depth = ty::INNERMOST;
118118
Region::LateBoundAnon(depth, i)
119119
}
120120

@@ -1870,7 +1870,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
18701870
.map(|(i, input)| {
18711871
let mut gather = GatherLifetimes {
18721872
map: self.map,
1873-
outer_index: ty::DebruijnIndex::INNERMOST,
1873+
outer_index: ty::INNERMOST,
18741874
have_bound_regions: false,
18751875
lifetimes: FxHashSet(),
18761876
};

Diff for: src/librustc/ty/flags.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl FlagComputation {
2424
fn new() -> FlagComputation {
2525
FlagComputation {
2626
flags: TypeFlags::empty(),
27-
outer_exclusive_binder: ty::DebruijnIndex::INNERMOST,
27+
outer_exclusive_binder: ty::INNERMOST,
2828
}
2929
}
3030

@@ -60,7 +60,7 @@ impl FlagComputation {
6060
// a region binder, so subtract one from the region depth
6161
// within when adding the depth to `self`.
6262
let outer_exclusive_binder = computation.outer_exclusive_binder;
63-
if outer_exclusive_binder > ty::DebruijnIndex::INNERMOST {
63+
if outer_exclusive_binder > ty::INNERMOST {
6464
self.add_exclusive_binder(outer_exclusive_binder.shifted_out(1));
6565
} else {
6666
// otherwise, this binder captures nothing

Diff for: src/librustc/ty/fold.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub trait TypeFoldable<'tcx>: fmt::Debug + Clone {
6565

6666
/// True if `self` has any late-bound regions that are either
6767
/// bound by `binder` or bound by some binder outside of `binder`.
68-
/// If `binder` is `ty::DebruijnIndex::INNERMOST`, this indicates whether
68+
/// If `binder` is `ty::INNERMOST`, this indicates whether
6969
/// there are any late-bound regions that appear free.
7070
fn has_regions_bound_at_or_above(&self, binder: ty::DebruijnIndex) -> bool {
7171
self.visit_with(&mut HasEscapingRegionsVisitor { outer_index: binder })
@@ -78,7 +78,7 @@ pub trait TypeFoldable<'tcx>: fmt::Debug + Clone {
7878
}
7979

8080
fn has_escaping_regions(&self) -> bool {
81-
self.has_regions_bound_at_or_above(ty::DebruijnIndex::INNERMOST)
81+
self.has_regions_bound_at_or_above(ty::INNERMOST)
8282
}
8383

8484
fn has_type_flags(&self, flags: TypeFlags) -> bool {
@@ -246,7 +246,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
246246
T: TypeFoldable<'tcx>,
247247
{
248248
value.visit_with(&mut RegionVisitor {
249-
outer_index: ty::DebruijnIndex::INNERMOST,
249+
outer_index: ty::INNERMOST,
250250
callback
251251
});
252252

@@ -260,7 +260,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
260260
/// ^ ^ ^ ^
261261
/// | | | | here, would be shifted in 1
262262
/// | | | here, would be shifted in 2
263-
/// | | here, would be INNTERMOST shifted in by 1
263+
/// | | here, would be INNERMOST shifted in by 1
264264
/// | here, initially, binder would be INNERMOST
265265
/// ```
266266
///
@@ -333,7 +333,7 @@ impl<'a, 'gcx, 'tcx> RegionFolder<'a, 'gcx, 'tcx> {
333333
RegionFolder {
334334
tcx,
335335
skipped_regions,
336-
current_index: ty::DebruijnIndex::INNERMOST,
336+
current_index: ty::INNERMOST,
337337
fold_region_fn,
338338
}
339339
}
@@ -495,7 +495,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
495495
let mut counter = 0;
496496
Binder::bind(self.replace_late_bound_regions(sig, |_| {
497497
counter += 1;
498-
self.mk_region(ty::ReLateBound(ty::DebruijnIndex::INNERMOST, ty::BrAnon(counter)))
498+
self.mk_region(ty::ReLateBound(ty::INNERMOST, ty::BrAnon(counter)))
499499
}).0)
500500
}
501501
}
@@ -507,7 +507,7 @@ impl<'a, 'gcx, 'tcx> RegionReplacer<'a, 'gcx, 'tcx> {
507507
{
508508
RegionReplacer {
509509
tcx,
510-
current_index: ty::DebruijnIndex::INNERMOST,
510+
current_index: ty::INNERMOST,
511511
fld_r,
512512
map: BTreeMap::default()
513513
}
@@ -542,7 +542,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for RegionReplacer<'a, 'gcx, 'tcx> {
542542
// that region should always use the INNERMOST
543543
// debruijn index. Then we adjust it to the
544544
// correct depth.
545-
assert_eq!(debruijn1, ty::DebruijnIndex::INNERMOST);
545+
assert_eq!(debruijn1, ty::INNERMOST);
546546
self.tcx.mk_region(ty::ReLateBound(debruijn, br))
547547
} else {
548548
region
@@ -701,7 +701,7 @@ struct LateBoundRegionsCollector {
701701
impl LateBoundRegionsCollector {
702702
fn new(just_constrained: bool) -> Self {
703703
LateBoundRegionsCollector {
704-
current_index: ty::DebruijnIndex::INNERMOST,
704+
current_index: ty::INNERMOST,
705705
regions: FxHashSet(),
706706
just_constrained,
707707
}

Diff for: src/librustc/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult,
6060

6161
use hir;
6262

63-
pub use self::sty::{Binder, CanonicalVar, DebruijnIndex};
63+
pub use self::sty::{Binder, CanonicalVar, DebruijnIndex, INNERMOST};
6464
pub use self::sty::{FnSig, GenSig, PolyFnSig, PolyGenSig};
6565
pub use self::sty::{InferTy, ParamTy, ProjectionTy, ExistentialPredicate};
6666
pub use self::sty::{ClosureSubsts, GeneratorSubsts, UpvarSubsts, TypeAndMut};

Diff for: src/librustc/ty/sty.rs

+9-14
Original file line numberDiff line numberDiff line change
@@ -1023,12 +1023,11 @@ impl<'a, 'gcx, 'tcx> ParamTy {
10231023
/// is the outer fn.
10241024
///
10251025
/// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index
1026-
#[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Debug, Copy, PartialOrd, Ord)]
1027-
pub struct DebruijnIndex {
1028-
/// We maintain the invariant that this is never 0. So 1 indicates
1029-
/// the innermost binder.
1030-
index: u32,
1031-
}
1026+
newtype_index!(DebruijnIndex
1027+
{
1028+
DEBUG_FORMAT = "DebruijnIndex({})",
1029+
const INNERMOST = 0,
1030+
});
10321031

10331032
pub type Region<'tcx> = &'tcx RegionKind;
10341033

@@ -1261,8 +1260,6 @@ impl<'a, 'tcx, 'gcx> PolyExistentialProjection<'tcx> {
12611260
}
12621261

12631262
impl DebruijnIndex {
1264-
pub const INNERMOST: DebruijnIndex = DebruijnIndex { index: 0 };
1265-
12661263
/// Returns the resulting index when this value is moved into
12671264
/// `amount` number of new binders. So e.g. if you had
12681265
///
@@ -1275,7 +1272,7 @@ impl DebruijnIndex {
12751272
/// you would need to shift the index for `'a` into 1 new binder.
12761273
#[must_use]
12771274
pub const fn shifted_in(self, amount: u32) -> DebruijnIndex {
1278-
DebruijnIndex { index: self.index + amount }
1275+
DebruijnIndex(self.0 + amount)
12791276
}
12801277

12811278
/// Update this index in place by shifting it "in" through
@@ -1288,7 +1285,7 @@ impl DebruijnIndex {
12881285
/// `amount` number of new binders.
12891286
#[must_use]
12901287
pub const fn shifted_out(self, amount: u32) -> DebruijnIndex {
1291-
DebruijnIndex { index: self.index - amount }
1288+
DebruijnIndex(self.0 - amount)
12921289
}
12931290

12941291
/// Update in place by shifting out from `amount` binders.
@@ -1317,13 +1314,11 @@ impl DebruijnIndex {
13171314
/// bound by one of the binders we are shifting out of, that is an
13181315
/// error (and should fail an assertion failure).
13191316
pub fn shifted_out_to_binder(self, to_binder: DebruijnIndex) -> Self {
1320-
self.shifted_out(to_binder.index - Self::INNERMOST.index)
1317+
self.shifted_out((to_binder.0 - INNERMOST.0) as u32)
13211318
}
13221319
}
13231320

1324-
impl_stable_hash_for!(struct DebruijnIndex {
1325-
index
1326-
});
1321+
impl_stable_hash_for!(tuple_struct DebruijnIndex { index });
13271322

13281323
/// Region utilities
13291324
impl RegionKind {

Diff for: src/librustc/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
555555
-> Option<ty::Binder<Ty<'tcx>>>
556556
{
557557
let closure_ty = self.mk_closure(closure_def_id, closure_substs);
558-
let env_region = ty::ReLateBound(ty::DebruijnIndex::INNERMOST, ty::BrEnv);
558+
let env_region = ty::ReLateBound(ty::INNERMOST, ty::BrEnv);
559559
let closure_kind_ty = closure_substs.closure_kind_ty(closure_def_id, self);
560560
let closure_kind = closure_kind_ty.to_opt_closure_kind()?;
561561
let env_ty = match closure_kind {

Diff for: src/librustc/util/ppaux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl PrintContext {
527527
ty::BrNamed(tcx.hir.local_def_id(CRATE_NODE_ID), name)
528528
}
529529
};
530-
tcx.mk_region(ty::ReLateBound(ty::DebruijnIndex::INNERMOST, br))
530+
tcx.mk_region(ty::ReLateBound(ty::INNERMOST, br))
531531
}).0;
532532
start_or_continue(f, "", "> ")?;
533533

Diff for: src/librustc_codegen_llvm/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ pub fn ty_fn_sig<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>,
425425
let tcx = cx.tcx;
426426
let sig = substs.poly_sig(def_id, cx.tcx);
427427

428-
let env_region = ty::ReLateBound(ty::DebruijnIndex::INNERMOST, ty::BrEnv);
428+
let env_region = ty::ReLateBound(ty::INNERMOST, ty::BrEnv);
429429
let env_ty = tcx.mk_mut_ref(tcx.mk_region(env_region), ty);
430430

431431
sig.map_bound(|sig| {

Diff for: src/librustc_driver/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn test_env_with_pool<F>(
183183
});
184184
}
185185

186-
const D1: ty::DebruijnIndex = ty::DebruijnIndex::INNERMOST;
186+
const D1: ty::DebruijnIndex = ty::INNERMOST;
187187
const D2: ty::DebruijnIndex = D1.shifted_in(1);
188188

189189
impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> {

Diff for: src/librustc_typeck/check/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
463463
// Create a `PolyFnSig`. Note the oddity that late bound
464464
// regions appearing free in `expected_sig` are now bound up
465465
// in this binder we are creating.
466-
assert!(!expected_sig.sig.has_regions_bound_above(ty::DebruijnIndex::INNERMOST));
466+
assert!(!expected_sig.sig.has_regions_bound_above(ty::INNERMOST));
467467
let bound_sig = ty::Binder::bind(self.tcx.mk_fn_sig(
468468
expected_sig.sig.inputs().iter().cloned(),
469469
expected_sig.sig.output(),

Diff for: src/librustc_typeck/check/intrinsic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub fn check_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
119119
"pref_align_of" | "min_align_of" => (1, Vec::new(), tcx.types.usize),
120120
"size_of_val" | "min_align_of_val" => {
121121
(1, vec![
122-
tcx.mk_imm_ref(tcx.mk_region(ty::ReLateBound(ty::DebruijnIndex::INNERMOST,
122+
tcx.mk_imm_ref(tcx.mk_region(ty::ReLateBound(ty::INNERMOST,
123123
ty::BrAnon(0))),
124124
param(0))
125125
], tcx.types.usize)
@@ -298,7 +298,7 @@ pub fn check_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
298298
"unlikely" => (0, vec![tcx.types.bool], tcx.types.bool),
299299

300300
"discriminant_value" => (1, vec![
301-
tcx.mk_imm_ref(tcx.mk_region(ty::ReLateBound(ty::DebruijnIndex::INNERMOST,
301+
tcx.mk_imm_ref(tcx.mk_region(ty::ReLateBound(ty::INNERMOST,
302302
ty::BrAnon(0))),
303303
param(0))], tcx.types.u64),
304304

Diff for: src/librustc_typeck/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ fn has_late_bound_regions<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
736736
-> Option<Span> {
737737
let mut visitor = LateBoundRegionsDetector {
738738
tcx,
739-
outer_index: ty::DebruijnIndex::INNERMOST,
739+
outer_index: ty::INNERMOST,
740740
has_late_bound_regions: None,
741741
};
742742
for lifetime in generics.lifetimes() {

Diff for: src/test/ui/nll/closure-requirements/escape-argument-callee.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
1818
|
1919
= note: defining type: DefId(0/1:9 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]) with closure substs [
2020
i16,
21-
for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't0)) i32))
21+
for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) i32))
2222
]
2323

2424
note: No external requirements

Diff for: src/test/ui/nll/closure-requirements/escape-argument.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
66
|
77
= note: defining type: DefId(0/1:9 ~ escape_argument[317d]::test[0]::{{closure}}[0]) with closure substs [
88
i16,
9-
for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) i32))
9+
for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32))
1010
]
1111

1212
note: No external requirements

Diff for: src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ LL | | },
2424
|
2525
= note: defining type: DefId(0/1:20 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]) with closure substs [
2626
i16,
27-
for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>))
27+
for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))
2828
]
2929

3030
note: No external requirements

Diff for: src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | | });
1818
|
1919
= note: defining type: DefId(0/1:18 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [
2020
i16,
21-
for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
21+
for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
2222
]
2323
= note: number of external vids: 3
2424
= note: where '_#1r: '_#2r

Diff for: src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LL | | })
2323
|
2424
= note: defining type: DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [
2525
i32,
26-
for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
26+
for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
2727
]
2828

2929
note: No external requirements
@@ -51,7 +51,7 @@ LL | | })
5151
|
5252
= note: defining type: DefId(0/1:13 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]::{{closure}}[0]) with closure substs [
5353
i32,
54-
for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { index: 0 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
54+
for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
5555
]
5656
= note: number of external vids: 2
5757
= note: where '_#1r: '_#0r

0 commit comments

Comments
 (0)