about summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2022-02-14 13:25:26 +0100
committerlcnr <rust@lcnr.de>2022-06-02 10:19:15 +0200
commit3fe346e7a3776d01541fc973c4a7bb686ef3b1a8 (patch)
treee890126d4103bf4c098a2803e0e4982d79650ed9 /src/test/ui/parser
parent721fc7320850596a20ad417397f5fc8820cd87da (diff)
downloadrust-3fe346e7a3776d01541fc973c4a7bb686ef3b1a8.tar.gz
rust-3fe346e7a3776d01541fc973c4a7bb686ef3b1a8.zip
add new `emit_inference_failure_err`
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr7
-rw-r--r--src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr22
2 files changed, 18 insertions, 11 deletions
diff --git a/src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr b/src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr
index 34f1397ce1d..85c9fe409db 100644
--- a/src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr
+++ b/src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr
@@ -116,7 +116,12 @@ error[E0282]: type annotations needed
   --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:14
    |
 LL |         V = [Vec::new; { [0].len() ].len() as isize,
-   |              ^^^^^^^^ cannot infer type for type parameter `T`
+   |              ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Vec`
+   |
+help: consider specifying the generic argument
+   |
+LL |         V = [Vec::<T>::new; { [0].len() ].len() as isize,
+   |                 +++++
 
 error: aborting due to 14 previous errors
 
diff --git a/src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr b/src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr
index 427234e97cf..bad241634cb 100644
--- a/src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr
+++ b/src/test/ui/parser/missing-closing-angle-bracket-eq-constraint.stderr
@@ -40,24 +40,26 @@ LL |   let v : Vec<'a> = vec![];
    |                 +
 
 error[E0282]: type annotations needed for `Vec<T>`
-  --> $DIR/missing-closing-angle-bracket-eq-constraint.rs:7:25
+  --> $DIR/missing-closing-angle-bracket-eq-constraint.rs:7:7
    |
 LL |   let v : Vec<(u32,_) = vec![];
-   |       -                 ^^^^^^ cannot infer type for type parameter `T`
-   |       |
-   |       consider giving `v` the explicit type `Vec<T>`, where the type parameter `T` is specified
+   |       ^
+   |
+help: consider giving `v` an explicit type, where the type for type parameter `T` is specified
    |
-   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+LL |   let v: Vec<T> : Vec<(u32,_) = vec![];
+   |        ++++++++
 
 error[E0282]: type annotations needed for `Vec<T>`
-  --> $DIR/missing-closing-angle-bracket-eq-constraint.rs:18:20
+  --> $DIR/missing-closing-angle-bracket-eq-constraint.rs:18:7
    |
 LL |   let v : Vec<'a = vec![];
-   |       -            ^^^^^^ cannot infer type for type parameter `T`
-   |       |
-   |       consider giving `v` the explicit type `Vec<T>`, where the type parameter `T` is specified
+   |       ^
+   |
+help: consider giving `v` an explicit type, where the type for type parameter `T` is specified
    |
-   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
+LL |   let v: Vec<T> : Vec<'a = vec![];
+   |        ++++++++
 
 error: aborting due to 5 previous errors