Merge pull request #591 from serde-rs/sess

Not safe to share Spans from one ParseSess to another
This commit is contained in:
David Tolnay 2016-10-18 21:41:05 -07:00 committed by GitHub
commit cafa02d9b4

View File

@ -169,8 +169,8 @@ macro_rules! shim {
use syntax::parse;
let name = stringify!($name).to_string();
let cfg = Vec::new();
let sess = parse::ParseSess::new();
let impl_item = parse::parse_item_from_source_str(name, expanded, cfg, &sess);
let sess = cx.parse_sess;
let impl_item = parse::parse_item_from_source_str(name, expanded, cfg, sess);
push(::syntax::ext::base::Annotatable::Item(impl_item.unwrap().unwrap()));
}
};