Stabilize underscore lifetimes

This commit is contained in:
Taylor Cramer
2018-03-28 17:25:39 +02:00
parent e5277c1457
commit e6e6bd27d5
32 changed files with 27 additions and 82 deletions

View File

@@ -385,6 +385,9 @@ declare_features! (
// allow `'_` placeholder lifetimes
(active, underscore_lifetimes, "1.22.0", Some(44524), None),
// Default match binding modes (RFC 2005)
(active, match_default_bindings, "1.22.0", Some(42640), None),
// Trait object syntax with `dyn` prefix
(active, dyn_trait, "1.22.0", Some(44662), Some(Edition::Edition2018)),
@@ -562,6 +565,8 @@ declare_features! (
(accepted, i128_type, "1.26.0", Some(35118), None),
// Default match binding modes (RFC 2005)
(accepted, match_default_bindings, "1.26.0", Some(42640), None),
// allow `'_` placeholder lifetimes
(accepted, underscore_lifetimes, "1.26.0", Some(44524), None),
);
// If you change this, please modify src/doc/unstable-book as well. You must
@@ -1792,14 +1797,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
visit::walk_generic_param(self, param)
}
fn visit_lifetime(&mut self, lt: &'a ast::Lifetime) {
if lt.ident.name == keywords::UnderscoreLifetime.name() {
gate_feature_post!(&self, underscore_lifetimes, lt.span,
"underscore lifetimes are unstable");
}
visit::walk_lifetime(self, lt)
}
}
pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],