Skip to content

Commit

Permalink
Dual proc macros: Use crate disambiguator from the target crate
Browse files Browse the repository at this point in the history
Not sure this is correct, but let's try.
  • Loading branch information
petrochenkov committed Oct 2, 2019
1 parent 2d827b0 commit 94525e5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,12 @@ impl<'a> CrateLoader<'a> {
let dependencies: Vec<CrateNum> = cnum_map.iter().cloned().collect();

let raw_proc_macros = crate_root.proc_macro_data.map(|_| {
let temp_root;
let (dlsym_dylib, dlsym_root) = match &host_lib {
Some(host_lib) =>
(&host_lib.dylib, { temp_root = host_lib.metadata.get_root(); &temp_root }),
None => (&dylib, &crate_root),
let dlsym_dylib = match &host_lib {
Some(host_lib) => &host_lib.dylib,
None => &dylib,
};
let dlsym_dylib = dlsym_dylib.as_ref().expect("no dylib for a proc-macro crate");
self.dlsym_proc_macros(&dlsym_dylib.0, dlsym_root.disambiguator, span)
self.dlsym_proc_macros(&dlsym_dylib.0, crate_root.disambiguator, span)
});

let interpret_alloc_index: Vec<u32> = crate_root.interpret_alloc_index
Expand Down

0 comments on commit 94525e5

Please sign in to comment.