Skip to content

Commit b173d97

Browse files
authored
Rollup merge of #66115 - eddyb:global-meta-what, r=michaelwoerister
rustc: remove "GlobalMetaData" dead code from hir::map::definitions. Spotted while refactoring uses of `DefIndex` and/or `LocalDefId`. r? @michaelwoerister
2 parents 945be0c + 2595332 commit b173d97

29 files changed

+116
-201
lines changed

src/librustc/hir/map/definitions.rs

+3-87
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::hash::Hash;
1919
use syntax::ast;
2020
use syntax_pos::symbol::{Symbol, sym};
2121
use syntax_pos::hygiene::ExpnId;
22-
use syntax_pos::{Span, DUMMY_SP};
22+
use syntax_pos::Span;
2323

2424
/// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa.
2525
/// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey`
@@ -310,10 +310,6 @@ pub enum DefPathData {
310310
AnonConst,
311311
/// An `impl Trait` type node.
312312
ImplTrait,
313-
/// Identifies a piece of crate metadata that is global to a whole crate
314-
/// (as opposed to just one item). `GlobalMetaData` components are only
315-
/// supposed to show up right below the crate root.
316-
GlobalMetaData(Symbol),
317313
}
318314

319315
#[derive(Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Debug,
@@ -444,9 +440,6 @@ impl Definitions {
444440
self.node_to_def_index.insert(ast::CRATE_NODE_ID, root_index);
445441
self.set_invocation_parent(ExpnId::root(), root_index);
446442

447-
// Allocate some other `DefIndex`es that always must exist.
448-
GlobalMetaDataKind::allocate_def_indices(self);
449-
450443
root_index
451444
}
452445

