Skip to content

Commit

Permalink
Auto merge of rust-lang#49386 - GuillaumeGomez:fix-path-attribute, r=…
Browse files Browse the repository at this point in the history
…eddyb

Add tcx in item_body_nested_bodies

Fixes rust-lang#47391.

r? @eddyb
  • Loading branch information
bors committed Apr 10, 2018
2 parents 67712d7 + ebbe0c2 commit b2a7b94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc_metadata/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ provide! { <'tcx> tcx, def_id, other, cdata,
fn_arg_names => { cdata.get_fn_arg_names(def_id.index) }
impl_parent => { cdata.get_parent_impl(def_id.index) }
trait_of_item => { cdata.get_trait_of_item(def_id.index) }
item_body_nested_bodies => { cdata.item_body_nested_bodies(def_id.index) }
item_body_nested_bodies => { cdata.item_body_nested_bodies(tcx, def_id.index) }
const_is_rvalue_promotable_to_static => {
cdata.const_is_rvalue_promotable_to_static(def_id.index)
}
Expand Down
9 changes: 6 additions & 3 deletions src/librustc_metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,11 +818,14 @@ impl<'a, 'tcx> CrateMetadata {
tcx.alloc_tables(ast.tables.decode((self, tcx)))
}

pub fn item_body_nested_bodies(&self, id: DefIndex) -> ExternBodyNestedBodies {
pub fn item_body_nested_bodies(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
id: DefIndex)
-> ExternBodyNestedBodies {
if let Some(ref ast) = self.entry(id).ast {
let ast = ast.decode(self);
let mut ast = ast.decode(self);
let nested_bodies: BTreeMap<_, _> = ast.nested_bodies
.decode(self)
.decode((self, tcx.sess))
.map(|body| (body.id(), body))
.collect();
ExternBodyNestedBodies {
Expand Down

0 comments on commit b2a7b94

Please sign in to comment.