about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-23 19:29:25 +0000
committerbors <bors@rust-lang.org>2018-04-23 19:29:25 +0000
commit0135bf647c266052f8428601a72a77dd51bf6437 (patch)
treea4fcfd6dbda5f1ea24b26cbe0ec7c17e9bb9a4b2 /src/libsyntax
parent4640615ce740766cf57b014722603b0bd0fffec2 (diff)
parentd9cd6c6e8edfa43527c100fdfd619cc9d1378aea (diff)
downloadrust-0135bf647c266052f8428601a72a77dd51bf6437.tar.gz
rust-0135bf647c266052f8428601a72a77dd51bf6437.zip
Auto merge of #49368 - matthewjasper:feature-gate-where-clause, r=nikomatsakis
Feature gate where clauses on associated types

Fixes #49365. Requires crater: these have been usable since 1.24.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index e4bfdf25001..d20e94b018b 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -1768,8 +1768,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                 }
             }
             ast::TraitItemKind::Type(_, ref default) => {
-                // We use two if statements instead of something like match guards so that both
-                // of these errors can be emitted if both cases apply.
+                // We use three if statements instead of something like match guards so that all
+                // of these errors can be emitted if all cases apply.
                 if default.is_some() {
                     gate_feature_post!(&self, associated_type_defaults, ti.span,
                                        "associated type defaults are unstable");
@@ -1778,6 +1778,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                     gate_feature_post!(&self, generic_associated_types, ti.span,
                                        "generic associated types are unstable");
                 }
+                if !ti.generics.where_clause.predicates.is_empty() {
+                    gate_feature_post!(&self, generic_associated_types, ti.span,
+                                       "where clauses on associated types are unstable");
+                }
             }
             _ => {}
         }