stop requiring the feature-gate to use dyn_trait

This commit is contained in:
Christian Poveda 2018-04-12 16:53:28 -05:00
parent 2a6200a5c8
commit 199ee32773
2 changed files with 2 additions and 18 deletions

View File

@ -375,9 +375,6 @@ declare_features! (
// Future-proofing enums/structs with #[non_exhaustive] attribute (RFC 2008)
(active, non_exhaustive, "1.22.0", Some(44109), None),
// Trait object syntax with `dyn` prefix
(active, dyn_trait, "1.22.0", Some(44662), Some(Edition::Edition2018)),
// `crate` as visibility modifier, synonymous to `pub(crate)`
(active, crate_visibility_modifier, "1.23.0", Some(45388), Some(Edition::Edition2018)),
@ -592,6 +589,8 @@ declare_features! (
(accepted, cfg_target_feature, "1.27.0", Some(29717), None),
// Allows #[target_feature(...)]
(accepted, target_feature, "1.27.0", None, None),
// Trait object syntax with `dyn` prefix
(accepted, dyn_trait, "1.22.0", Some(44662), None),
);
// If you change this, please modify src/doc/unstable-book as well. You must
@ -1657,10 +1656,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
gate_feature_post!(&self, never_type, ty.span,
"The `!` type is experimental");
}
ast::TyKind::TraitObject(_, ast::TraitObjectSyntax::Dyn) => {
gate_feature_post!(&self, dyn_trait, ty.span,
"`dyn Trait` syntax is unstable");
}
_ => {}
}
visit::walk_ty(self, ty)

View File

@ -1,11 +0,0 @@
error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
--> $DIR/feature-gate-dyn-trait.rs:12:14
|
LL | type A = Box<dyn Trait>; //~ ERROR `dyn Trait` syntax is unstable
| ^^^^^^^^^
|
= help: add #![feature(dyn_trait)] to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.