@@ -553,8 +546,7 @@ impl DefPathData {
553546
TypeNs(name) |
554547
ValueNs(name) |
555548
MacroNs(name) |
556-
LifetimeNs(name) |
557-
GlobalMetaData(name) => Some(name),
549+
LifetimeNs(name) => Some(name),
558550

559551
Impl |
560552
CrateRoot |
@@ -572,8 +564,7 @@ impl DefPathData {
572564
TypeNs(name) |
573565
ValueNs(name) |
574566
MacroNs(name) |
575-
LifetimeNs(name) |
576-
GlobalMetaData(name) => {
567+
LifetimeNs(name) => {
577568
name
578569
}
579570
// Note that this does not show up in user print-outs.
@@ -591,78 +582,3 @@ impl DefPathData {
591582
self.as_symbol().to_string()
592583
}
593584
}
594-
595-
// We define the `GlobalMetaDataKind` enum with this macro because we want to
596-
// make sure that we exhaustively iterate over all variants when registering
597-
// the corresponding `DefIndex`es in the `DefTable`.
598-
macro_rules! define_global_metadata_kind {
599-
(pub enum GlobalMetaDataKind {
600-
$($variant:ident),*
601-
}) => (
602-
pub enum GlobalMetaDataKind {
603-
$($variant),*
604-
}
605-
606-
impl GlobalMetaDataKind {
607-
fn allocate_def_indices(definitions: &mut Definitions) {
608-
$({
609-
let instance = GlobalMetaDataKind::$variant;
610-
definitions.create_def_with_parent(
611-
CRATE_DEF_INDEX,
612-
ast::DUMMY_NODE_ID,
613-
DefPathData::GlobalMetaData(instance.name()),
614-
ExpnId::root(),
615-
DUMMY_SP
616-
);
617-
618-
// Make sure calling `def_index` does not crash.
619-
instance.def_index(&definitions.table);
620-
})*
621-
}
622-
623-
pub fn def_index(&self, def_path_table: &DefPathTable) -> DefIndex {
624-
let def_key = DefKey {
625-
parent: Some(CRATE_DEF_INDEX),
626-
disambiguated_data: DisambiguatedDefPathData {
627-
data: DefPathData::GlobalMetaData(self.name()),
628-
disambiguator: 0,
629-
}
630-
};
631-
632-
// These `DefKey`s are all right after the root,
633-
// so a linear search is fine.
634-
let index = def_path_table.index_to_key
635-
.iter()
636-
.position(|k| *k == def_key)
637-
.unwrap();
638-
639-
DefIndex::from(index)
640-
}
641-
642-
fn name(&self) -> Symbol {
643-
644-
let string = match *self {
645-
$(
646-
GlobalMetaDataKind::$variant => {
647-
concat!("{{GlobalMetaData::", stringify!($variant), "}}")
648-
}
649-
)*
650-
};
651-
652-
Symbol::intern(string)
653-
}
654-
}
655-
)
656-
}
657-
658-
define_global_metadata_kind!(pub enum GlobalMetaDataKind {
659-
Krate,
660-
CrateDeps,
661-
DylibDependencyFormats,
662-
LangItems,
663-
LangItemsMissing,
664-
NativeLibraries,
665-
SourceMap,
666-
Impls,
667-
ExportedSymbols
668-
});

src/librustc_codegen_utils/symbol_names/v0.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,7 @@ impl Printer<'tcx> for SymbolMangler<'tcx> {
601601
| DefPathData::Misc
602602
| DefPathData::Impl
603603
| DefPathData::MacroNs(_)
604-
| DefPathData::LifetimeNs(_)
605-
| DefPathData::GlobalMetaData(_) => {
604+
| DefPathData::LifetimeNs(_) => {
606605
bug!("symbol_names: unexpected DefPathData: {:?}", disambiguated_data.data)
607606
}
608607
};

src/test/mir-opt/graphviz.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ fn main() {}
77

88
// END RUST SOURCE
99
// START rustc.main.mir_map.0.dot
10-
// digraph Mir_0_12 { // The name here MUST be an ASCII identifier.
10+
// digraph Mir_0_3 { // The name here MUST be an ASCII identifier.
1111
// graph [fontname="monospace"];
1212
// node [fontname="monospace"];
1313
// edge [fontname="monospace"];
1414
// label=<fn main() -&gt; ()<br align="left"/>>;
15-
// bb0__0_12 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left" balign="left">_0 = ()<br/></td></tr><tr><td align="left">goto</td></tr></table>>];
16-
// bb1__0_12 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">1</td></tr><tr><td align="left">resume</td></tr></table>>];
17-
// bb2__0_12 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">2</td></tr><tr><td align="left">return</td></tr></table>>];
18-
// bb0__0_12 -> bb2__0_12 [label=""];
15+
// bb0__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left" balign="left">_0 = ()<br/></td></tr><tr><td align="left">goto</td></tr></table>>];
16+
// bb1__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">1</td></tr><tr><td align="left">resume</td></tr></table>>];
17+
// bb2__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">2</td></tr><tr><td align="left">return</td></tr></table>>];
18+
// bb0__0_3 -> bb2__0_3 [label=""];
1919
// }
2020
// END rustc.main.mir_map.0.dot

src/test/mir-opt/inline-closure-borrows-arg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn foo<T: Copy>(_t: T, q: &i32) -> i32 {
2020
// ...
2121
// bb0: {
2222
// ...
23-
// _3 = [closure@HirId { owner: DefIndex(13), local_id: 31 }];
23+
// _3 = [closure@HirId { owner: DefIndex(4), local_id: 31 }];
2424
// ...
2525
// _4 = &_3;
2626
// ...

src/test/mir-opt/inline-closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn foo<T: Copy>(_t: T, q: i32) -> i32 {
1616
// ...
1717
// bb0: {
1818
// ...
19-
// _3 = [closure@HirId { owner: DefIndex(13), local_id: 15 }];
19+
// _3 = [closure@HirId { owner: DefIndex(4), local_id: 15 }];
2020
// ...
2121
// _4 = &_3;
2222
// ...

src/test/mir-opt/retag.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn main() {
100100
// }
101101
// END rustc.main.EraseRegions.after.mir
102102
// START rustc.main-{{closure}}.EraseRegions.after.mir
103-
// fn main::{{closure}}#0(_1: &[closure@HirId { owner: DefIndex(22), local_id: 72 }], _2: &i32) -> &i32 {
103+
// fn main::{{closure}}#0(_1: &[closure@HirId { owner: DefIndex(13), local_id: 72 }], _2: &i32) -> &i32 {
104104
// ...
105105
// bb0: {
106106
// Retag([fn entry] _1);

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ note: No external requirements
44
LL | let mut closure = expect_sig(|p, y| *p = y);
55
| ^^^^^^^^^^^^^
66
|
7-
= note: defining type: DefId(0:13 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]) with closure substs [
7+
= note: defining type: DefId(0:4 ~ escape_argument_callee[317d]::test[0]::{{closure}}[0]) with closure substs [
88
i16,
99
for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't0)) i32)),
1010
]
@@ -30,7 +30,7 @@ LL | | deref(p);
3030
LL | | }
3131
| |_^
3232
|
33-
= note: defining type: DefId(0:12 ~ escape_argument_callee[317d]::test[0]) with substs []
33+
= note: defining type: DefId(0:3 ~ escape_argument_callee[317d]::test[0]) with substs []
3434

3535
error: aborting due to previous error
3636

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ note: No external requirements
44
LL | let mut closure = expect_sig(|p, y| *p = y);
55
| ^^^^^^^^^^^^^
66
|
7-
= note: defining type: DefId(0:13 ~ escape_argument[317d]::test[0]::{{closure}}[0]) with closure substs [
7+
= note: defining type: DefId(0:4 ~ escape_argument[317d]::test[0]::{{closure}}[0]) with closure substs [
88
i16,
99
for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) i32)),
1010
]
@@ -21,7 +21,7 @@ LL | | deref(p);
2121
LL | | }
2222
| |_^
2323
|
24-
= note: defining type: DefId(0:12 ~ escape_argument[317d]::test[0]) with substs []
24+
= note: defining type: DefId(0:3 ~ escape_argument[317d]::test[0]) with substs []
2525

2626
error[E0597]: `y` does not live long enough
2727
--> $DIR/escape-argument.rs:27:25

src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ note: External requirements
44
LL | let mut closure1 = || p = &y;
55
| ^^^^^^^^^
66
|
7-
= note: defining type: DefId(0:14 ~ escape_upvar_nested[317d]::test[0]::{{closure}}[0]::{{closure}}[0]) with closure substs [
7+
= note: defining type: DefId(0:5 ~ escape_upvar_nested[317d]::test[0]::{{closure}}[0]::{{closure}}[0]) with closure substs [
88
i16,
99
extern "rust-call" fn(()),
1010
&'_#1r i32,
@@ -23,7 +23,7 @@ LL | | closure1();
2323
LL | | };
2424
| |_________^
2525
|
26-
= note: defining type: DefId(0:13 ~ escape_upvar_nested[317d]::test[0]::{{closure}}[0]) with closure substs [
26+
= note: defining type: DefId(0:4 ~ escape_upvar_nested[317d]::test[0]::{{closure}}[0]) with closure substs [
2727
i16,
2828
extern "rust-call" fn(()),
2929
&'_#1r i32,
@@ -44,7 +44,7 @@ LL | | deref(p);
4444
LL | | }
4545
| |_^
4646
|
47-
= note: defining type: DefId(0:12 ~ escape_upvar_nested[317d]::test[0]) with substs []
47+
= note: defining type: DefId(0:3 ~ escape_upvar_nested[317d]::test[0]) with substs []
4848

4949
error[E0597]: `y` does not live long enough
5050
--> $DIR/escape-upvar-nested.rs:21:40

src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ note: External requirements
44
LL | let mut closure = || p = &y;
55
| ^^^^^^^^^
66
|
7-
= note: defining type: DefId(0:13 ~ escape_upvar_ref[317d]::test[0]::{{closure}}[0]) with closure substs [
7+
= note: defining type: DefId(0:4 ~ escape_upvar_ref[317d]::test[0]::{{closure}}[0]) with closure substs [
88
i16,
99
extern "rust-call" fn(()),
1010
&'_#1r i32,
@@ -25,7 +25,7 @@ LL | | deref(p);
2525
LL | | }
2626
| |_^
2727
|
28-
= note: defining type: DefId(0:12 ~ escape_upvar_ref[317d]::test[0]) with substs []
28+
= note: defining type: DefId(0:3 ~ escape_upvar_ref[317d]::test[0]) with substs []
2929

3030
error[E0597]: `y` does not live long enough
3131
--> $DIR/escape-upvar-ref.rs:23:35

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | | demand_y(x, y, p)
88
LL | | },
99
| |_________^
1010
|
11-
= note: defining type: DefId(0:27 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]) with closure substs [
11+
= note: defining type: DefId(0:18 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]::{{closure}}[0]) with closure substs [
1212
i16,
1313
for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) u32>)),
1414
]
@@ -39,7 +39,7 @@ LL | | );
3939
LL | | }
4040
| |_^
4141
|
42-
= note: defining type: DefId(0:23 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]) with substs []
42+
= note: defining type: DefId(0:14 ~ propagate_approximated_fail_no_postdom[317d]::supply[0]) with substs []
4343

