Auto merge of #59256 - petrochenkov:derval2, r=Zoxc

Make meta-item API compatible with `LocalInternedString::get` soundness fix

r? @Zoxc
This commit is contained in:
bors
2019-03-25 12:21:46 +00:00
17 changed files with 84 additions and 97 deletions

View File

@@ -463,9 +463,10 @@ impl<'a> TraitDef<'a> {
let mut attrs = newitem.attrs.clone();
attrs.extend(item.attrs
.iter()
.filter(|a| a.ident_str().map_or(false, |name| {
["allow", "warn", "deny", "forbid", "stable", "unstable"].contains(&name)
}))
.filter(|a| {
["allow", "warn", "deny", "forbid", "stable", "unstable"]
.contains(&a.name_or_empty().get())
})
.cloned());
push(Annotatable::Item(P(ast::Item { attrs: attrs, ..(*newitem).clone() })))
}