From f29613437fb1925ead92f81cd2495d7b92a5fd2a Mon Sep 17 00:00:00 2001 From: Sunjay Varma Date: Thu, 9 Nov 2017 21:40:14 -0500 Subject: Adding feature gate --- src/libsyntax/feature_gate.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index c1223efb27b..9b5be298fd5 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -431,6 +431,9 @@ declare_features! ( // Nested groups in `use` (RFC 2128) (active, use_nested_groups, "1.23.0", Some(44494)), + + // generic associated types (RFC 1598) + (active, generic_associated_types, "1.23.0", Some(44265)), ); declare_features! ( @@ -1618,6 +1621,9 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { gate_feature_post!(&self, associated_type_defaults, ti.span, "associated type defaults are unstable"); } + _ if ti.generics.is_parameterized() => { + gate_feature_post!(&self, generic_associated_types, ti.span, "generic associated types are unstable"); + } _ => {} } visit::walk_trait_item(self, ti); @@ -1636,6 +1642,9 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { gate_feature_post!(&self, const_fn, ii.span, "const fn is unstable"); } } + _ if ii.generics.is_parameterized() => { + gate_feature_post!(&self, generic_associated_types, ii.span, "generic associated types are unstable"); + } _ => {} } visit::walk_impl_item(self, ii); -- cgit 1.4.1-3-g733a5