about summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-22 04:40:05 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2020-03-27 07:39:14 +0100
commit91194f795c3ce323b50b5caa30c089ec026200f0 (patch)
tree0280be8415580c403d75a51697d2573d499e8939 /src/test/ui/parser
parent6c19a10e24af157b96687ca8dc1b48ebac4b9489 (diff)
downloadrust-91194f795c3ce323b50b5caa30c089ec026200f0.tar.gz
rust-91194f795c3ce323b50b5caa30c089ec026200f0.zip
parse: move constraint/arg restriction to ast_validation.
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/constraints-before-generic-args-syntactic-pass.rs9
-rw-r--r--src/test/ui/parser/issue-32214.rs2
-rw-r--r--src/test/ui/parser/issue-32214.stderr11
3 files changed, 16 insertions, 6 deletions
diff --git a/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.rs b/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.rs
new file mode 100644
index 00000000000..afbd13e6fd9
--- /dev/null
+++ b/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+#[cfg(FALSE)]
+fn syntax() {
+    foo::<T = u8, T: Ord, String>();
+    foo::<T = u8, 'a, T: Ord>();
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/issue-32214.rs b/src/test/ui/parser/issue-32214.rs
index 82f7ce62b94..ca30f5f1329 100644
--- a/src/test/ui/parser/issue-32214.rs
+++ b/src/test/ui/parser/issue-32214.rs
@@ -1,6 +1,6 @@
 trait Trait<T> { type Item; }
 
 pub fn test<W, I: Trait<Item=(), W> >() {}
-//~^ ERROR associated type bindings must be declared after generic parameters
+//~^ ERROR constraints in a path segment must come after generic arguments
 
 fn main() { }
diff --git a/src/test/ui/parser/issue-32214.stderr b/src/test/ui/parser/issue-32214.stderr
index 08b230a14f5..ee99fe70811 100644
--- a/src/test/ui/parser/issue-32214.stderr
+++ b/src/test/ui/parser/issue-32214.stderr
@@ -1,10 +1,11 @@
-error: associated type bindings must be declared after generic parameters
-  --> $DIR/issue-32214.rs:3:25
+error: constraints in a path segment must come after generic arguments
+  --> $DIR/issue-32214.rs:3:24
    |
 LL | pub fn test<W, I: Trait<Item=(), W> >() {}
-   |                         -------^^^
-   |                         |
-   |                         this associated type binding should be moved after the generic parameters
+   |                        ^-------^^-^
+   |                         |        |
+   |                         |        this generic argument must come before the first constraint
+   |                         the first constraint is provided here
 
 error: aborting due to previous error