4444
error: aborting due to previous error
4545

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | |
99
LL | | });
1010
| |_____^
1111
|
12-
= note: defining type: DefId(0:25 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [
12+
= note: defining type: DefId(0:16 ~ propagate_approximated_ref[317d]::supply[0]::{{closure}}[0]) with closure substs [
1313
i16,
1414
for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't1)) u32>)),
1515
]
@@ -30,7 +30,7 @@ LL | | });
3030
LL | | }
3131
| |_^
3232
|
33-
= note: defining type: DefId(0:22 ~ propagate_approximated_ref[317d]::supply[0]) with substs []
33+
= note: defining type: DefId(0:13 ~ propagate_approximated_ref[317d]::supply[0]) with substs []
3434

3535
error: lifetime may not live long enough
3636
--> $DIR/propagate-approximated-ref.rs:45:9

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | |
88
LL | | })
99
| |_____^
1010
|
11-
= note: defining type: DefId(0:18 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [
11+
= note: defining type: DefId(0:9 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [
1212
i32,
1313
for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) u32>)),
1414
]
@@ -35,7 +35,7 @@ LL | | })
3535
LL | | }
3636
| |_^
3737
|
38-
= note: defining type: DefId(0:17 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]) with substs []
38+
= note: defining type: DefId(0:8 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]) with substs []
3939

