diff options
| author | bors <bors@rust-lang.org> | 2022-06-03 12:37:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-03 12:37:16 +0000 |
| commit | e40d5e83dc133d093c22c7ff016b10daa4f40dcf (patch) | |
| tree | dc2a28093b19836d6f14e25763b33904e9d12186 /src/test/ui/array-slice-vec | |
| parent | 72f7e3144a386c820c188350092d2d93a74889b8 (diff) | |
| parent | b343a466c650cd43d81b7fc98d3571eda64fe35b (diff) | |
| download | rust-e40d5e83dc133d093c22c7ff016b10daa4f40dcf.tar.gz rust-e40d5e83dc133d093c22c7ff016b10daa4f40dcf.zip | |
Auto merge of #89862 - lcnr:path-generics-diagnostics, r=estebank
rewrite error handling for unresolved inference vars Pretty much completely rewrites `fn emit_inference_failure_err`. This new setup should hopefully be easier to extend and is already a lot better when looking for generic arguments. Because this is a rewrite there are still some parts which are lacking, these are tracked in #94483 and will be fixed in later PRs. r? `@estebank` `@petrochenkov`
Diffstat (limited to 'src/test/ui/array-slice-vec')
| -rw-r--r-- | src/test/ui/array-slice-vec/infer_array_len.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/array-slice-vec/vector-no-ann.stderr | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/test/ui/array-slice-vec/infer_array_len.stderr b/src/test/ui/array-slice-vec/infer_array_len.stderr index 6eed4ce4f0c..8da6d97251b 100644 --- a/src/test/ui/array-slice-vec/infer_array_len.stderr +++ b/src/test/ui/array-slice-vec/infer_array_len.stderr @@ -2,9 +2,13 @@ error[E0282]: type annotations needed --> $DIR/infer_array_len.rs:19:9 | LL | let [_, _] = a.into(); - | ^^^^^^ consider giving this pattern a type + | ^^^^^^ | = note: type must be known at this point +help: consider giving this pattern a type + | +LL | let [_, _]: _ = a.into(); + | +++ error: aborting due to previous error diff --git a/src/test/ui/array-slice-vec/vector-no-ann.stderr b/src/test/ui/array-slice-vec/vector-no-ann.stderr index 8a7b8d22760..d2ea08aa474 100644 --- a/src/test/ui/array-slice-vec/vector-no-ann.stderr +++ b/src/test/ui/array-slice-vec/vector-no-ann.stderr @@ -1,10 +1,13 @@ error[E0282]: type annotations needed for `Vec<T>` - --> $DIR/vector-no-ann.rs:2:16 + --> $DIR/vector-no-ann.rs:2:9 | LL | let _foo = Vec::new(); - | ---- ^^^^^^^^ cannot infer type for type parameter `T` - | | - | consider giving `_foo` the explicit type `Vec<T>`, where the type parameter `T` is specified + | ^^^^ + | +help: consider giving `_foo` an explicit type, where the type for type parameter `T` is specified + | +LL | let _foo: Vec<T> = Vec::new(); + | ++++++++ error: aborting due to previous error |
