Skip to content

Commit b2a7b94

Browse files
committed
Auto merge of #49386 - GuillaumeGomez:fix-path-attribute, r=eddyb
Add tcx in item_body_nested_bodies Fixes #47391. r? @eddyb
2 parents 67712d7 + ebbe0c2 commit b2a7b94

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/librustc_metadata/cstore_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ provide! { <'tcx> tcx, def_id, other, cdata,
163163
fn_arg_names => { cdata.get_fn_arg_names(def_id.index) }
164164
impl_parent => { cdata.get_parent_impl(def_id.index) }
165165
trait_of_item => { cdata.get_trait_of_item(def_id.index) }
166-
item_body_nested_bodies => { cdata.item_body_nested_bodies(def_id.index) }
166+
item_body_nested_bodies => { cdata.item_body_nested_bodies(tcx, def_id.index) }
167167
const_is_rvalue_promotable_to_static => {
168168
cdata.const_is_rvalue_promotable_to_static(def_id.index)
169169
}

src/librustc_metadata/decoder.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -818,11 +818,14 @@ impl<'a, 'tcx> CrateMetadata {
818818
tcx.alloc_tables(ast.tables.decode((self, tcx)))
819819
}
820820

821-
pub fn item_body_nested_bodies(&self, id: DefIndex) -> ExternBodyNestedBodies {
821+
pub fn item_body_nested_bodies(&self,
822+
tcx: TyCtxt<'a, 'tcx, 'tcx>,
823+
id: DefIndex)
824+
-> ExternBodyNestedBodies {
822825
if let Some(ref ast) = self.entry(id).ast {
823-
let ast = ast.decode(self);
826+
let mut ast = ast.decode(self);
824827
let nested_bodies: BTreeMap<_, _> = ast.nested_bodies
825-
.decode(self)
828+
.decode((self, tcx.sess))
826829
.map(|body| (body.id(), body))
827830
.collect();
828831
ExternBodyNestedBodies {

0 commit comments

Comments
 (0)