Reorder injection of std to get better compilation error

This commit is contained in:
Russell Cohen
2018-04-16 12:28:30 -07:00
parent bd40cbbe1f
commit 084d2bc479
3 changed files with 27 additions and 1 deletions

View File

@@ -57,7 +57,8 @@ pub fn maybe_inject_crates_ref(mut krate: ast::Crate, alt_std_name: Option<&str>
&["std"]
};
for name in names {
// .rev() to preserve ordering above in combination with insert(0, ...)
for name in names.iter().rev() {
krate.module.items.insert(0, P(ast::Item {
attrs: vec![attr::mk_attr_outer(DUMMY_SP,
attr::mk_attr_id(),