summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-02-27 18:38:19 +0000
committerbors <bors@rust-lang.org>2020-02-27 18:38:19 +0000
commit6d69caba110c0c2fb90180df1cbc8be5033b91d4 (patch)
treeea43727ec0e56f4eda523aa60ccc346bd085083c /src/test/ui/parser
parent49c68bd53f90e375bfb3cbba8c1c67a9e0adb9c0 (diff)
parentbead79ebc6d0f605f42a0f8315ce9f5fe5764b99 (diff)
downloadrust-6d69caba110c0c2fb90180df1cbc8be5033b91d4.tar.gz
rust-6d69caba110c0c2fb90180df1cbc8be5033b91d4.zip
Auto merge of #68434 - varkor:astconv-mismatch-error, r=nikomatsakis
Move generic arg/param validation to `create_substs_for_generic_args` to resolve various const generics issues

This changes some diagnostics, but I think they're around as helpful as the previous ones, and occur infrequently regardless.

Fixes https://github.com/rust-lang/rust/issues/68257.
Fixes https://github.com/rust-lang/rust/issues/68398.

r? @eddyb
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/issue-14303-fncall.rs2
-rw-r--r--src/test/ui/parser/issue-14303-fncall.stderr9
-rw-r--r--src/test/ui/parser/issue-14303-path.rs2
-rw-r--r--src/test/ui/parser/issue-14303-path.stderr9
4 files changed, 14 insertions, 8 deletions
diff --git a/src/test/ui/parser/issue-14303-fncall.rs b/src/test/ui/parser/issue-14303-fncall.rs
index 39694198cdb..46ece84d69e 100644
--- a/src/test/ui/parser/issue-14303-fncall.rs
+++ b/src/test/ui/parser/issue-14303-fncall.rs
@@ -11,7 +11,7 @@ fn foo<'a, 'b>(start: &'a usize, end: &'a usize) {
     let _x = (*start..*end)
         .map(|x| S { a: start, b: end })
         .collect::<Vec<S<_, 'a>>>();
-        //~^ ERROR lifetime arguments must be declared prior to type arguments
+        //~^ ERROR type provided when a lifetime was expected
 }
 
 fn main() {}
diff --git a/src/test/ui/parser/issue-14303-fncall.stderr b/src/test/ui/parser/issue-14303-fncall.stderr
index 8ef9f1a1a6c..10954223713 100644
--- a/src/test/ui/parser/issue-14303-fncall.stderr
+++ b/src/test/ui/parser/issue-14303-fncall.stderr
@@ -1,8 +1,11 @@
-error: lifetime arguments must be declared prior to type arguments
-  --> $DIR/issue-14303-fncall.rs:13:29
+error[E0747]: type provided when a lifetime was expected
+  --> $DIR/issue-14303-fncall.rs:13:26
    |
 LL |         .collect::<Vec<S<_, 'a>>>();
-   |                             ^^
+   |                          ^
+   |
+   = note: lifetime arguments must be provided before type arguments
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/parser/issue-14303-path.rs b/src/test/ui/parser/issue-14303-path.rs
index 386d19859e4..89ef914aba2 100644
--- a/src/test/ui/parser/issue-14303-path.rs
+++ b/src/test/ui/parser/issue-14303-path.rs
@@ -8,6 +8,6 @@ mod foo {
 }
 
 fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
-//~^ ERROR lifetime arguments must be declared prior to type arguments
+//~^ ERROR type provided when a lifetime was expected
 
 fn main() {}
diff --git a/src/test/ui/parser/issue-14303-path.stderr b/src/test/ui/parser/issue-14303-path.stderr
index 19f2995ebee..c1ad2332b5b 100644
--- a/src/test/ui/parser/issue-14303-path.stderr
+++ b/src/test/ui/parser/issue-14303-path.stderr
@@ -1,8 +1,11 @@
-error: lifetime arguments must be declared prior to type arguments
-  --> $DIR/issue-14303-path.rs:10:40
+error[E0747]: type provided when a lifetime was expected
+  --> $DIR/issue-14303-path.rs:10:37
    |
 LL | fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
-   |                                        ^^  ^^
+   |                                     ^
+   |
+   = note: lifetime arguments must be provided before type arguments
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0747`.