about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-08-23 06:34:11 +0000
committerbors <bors@rust-lang.org>2018-08-23 06:34:11 +0000
commitc648b0bb2b3e4f776ff6034f465d9afee622a939 (patch)
tree45482f5fc3b9361455122e6ce6ad0e17ca7169a3 /src/libsyntax
parente73077e10603b3586828f2d3d067f804c2fc0a1f (diff)
parent83d5a60cf64bbda77debdc8e91ba5486b2522880 (diff)
downloadrust-c648b0bb2b3e4f776ff6034f465d9afee622a939.tar.gz
rust-c648b0bb2b3e4f776ff6034f465d9afee622a939.zip
Auto merge of #53235 - varkor:gat_impl_where, r=estebank
Feature gate where clauses on associated type impls

Fixes #52913. This doesn't address the core problem, which is tracked by https://github.com/rust-lang/rust/issues/47206. However, it fixes the stable-to-stable regression: you now have to enable `#![feature(generic_associated_types)]` to trigger the weird behaviour.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 6c33c4c245b..89763c9c06f 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -1871,10 +1871,15 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                     "existential types are unstable"
                 );
             }
-
-            ast::ImplItemKind::Type(_) if !ii.generics.params.is_empty() => {
-                gate_feature_post!(&self, generic_associated_types, ii.span,
-                                   "generic associated types are unstable");
+            ast::ImplItemKind::Type(_) => {
+                if !ii.generics.params.is_empty() {
+                    gate_feature_post!(&self, generic_associated_types, ii.span,
+                                       "generic associated types are unstable");
+                }
+                if !ii.generics.where_clause.predicates.is_empty() {
+                    gate_feature_post!(&self, generic_associated_types, ii.span,
+                                       "where clauses on associated types are unstable");
+                }
             }
             _ => {}
         }