auto merge of #11720 : sfackler/rust/macro-export-source, r=alexcrichton
The old method of serializing the AST gives totally bogus spans if the expansion of an imported macro causes compilation errors. The best solution seems to be to serialize the actual textual macro definition and load it the same way the std-macros are. I'm not totally confident that getting the source from the CodeMap will always do the right thing, but it seems to work in simple cases.
This commit is contained in:
commit
4ce84fa1de
10 changed files with 31 additions and 15 deletions
|
|
@ -623,7 +623,7 @@ impl<'a> base::CrateLoader for CrateLoader<'a> {
|
|||
self.loader.load_crate(crate)
|
||||
}
|
||||
|
||||
fn get_exported_macros(&mut self, cnum: ast::CrateNum) -> ~[@ast::Item] {
|
||||
fn get_exported_macros(&mut self, cnum: ast::CrateNum) -> ~[~str] {
|
||||
self.loader.get_exported_macros(cnum)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue