Feature gate auto trait and ignore it in rustdoc

This commit is contained in:
leonardo.yvens 2017-10-12 15:36:18 -03:00
parent 00be060daf
commit 37dfc0c598
2 changed files with 7 additions and 1 deletions

View file

@ -481,7 +481,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
};
om.constants.push(s);
},
hir::ItemTrait(unsafety, ref gen, ref b, ref item_ids) => {
hir::ItemTrait(_, unsafety, ref gen, ref b, ref item_ids) => {
let items = item_ids.iter()
.map(|ti| self.cx.tcx.hir.trait_item(ti.id).clone())
.collect();

View file

@ -1389,6 +1389,12 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
}
}
ast::ItemKind::Trait(ast::IsAuto::Yes, ..) => {
gate_feature_post!(&self, optin_builtin_traits,
i.span,
"auto traits are experimental and possibly buggy");
}
ast::ItemKind::MacroDef(ast::MacroDef { legacy: false, .. }) => {
let msg = "`macro` is experimental";
gate_feature_post!(&self, decl_macro, i.span, msg);