Skip to content

Commit bb8c4c0

Browse files
committed
print less info to stabilize tests
1 parent 43e7587 commit bb8c4c0

15 files changed

+34
-26
lines changed

src/librustc_mir/borrow_check/nll/universal_regions.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,15 @@ impl<'tcx> UniversalRegions<'tcx> {
327327
&substs.substs[..]
328328
));
329329

330+
// FIXME: It'd be nice to print the late-bound regions
331+
// here, but unfortunately these wind up stored into
332+
// tests, and the resulting print-outs include def-ids
333+
// and other things that are not stable across tests!
334+
// So we just include the region-vid. Annoying.
330335
let closure_base_def_id = tcx.closure_base_def_id(def_id);
331336
for_each_late_bound_region_defined_on(tcx, closure_base_def_id, |r| {
332337
err.note(&format!(
333-
"late-bound region {:?} is {:?}",
334-
r,
338+
"late-bound region is {:?}",
335339
self.to_region_vid(r),
336340
));
337341
});
@@ -343,11 +347,13 @@ impl<'tcx> UniversalRegions<'tcx> {
343347
&substs.substs[..]
344348
));
345349

350+
// FIXME: As above, we'd like to print out the region
351+
// `r` but doing so is not stable across architectures
352+
// and so forth.
346353
let closure_base_def_id = tcx.closure_base_def_id(def_id);
347354
for_each_late_bound_region_defined_on(tcx, closure_base_def_id, |r| {
348355
err.note(&format!(
349-
"late-bound region {:?} is {:?}",
350-
r,
356+
"late-bound region is {:?}",
351357
self.to_region_vid(r),
352358
));
353359
});

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ LL | | },
1212
i16,
1313
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>))
1414
]
15-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]), BrNamed(crate0:DefIndex(1:17), 'a)) is '_#4r
16-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]), BrNamed(crate0:DefIndex(1:19), 'c)) is '_#5r
17-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]), BrNamed(crate0:DefIndex(1:18), 'b)) is '_#6r
15+
= note: late-bound region is '_#4r
16+
= note: late-bound region is '_#5r
17+
= note: late-bound region is '_#6r
1818

1919
error: unsatisfied lifetime constraints
2020
--> $DIR/propagate-approximated-fail-no-postdom.rs:56:13

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ LL | | });
1414
i16,
1515
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>))
1616
]
17-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]), BrNamed(crate0:DefIndex(1:17), 'b)) is '_#3r
18-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a)) is '_#4r
17+
= note: late-bound region is '_#3r
18+
= note: late-bound region is '_#4r
1919
= note: number of external vids: 5
2020
= note: where '_#1r: '_#2r
2121

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ LL | | });
1515
i16,
1616
for<'r, 's, 't0, 't1, 't2> 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), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) u32>))
1717
]
18-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a)) is '_#2r
19-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:17), 'b)) is '_#3r
18+
= note: late-bound region is '_#2r
19+
= note: late-bound region is '_#3r
2020
= note: number of external vids: 4
2121
= note: where '_#1r: '_#0r
2222

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ LL | | });
1414
i16,
1515
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<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) 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>))
1616
]
17-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:17), 'b)) is '_#3r
18-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a)) is '_#4r
17+
= note: late-bound region is '_#3r
18+
= note: late-bound region is '_#4r
1919
= note: number of external vids: 5
2020
= note: where '_#1r: '_#0r
2121

