Skip to content

Commit 37dfc0c

Browse files
committed
Feature gate auto trait and ignore it in rustdoc
1 parent 00be060 commit 37dfc0c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/librustdoc/visit_ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
481481
};
482482
om.constants.push(s);
483483
},
484-
hir::ItemTrait(unsafety, ref gen, ref b, ref item_ids) => {
484+
hir::ItemTrait(_, unsafety, ref gen, ref b, ref item_ids) => {
485485
let items = item_ids.iter()
486486
.map(|ti| self.cx.tcx.hir.trait_item(ti.id).clone())
487487
.collect();

src/libsyntax/feature_gate.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,6 +1389,12 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
13891389
}
13901390
}
13911391

1392+
ast::ItemKind::Trait(ast::IsAuto::Yes, ..) => {
1393+
gate_feature_post!(&self, optin_builtin_traits,
1394+
i.span,
1395+
"auto traits are experimental and possibly buggy");
1396+
}
1397+
13921398
ast::ItemKind::MacroDef(ast::MacroDef { legacy: false, .. }) => {
13931399
let msg = "`macro` is experimental";
13941400
gate_feature_post!(&self, decl_macro, i.span, msg);

0 commit comments

Comments
 (0)