4040
note: External requirements
4141
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:35:15
@@ -46,7 +46,7 @@ LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static
4646
LL | | })
4747
| |_____^
4848
|
49-
= note: defining type: DefId(0:20 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]::{{closure}}[0]) with closure substs [
49+
= note: defining type: DefId(0:11 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]::{{closure}}[0]) with closure substs [
5050
i32,
5151
for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) u32>)),
5252
]
@@ -65,7 +65,7 @@ LL | | })
6565
LL | | }
6666
| |_^
6767
|
68-
= note: defining type: DefId(0:19 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]) with substs []
68+
= note: defining type: DefId(0:10 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]) with substs []
6969

7070
error[E0597]: `a` does not live long enough
7171
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:30:26

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | | demand_y(x, y, x.get())
1010
LL | | });
1111
| |_____^
1212
|
13-
= note: defining type: DefId(0:25 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
13+
= note: defining type: DefId(0:16 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
1414
i16,
1515
for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't1)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't2)) u32>)),
1616
]
@@ -31,7 +31,7 @@ LL | | });
3131
LL | | }
3232
| |_^
3333
|
34-
= note: defining type: DefId(0:22 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs []
34+
= note: defining type: DefId(0:13 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs []
3535

3636
error[E0521]: borrowed data escapes outside of function
3737
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:5

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | | demand_y(x, y, x.get())
1010
LL | | });
1111
| |_____^
1212
|
13-
= note: defining type: DefId(0:25 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
13+
= note: defining type: DefId(0:16 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]::{{closure}}[0]) with closure substs [
1414
i16,
1515
for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't0)) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 't1)) u32>)),
1616
]
@@ -31,7 +31,7 @@ LL | | });
3131
LL | | }
3232
| |_^
3333
|
34-
= note: defining type: DefId(0:22 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]) with substs []
34+
= note: defining type: DefId(0:13 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]) with substs []
3535

3636
error[E0521]: borrowed data escapes outside of function
3737
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:35:5

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | |
99
LL | | });
1010
| |_____^
1111
|
12-
= note: defining type: DefId(0:25 ~ propagate_approximated_val[317d]::test[0]::{{closure}}[0]) with closure substs [
12+
= note: defining type: DefId(0:16 ~ propagate_approximated_val[317d]::test[0]::{{closure}}[0]) with closure substs [
1313
i16,
1414
for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0), 's)) u32>)),
1515
]
@@ -30,7 +30,7 @@ LL | | });
3030
LL | | }
3131
| |_^
3232
|
33-
= note: defining type: DefId(0:22 ~ propagate_approximated_val[317d]::test[0]) with substs []
33+
= note: defining type: DefId(0:13 ~ propagate_approximated_val[317d]::test[0]) with substs []
3434

3535
error: lifetime may not live long enough
3636
--> $DIR/propagate-approximated-val.rs:38:9

0 commit comments

Comments
 (0)