src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ LL | | });
1414
i16,
1515
for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r 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>))
1616
]
17-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]), BrNamed(crate0:DefIndex(1:17), 'b)) is '_#3r
18-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]), BrNamed(crate0:DefIndex(1:16), 'a)) is '_#4r
17+
= note: late-bound region is '_#3r
18+
= note: late-bound region is '_#4r
1919
= note: number of external vids: 5
2020
= note: where '_#1r: '_#2r
2121

src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | | },
1212
i16,
1313
for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#2r 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>))
1414
]
15-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_despite_same_free_region[317d]::supply[0]), BrNamed(crate0:DefIndex(1:15), 'a)) is '_#3r
15+
= note: late-bound region is '_#3r
1616
= note: number of external vids: 4
1717
= note: where '_#1r: '_#2r
1818

src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ LL | | });
1313
i16,
1414
for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))
1515
]
16-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a)) is '_#2r
17-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_fail_to_approximate_longer_no_bounds[317d]::supply[0]), BrNamed(crate0:DefIndex(1:17), 'b)) is '_#3r
16+
= note: late-bound region is '_#2r
17+
= note: late-bound region is '_#3r
1818

1919
error: unsatisfied lifetime constraints
2020
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:47:9

src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ LL | | });
1313
i16,
1414
for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r 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>))
1515
]
16-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]), BrNamed(crate0:DefIndex(1:17), 'b)) is '_#3r
17-
= note: late-bound region ReFree(DefId(0/0:6 ~ propagate_fail_to_approximate_longer_wrong_bounds[317d]::supply[0]), BrNamed(crate0:DefIndex(1:16), 'a)) is '_#4r
16+
= note: late-bound region is '_#3r
17+
= note: late-bound region is '_#4r
1818

1919
error: unsatisfied lifetime constraints
2020
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:9

src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
1010
i32,
1111
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
1212
]
13+
= note: late-bound region is '_#3r
1314
= note: number of external vids: 4
1415
= note: where T: '_#2r
1516
= note: where '_#1r: '_#2r

src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
1010
i32,
1111
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
1212
]
13+
= note: late-bound region is '_#3r
1314
= note: number of external vids: 4
1415
= note: where '_#1r: '_#2r
1516

src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
1010
i32,
1111
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
1212
]
13-
= note: late-bound region ReFree(DefId(0/0:8 ~ projection_one_region_trait_bound_static_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a)) is '_#3r
14-
= note: late-bound region ReFree(DefId(0/0:8 ~ projection_one_region_trait_bound_static_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), T)) is '_#4r
13+
= note: late-bound region is '_#3r
1514

1615
note: No external requirements
1716
--> $DIR/projection-one-region-trait-bound-static-closure.rs:42:1
@@ -42,7 +41,6 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
4241
i32,
4342
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
4443
]
45-
= note: late-bound region ReFree(DefId(0/0:9 ~ projection_one_region_trait_bound_static_closure[317d]::no_relationships_early[0]), BrNamed(crate0:DefIndex(1:22), T)) is '_#4r
4644

4745
note: No external requirements
4846
--> $DIR/projection-one-region-trait-bound-static-closure.rs:50:1
@@ -75,7 +73,6 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
7573
i32,
7674
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
7775
]
78-
= note: late-bound region ReFree(DefId(0/0:10 ~ projection_one_region_trait_bound_static_closure[317d]::projection_outlives[0]), BrNamed(crate0:DefIndex(1:26), T)) is '_#4r
7976

8077
note: No external requirements
8178
--> $DIR/projection-one-region-trait-bound-static-closure.rs:59:1
@@ -108,7 +105,6 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
108105
i32,
109106
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
110107
]
111-
= note: late-bound region ReFree(DefId(0/0:11 ~ projection_one_region_trait_bound_static_closure[317d]::elements_outlive[0]), BrNamed(crate0:DefIndex(1:30), T)) is '_#4r
112108

113109
note: No external requirements
114110
--> $DIR/projection-one-region-trait-bound-static-closure.rs:78:1
@@ -140,7 +136,6 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
140136
i32,
141137
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
142138
]
143-
= note: late-bound region ReFree(DefId(0/0:12 ~ projection_one_region_trait_bound_static_closure[317d]::one_region[0]), BrNamed(crate0:DefIndex(1:33), T)) is '_#3r
144139

145140
note: No external requirements
146141
--> $DIR/projection-one-region-trait-bound-static-closure.rs:87:1

src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
1111
i32,
1212
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
1313
]
14+
= note: late-bound region is '_#4r
1415
= note: number of external vids: 5
1516
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r
1617

@@ -212,6 +213,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
212213
i32,
213214
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
214215
]
216+
= note: late-bound region is '_#3r
215217
= note: number of external vids: 4
216218
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
217219

src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ LL | twice(cell, value, |a, b| invoke(a, b));
3636
i16,
3737
for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))
3838
]
39+
= note: late-bound region is '_#2r
3940
= note: number of external vids: 3
4041
= note: where T: '_#1r
4142

src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ LL | | })
1616
i32,
1717
extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T))
1818
]
19+
= note: late-bound region is '_#2r
1920
= note: number of external vids: 3
2021
= note: where T: '_#1r
2122

@@ -106,6 +107,7 @@ LL | | })
106107
i32,
107108
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
108109
]
110+
= note: late-bound region is '_#3r
109111
= note: number of external vids: 4
110112
= note: where T: '_#2r
111113

0 commit comments

Comments
 (0)