diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/inference/ambiguous_type_parameter.rs (renamed from src/test/ui/inference/ambiguous_type_parameter.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/ambiguous_type_parameter.stderr (renamed from src/test/ui/inference/ambiguous_type_parameter.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/auxiliary/inference_unstable_iterator.rs (renamed from src/test/ui/inference/auxiliary/inference_unstable_iterator.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/auxiliary/inference_unstable_itertools.rs (renamed from src/test/ui/inference/auxiliary/inference_unstable_itertools.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/cannot-infer-async.rs (renamed from src/test/ui/inference/cannot-infer-async.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/cannot-infer-async.stderr (renamed from src/test/ui/inference/cannot-infer-async.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/cannot-infer-closure-circular.rs (renamed from src/test/ui/inference/cannot-infer-closure-circular.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/cannot-infer-closure-circular.stderr (renamed from src/test/ui/inference/cannot-infer-closure-circular.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/cannot-infer-closure.rs (renamed from src/test/ui/inference/cannot-infer-closure.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/cannot-infer-closure.stderr (renamed from src/test/ui/inference/cannot-infer-closure.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/cannot-infer-partial-try-return.rs (renamed from src/test/ui/inference/cannot-infer-partial-try-return.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/cannot-infer-partial-try-return.stderr (renamed from src/test/ui/inference/cannot-infer-partial-try-return.stderr) | 2 | ||||
-rw-r--r-- | tests/ui/inference/char-as-str-multi.rs (renamed from src/test/ui/inference/char-as-str-multi.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/char-as-str-multi.stderr (renamed from src/test/ui/inference/char-as-str-multi.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/char-as-str-single.fixed (renamed from src/test/ui/inference/char-as-str-single.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/inference/char-as-str-single.rs (renamed from src/test/ui/inference/char-as-str-single.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/char-as-str-single.stderr (renamed from src/test/ui/inference/char-as-str-single.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/deref-suggestion.rs (renamed from src/test/ui/inference/deref-suggestion.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/deref-suggestion.stderr (renamed from src/test/ui/inference/deref-suggestion.stderr) | 5 | ||||
-rw-r--r-- | tests/ui/inference/erase-type-params-in-label.rs (renamed from src/test/ui/inference/erase-type-params-in-label.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/erase-type-params-in-label.stderr | 37 | ||||
-rw-r--r-- | tests/ui/inference/infer-binary-operand-behind-reference.rs (renamed from src/test/ui/inference/infer-binary-operand-behind-reference.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/inference-variable-behind-raw-pointer.rs (renamed from src/test/ui/inference/inference-variable-behind-raw-pointer.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/inference-variable-behind-raw-pointer.stderr (renamed from src/test/ui/inference/inference-variable-behind-raw-pointer.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/inference_unstable.rs (renamed from src/test/ui/inference/inference_unstable.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/inference_unstable.stderr (renamed from src/test/ui/inference/inference_unstable.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/inference_unstable_featured.rs (renamed from src/test/ui/inference/inference_unstable_featured.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/inference_unstable_featured.stderr (renamed from src/test/ui/inference/inference_unstable_featured.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/inference_unstable_forced.rs (renamed from src/test/ui/inference/inference_unstable_forced.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/inference_unstable_forced.stderr (renamed from src/test/ui/inference/inference_unstable_forced.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-103587.rs (renamed from src/test/ui/inference/issue-103587.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-103587.stderr (renamed from src/test/ui/inference/issue-103587.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-104649.rs (renamed from src/test/ui/inference/issue-104649.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-104649.stderr (renamed from src/test/ui/inference/issue-104649.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-28935.rs (renamed from src/test/ui/inference/issue-28935.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-36053.rs (renamed from src/test/ui/inference/issue-36053.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-70703.rs (renamed from src/test/ui/inference/issue-70703.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-71309.rs (renamed from src/test/ui/inference/issue-71309.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-71309.stderr (renamed from src/test/ui/inference/issue-71309.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-71732.rs (renamed from src/test/ui/inference/issue-71732.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-71732.stderr (renamed from src/test/ui/inference/issue-71732.stderr) | 3 | ||||
-rw-r--r-- | tests/ui/inference/issue-72616.rs (renamed from src/test/ui/inference/issue-72616.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-72616.stderr (renamed from src/test/ui/inference/issue-72616.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-72690.rs (renamed from src/test/ui/inference/issue-72690.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-72690.stderr (renamed from src/test/ui/inference/issue-72690.stderr) | 4 | ||||
-rw-r--r-- | tests/ui/inference/issue-80816.rs | 55 | ||||
-rw-r--r-- | tests/ui/inference/issue-80816.stderr | 29 | ||||
-rw-r--r-- | tests/ui/inference/issue-81522.rs (renamed from src/test/ui/inference/issue-81522.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-83606.rs | 10 | ||||
-rw-r--r-- | tests/ui/inference/issue-83606.stderr (renamed from src/test/ui/inference/issue-83606.stderr) | 4 | ||||
-rw-r--r-- | tests/ui/inference/issue-86162-1.rs (renamed from src/test/ui/inference/issue-86162-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-86162-1.stderr (renamed from src/test/ui/inference/issue-86162-1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-86162-2.rs (renamed from src/test/ui/inference/issue-86162-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/issue-86162-2.stderr (renamed from src/test/ui/inference/issue-86162-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/lub-glb-with-unbound-infer-var.rs (renamed from src/test/ui/inference/lub-glb-with-unbound-infer-var.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/channel.rs (renamed from src/test/ui/inference/need_type_info/channel.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/channel.stderr (renamed from src/test/ui/inference/need_type_info/channel.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/concrete-impl.rs (renamed from src/test/ui/inference/need_type_info/concrete-impl.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/concrete-impl.stderr (renamed from src/test/ui/inference/need_type_info/concrete-impl.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs (renamed from src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr (renamed from src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/expr-struct-type-relative-enum.rs (renamed from src/test/ui/inference/need_type_info/expr-struct-type-relative-enum.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/expr-struct-type-relative-enum.stderr (renamed from src/test/ui/inference/need_type_info/expr-struct-type-relative-enum.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/expr-struct-type-relative-gat.rs (renamed from src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr (renamed from src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/expr-struct-type-relative.rs (renamed from src/test/ui/inference/need_type_info/expr-struct-type-relative.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/expr-struct-type-relative.stderr (renamed from src/test/ui/inference/need_type_info/expr-struct-type-relative.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/issue-103053.rs (renamed from src/test/ui/inference/need_type_info/issue-103053.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/issue-103053.stderr (renamed from src/test/ui/inference/need_type_info/issue-103053.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/self-ty-in-path.rs (renamed from src/test/ui/inference/need_type_info/self-ty-in-path.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/self-ty-in-path.stderr (renamed from src/test/ui/inference/need_type_info/self-ty-in-path.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/type-alias-indirect.rs (renamed from src/test/ui/inference/need_type_info/type-alias-indirect.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/type-alias-indirect.stderr (renamed from src/test/ui/inference/need_type_info/type-alias-indirect.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/type-alias.rs (renamed from src/test/ui/inference/need_type_info/type-alias.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/need_type_info/type-alias.stderr (renamed from src/test/ui/inference/need_type_info/type-alias.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/newlambdas-ret-infer.rs (renamed from src/test/ui/inference/newlambdas-ret-infer.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/newlambdas-ret-infer2.rs (renamed from src/test/ui/inference/newlambdas-ret-infer2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/question-mark-type-infer.rs (renamed from src/test/ui/inference/question-mark-type-infer.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/question-mark-type-infer.stderr | 14 | ||||
-rw-r--r-- | tests/ui/inference/range-type-infer.rs (renamed from src/test/ui/inference/range-type-infer.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/simple-infer.rs (renamed from src/test/ui/inference/simple-infer.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/str-as-char.fixed (renamed from src/test/ui/inference/str-as-char.fixed) | 0 | ||||
-rw-r--r-- | tests/ui/inference/str-as-char.rs (renamed from src/test/ui/inference/str-as-char.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/str-as-char.stderr (renamed from src/test/ui/inference/str-as-char.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/tutorial-suffix-inference-test.rs (renamed from src/test/ui/inference/tutorial-suffix-inference-test.rs) | 0 | ||||
-rw-r--r-- | tests/ui/inference/tutorial-suffix-inference-test.stderr (renamed from src/test/ui/inference/tutorial-suffix-inference-test.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/inference/type-infer-generalize-ty-var.rs (renamed from src/test/ui/inference/type-infer-generalize-ty-var.rs) | 0 |
87 files changed, 153 insertions, 10 deletions
diff --git a/src/test/ui/inference/ambiguous_type_parameter.rs b/tests/ui/inference/ambiguous_type_parameter.rs index dc70ed661..dc70ed661 100644 --- a/src/test/ui/inference/ambiguous_type_parameter.rs +++ b/tests/ui/inference/ambiguous_type_parameter.rs diff --git a/src/test/ui/inference/ambiguous_type_parameter.stderr b/tests/ui/inference/ambiguous_type_parameter.stderr index 9cbe221de..9cbe221de 100644 --- a/src/test/ui/inference/ambiguous_type_parameter.stderr +++ b/tests/ui/inference/ambiguous_type_parameter.stderr diff --git a/src/test/ui/inference/auxiliary/inference_unstable_iterator.rs b/tests/ui/inference/auxiliary/inference_unstable_iterator.rs index 04bc0b1a8..04bc0b1a8 100644 --- a/src/test/ui/inference/auxiliary/inference_unstable_iterator.rs +++ b/tests/ui/inference/auxiliary/inference_unstable_iterator.rs diff --git a/src/test/ui/inference/auxiliary/inference_unstable_itertools.rs b/tests/ui/inference/auxiliary/inference_unstable_itertools.rs index fa1efbcfe..fa1efbcfe 100644 --- a/src/test/ui/inference/auxiliary/inference_unstable_itertools.rs +++ b/tests/ui/inference/auxiliary/inference_unstable_itertools.rs diff --git a/src/test/ui/inference/cannot-infer-async.rs b/tests/ui/inference/cannot-infer-async.rs index b5152d04f..b5152d04f 100644 --- a/src/test/ui/inference/cannot-infer-async.rs +++ b/tests/ui/inference/cannot-infer-async.rs diff --git a/src/test/ui/inference/cannot-infer-async.stderr b/tests/ui/inference/cannot-infer-async.stderr index 0579cf238..0579cf238 100644 --- a/src/test/ui/inference/cannot-infer-async.stderr +++ b/tests/ui/inference/cannot-infer-async.stderr diff --git a/src/test/ui/inference/cannot-infer-closure-circular.rs b/tests/ui/inference/cannot-infer-closure-circular.rs index affb48149..affb48149 100644 --- a/src/test/ui/inference/cannot-infer-closure-circular.rs +++ b/tests/ui/inference/cannot-infer-closure-circular.rs diff --git a/src/test/ui/inference/cannot-infer-closure-circular.stderr b/tests/ui/inference/cannot-infer-closure-circular.stderr index b706cd2bc..b706cd2bc 100644 --- a/src/test/ui/inference/cannot-infer-closure-circular.stderr +++ b/tests/ui/inference/cannot-infer-closure-circular.stderr diff --git a/src/test/ui/inference/cannot-infer-closure.rs b/tests/ui/inference/cannot-infer-closure.rs index bd5d10b41..bd5d10b41 100644 --- a/src/test/ui/inference/cannot-infer-closure.rs +++ b/tests/ui/inference/cannot-infer-closure.rs diff --git a/src/test/ui/inference/cannot-infer-closure.stderr b/tests/ui/inference/cannot-infer-closure.stderr index a4b818e6e..a4b818e6e 100644 --- a/src/test/ui/inference/cannot-infer-closure.stderr +++ b/tests/ui/inference/cannot-infer-closure.stderr diff --git a/src/test/ui/inference/cannot-infer-partial-try-return.rs b/tests/ui/inference/cannot-infer-partial-try-return.rs index b555697dc..b555697dc 100644 --- a/src/test/ui/inference/cannot-infer-partial-try-return.rs +++ b/tests/ui/inference/cannot-infer-partial-try-return.rs diff --git a/src/test/ui/inference/cannot-infer-partial-try-return.stderr b/tests/ui/inference/cannot-infer-partial-try-return.stderr index 2a56aaa44..888c321bc 100644 --- a/src/test/ui/inference/cannot-infer-partial-try-return.stderr +++ b/tests/ui/inference/cannot-infer-partial-try-return.stderr @@ -1,8 +1,6 @@ error[E0282]: type annotations needed --> $DIR/cannot-infer-partial-try-return.rs:20:9 | -LL | infallible()?; - | ------------- type must be known at this point LL | Ok(()) | ^^ cannot infer type of the type parameter `E` declared on the enum `Result` | diff --git a/src/test/ui/inference/char-as-str-multi.rs b/tests/ui/inference/char-as-str-multi.rs index c29a15025..c29a15025 100644 --- a/src/test/ui/inference/char-as-str-multi.rs +++ b/tests/ui/inference/char-as-str-multi.rs diff --git a/src/test/ui/inference/char-as-str-multi.stderr b/tests/ui/inference/char-as-str-multi.stderr index 297ca2b54..297ca2b54 100644 --- a/src/test/ui/inference/char-as-str-multi.stderr +++ b/tests/ui/inference/char-as-str-multi.stderr diff --git a/src/test/ui/inference/char-as-str-single.fixed b/tests/ui/inference/char-as-str-single.fixed index bab1854dc..bab1854dc 100644 --- a/src/test/ui/inference/char-as-str-single.fixed +++ b/tests/ui/inference/char-as-str-single.fixed diff --git a/src/test/ui/inference/char-as-str-single.rs b/tests/ui/inference/char-as-str-single.rs index 736920643..736920643 100644 --- a/src/test/ui/inference/char-as-str-single.rs +++ b/tests/ui/inference/char-as-str-single.rs diff --git a/src/test/ui/inference/char-as-str-single.stderr b/tests/ui/inference/char-as-str-single.stderr index 3375ec6ac..3375ec6ac 100644 --- a/src/test/ui/inference/char-as-str-single.stderr +++ b/tests/ui/inference/char-as-str-single.stderr diff --git a/src/test/ui/inference/deref-suggestion.rs b/tests/ui/inference/deref-suggestion.rs index 0d8e7289d..0d8e7289d 100644 --- a/src/test/ui/inference/deref-suggestion.rs +++ b/tests/ui/inference/deref-suggestion.rs diff --git a/src/test/ui/inference/deref-suggestion.stderr b/tests/ui/inference/deref-suggestion.stderr index 034005697..3db67cdb5 100644 --- a/src/test/ui/inference/deref-suggestion.stderr +++ b/tests/ui/inference/deref-suggestion.stderr @@ -87,7 +87,10 @@ error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:37:5 | LL | assert_eq!(3i32, &3i32); - | ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32` + | ^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected `i32`, found `&i32` + | expected because this is `i32` | = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/inference/erase-type-params-in-label.rs b/tests/ui/inference/erase-type-params-in-label.rs index 1fea2da92..1fea2da92 100644 --- a/src/test/ui/inference/erase-type-params-in-label.rs +++ b/tests/ui/inference/erase-type-params-in-label.rs diff --git a/tests/ui/inference/erase-type-params-in-label.stderr b/tests/ui/inference/erase-type-params-in-label.stderr new file mode 100644 index 000000000..9be182864 --- /dev/null +++ b/tests/ui/inference/erase-type-params-in-label.stderr @@ -0,0 +1,37 @@ +error[E0283]: type annotations needed for `Foo<i32, &str, W, Z>` + --> $DIR/erase-type-params-in-label.rs:2:9 + | +LL | let foo = foo(1, ""); + | ^^^ --- type must be known at this point + | + = note: cannot satisfy `_: Default` +note: required by a bound in `foo` + --> $DIR/erase-type-params-in-label.rs:25:17 + | +LL | fn foo<T, K, W: Default, Z: Default>(t: T, k: K) -> Foo<T, K, W, Z> { + | ^^^^^^^ required by this bound in `foo` +help: consider giving `foo` an explicit type, where the type for type parameter `W` is specified + | +LL | let foo: Foo<i32, &str, W, Z> = foo(1, ""); + | ++++++++++++++++++++++ + +error[E0283]: type annotations needed for `Bar<i32, &str, Z>` + --> $DIR/erase-type-params-in-label.rs:5:9 + | +LL | let bar = bar(1, ""); + | ^^^ --- type must be known at this point + | + = note: cannot satisfy `_: Default` +note: required by a bound in `bar` + --> $DIR/erase-type-params-in-label.rs:14:17 + | +LL | fn bar<T, K, Z: Default>(t: T, k: K) -> Bar<T, K, Z> { + | ^^^^^^^ required by this bound in `bar` +help: consider giving `bar` an explicit type, where the type for type parameter `Z` is specified + | +LL | let bar: Bar<i32, &str, Z> = bar(1, ""); + | +++++++++++++++++++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/ui/inference/infer-binary-operand-behind-reference.rs b/tests/ui/inference/infer-binary-operand-behind-reference.rs index 0c0a3171e..0c0a3171e 100644 --- a/src/test/ui/inference/infer-binary-operand-behind-reference.rs +++ b/tests/ui/inference/infer-binary-operand-behind-reference.rs diff --git a/src/test/ui/inference/inference-variable-behind-raw-pointer.rs b/tests/ui/inference/inference-variable-behind-raw-pointer.rs index 6662e46b1..6662e46b1 100644 --- a/src/test/ui/inference/inference-variable-behind-raw-pointer.rs +++ b/tests/ui/inference/inference-variable-behind-raw-pointer.rs diff --git a/src/test/ui/inference/inference-variable-behind-raw-pointer.stderr b/tests/ui/inference/inference-variable-behind-raw-pointer.stderr index 3dea09e7f..3dea09e7f 100644 --- a/src/test/ui/inference/inference-variable-behind-raw-pointer.stderr +++ b/tests/ui/inference/inference-variable-behind-raw-pointer.stderr diff --git a/src/test/ui/inference/inference_unstable.rs b/tests/ui/inference/inference_unstable.rs index daf0cf042..daf0cf042 100644 --- a/src/test/ui/inference/inference_unstable.rs +++ b/tests/ui/inference/inference_unstable.rs diff --git a/src/test/ui/inference/inference_unstable.stderr b/tests/ui/inference/inference_unstable.stderr index ecbf2641b..ecbf2641b 100644 --- a/src/test/ui/inference/inference_unstable.stderr +++ b/tests/ui/inference/inference_unstable.stderr diff --git a/src/test/ui/inference/inference_unstable_featured.rs b/tests/ui/inference/inference_unstable_featured.rs index 792b29aaa..792b29aaa 100644 --- a/src/test/ui/inference/inference_unstable_featured.rs +++ b/tests/ui/inference/inference_unstable_featured.rs diff --git a/src/test/ui/inference/inference_unstable_featured.stderr b/tests/ui/inference/inference_unstable_featured.stderr index 4ddede29c..4ddede29c 100644 --- a/src/test/ui/inference/inference_unstable_featured.stderr +++ b/tests/ui/inference/inference_unstable_featured.stderr diff --git a/src/test/ui/inference/inference_unstable_forced.rs b/tests/ui/inference/inference_unstable_forced.rs index 649b3ed2a..649b3ed2a 100644 --- a/src/test/ui/inference/inference_unstable_forced.rs +++ b/tests/ui/inference/inference_unstable_forced.rs diff --git a/src/test/ui/inference/inference_unstable_forced.stderr b/tests/ui/inference/inference_unstable_forced.stderr index a1c4cd851..a1c4cd851 100644 --- a/src/test/ui/inference/inference_unstable_forced.stderr +++ b/tests/ui/inference/inference_unstable_forced.stderr diff --git a/src/test/ui/inference/issue-103587.rs b/tests/ui/inference/issue-103587.rs index 11536f9f4..11536f9f4 100644 --- a/src/test/ui/inference/issue-103587.rs +++ b/tests/ui/inference/issue-103587.rs diff --git a/src/test/ui/inference/issue-103587.stderr b/tests/ui/inference/issue-103587.stderr index b373fbfbb..b373fbfbb 100644 --- a/src/test/ui/inference/issue-103587.stderr +++ b/tests/ui/inference/issue-103587.stderr diff --git a/src/test/ui/inference/issue-104649.rs b/tests/ui/inference/issue-104649.rs index 4637b884d..4637b884d 100644 --- a/src/test/ui/inference/issue-104649.rs +++ b/tests/ui/inference/issue-104649.rs diff --git a/src/test/ui/inference/issue-104649.stderr b/tests/ui/inference/issue-104649.stderr index 4962b21f9..4962b21f9 100644 --- a/src/test/ui/inference/issue-104649.stderr +++ b/tests/ui/inference/issue-104649.stderr diff --git a/src/test/ui/inference/issue-28935.rs b/tests/ui/inference/issue-28935.rs index 872822dbd..872822dbd 100644 --- a/src/test/ui/inference/issue-28935.rs +++ b/tests/ui/inference/issue-28935.rs diff --git a/src/test/ui/inference/issue-36053.rs b/tests/ui/inference/issue-36053.rs index 5c6d07804..5c6d07804 100644 --- a/src/test/ui/inference/issue-36053.rs +++ b/tests/ui/inference/issue-36053.rs diff --git a/src/test/ui/inference/issue-70703.rs b/tests/ui/inference/issue-70703.rs index d90498e96..d90498e96 100644 --- a/src/test/ui/inference/issue-70703.rs +++ b/tests/ui/inference/issue-70703.rs diff --git a/src/test/ui/inference/issue-71309.rs b/tests/ui/inference/issue-71309.rs index c31107d8f..c31107d8f 100644 --- a/src/test/ui/inference/issue-71309.rs +++ b/tests/ui/inference/issue-71309.rs diff --git a/src/test/ui/inference/issue-71309.stderr b/tests/ui/inference/issue-71309.stderr index af8714f1c..af8714f1c 100644 --- a/src/test/ui/inference/issue-71309.stderr +++ b/tests/ui/inference/issue-71309.stderr diff --git a/src/test/ui/inference/issue-71732.rs b/tests/ui/inference/issue-71732.rs index 8a9d2b235..8a9d2b235 100644 --- a/src/test/ui/inference/issue-71732.rs +++ b/tests/ui/inference/issue-71732.rs diff --git a/src/test/ui/inference/issue-71732.stderr b/tests/ui/inference/issue-71732.stderr index 79bee3328..01b37f2ac 100644 --- a/src/test/ui/inference/issue-71732.stderr +++ b/tests/ui/inference/issue-71732.stderr @@ -12,9 +12,6 @@ LL | .get(&"key".into()) where T: ?Sized; note: required by a bound in `HashMap::<K, V, S>::get` --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL - | -LL | K: Borrow<Q>, - | ^^^^^^^^^ required by this bound in `HashMap::<K, V, S>::get` help: consider specifying the generic argument | LL | .get::<Q>(&"key".into()) diff --git a/src/test/ui/inference/issue-72616.rs b/tests/ui/inference/issue-72616.rs index 69ade1a75..69ade1a75 100644 --- a/src/test/ui/inference/issue-72616.rs +++ b/tests/ui/inference/issue-72616.rs diff --git a/src/test/ui/inference/issue-72616.stderr b/tests/ui/inference/issue-72616.stderr index 6ee0626ca..6ee0626ca 100644 --- a/src/test/ui/inference/issue-72616.stderr +++ b/tests/ui/inference/issue-72616.stderr diff --git a/src/test/ui/inference/issue-72690.rs b/tests/ui/inference/issue-72690.rs index 8c0a0f51a..8c0a0f51a 100644 --- a/src/test/ui/inference/issue-72690.rs +++ b/tests/ui/inference/issue-72690.rs diff --git a/src/test/ui/inference/issue-72690.stderr b/tests/ui/inference/issue-72690.stderr index d4eeda073..8eda71ec0 100644 --- a/src/test/ui/inference/issue-72690.stderr +++ b/tests/ui/inference/issue-72690.stderr @@ -32,8 +32,8 @@ LL | |x| String::from("x".as_ref()); | help: consider giving this closure parameter an explicit type | -LL | |x: _| String::from("x".as_ref()); - | +++ +LL | |x: /* Type */| String::from("x".as_ref()); + | ++++++++++++ error[E0283]: type annotations needed --> $DIR/issue-72690.rs:12:26 diff --git a/tests/ui/inference/issue-80816.rs b/tests/ui/inference/issue-80816.rs new file mode 100644 index 000000000..4d319b449 --- /dev/null +++ b/tests/ui/inference/issue-80816.rs @@ -0,0 +1,55 @@ +#![allow(unreachable_code)] + +use std::marker::PhantomData; +use std::ops::Deref; +use std::sync::Arc; + +pub struct Guard<T> { + _phantom: PhantomData<T>, +} +impl<T> Deref for Guard<T> { + type Target = T; + fn deref(&self) -> &T { + unimplemented!() + } +} + +pub struct DirectDeref<T>(T); +impl<T> Deref for DirectDeref<Arc<T>> { + type Target = T; + fn deref(&self) -> &T { + unimplemented!() + } +} + +pub trait Access<T> { + type Guard: Deref<Target = T>; + fn load(&self) -> Self::Guard { + unimplemented!() + } +} +impl<T, A: Access<T>, P: Deref<Target = A>> Access<T> for P { + //~^ NOTE: required for `Arc<ArcSwapAny<Arc<usize>>>` to implement `Access<_>` + //~| NOTE unsatisfied trait bound introduced here + type Guard = A::Guard; +} +impl<T> Access<T> for ArcSwapAny<T> { + //~^ NOTE: multiple `impl`s satisfying `ArcSwapAny<Arc<usize>>: Access<_>` found + type Guard = Guard<T>; +} +impl<T> Access<T> for ArcSwapAny<Arc<T>> { + type Guard = DirectDeref<Arc<T>>; +} + +pub struct ArcSwapAny<T> { + _phantom_arc: PhantomData<T>, +} + +pub fn foo() { + let s: Arc<ArcSwapAny<Arc<usize>>> = unimplemented!(); + let guard: Guard<Arc<usize>> = s.load(); + //~^ ERROR: type annotations needed + //~| HELP: try using a fully qualified path to specify the expected types +} + +fn main() {} diff --git a/tests/ui/inference/issue-80816.stderr b/tests/ui/inference/issue-80816.stderr new file mode 100644 index 000000000..80c0c8abe --- /dev/null +++ b/tests/ui/inference/issue-80816.stderr @@ -0,0 +1,29 @@ +error[E0283]: type annotations needed + --> $DIR/issue-80816.rs:50:38 + | +LL | let guard: Guard<Arc<usize>> = s.load(); + | ^^^^ + | +note: multiple `impl`s satisfying `ArcSwapAny<Arc<usize>>: Access<_>` found + --> $DIR/issue-80816.rs:36:1 + | +LL | impl<T> Access<T> for ArcSwapAny<T> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | impl<T> Access<T> for ArcSwapAny<Arc<T>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: required for `Arc<ArcSwapAny<Arc<usize>>>` to implement `Access<_>` + --> $DIR/issue-80816.rs:31:45 + | +LL | impl<T, A: Access<T>, P: Deref<Target = A>> Access<T> for P { + | --------- ^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here +help: try using a fully qualified path to specify the expected types + | +LL | let guard: Guard<Arc<usize>> = <Arc<ArcSwapAny<Arc<usize>>> as Access<T>>::load(&s); + | ++++++++++++++++++++++++++++++++++++++++++++++++++ ~ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/ui/inference/issue-81522.rs b/tests/ui/inference/issue-81522.rs index 902f8fdde..902f8fdde 100644 --- a/src/test/ui/inference/issue-81522.rs +++ b/tests/ui/inference/issue-81522.rs diff --git a/tests/ui/inference/issue-83606.rs b/tests/ui/inference/issue-83606.rs new file mode 100644 index 000000000..c387046e9 --- /dev/null +++ b/tests/ui/inference/issue-83606.rs @@ -0,0 +1,10 @@ +// Regression test for #83606. + +fn foo<const N: usize>(_: impl std::fmt::Display) -> [usize; N] { + [0; N] +} + +fn main() { + let _ = foo("foo"); + //~^ ERROR: type annotations needed for `[usize; N]` +} diff --git a/src/test/ui/inference/issue-83606.stderr b/tests/ui/inference/issue-83606.stderr index f5c84f960..f2ee8692e 100644 --- a/src/test/ui/inference/issue-83606.stderr +++ b/tests/ui/inference/issue-83606.stderr @@ -1,4 +1,4 @@ -error[E0282]: type annotations needed for `[usize; _]` +error[E0282]: type annotations needed for `[usize; N]` --> $DIR/issue-83606.rs:8:9 | LL | let _ = foo("foo"); @@ -6,7 +6,7 @@ LL | let _ = foo("foo"); | help: consider giving this pattern a type, where the the value of const parameter `N` is specified | -LL | let _: [usize; _] = foo("foo"); +LL | let _: [usize; N] = foo("foo"); | ++++++++++++ error: aborting due to previous error diff --git a/src/test/ui/inference/issue-86162-1.rs b/tests/ui/inference/issue-86162-1.rs index 5a547eb38..5a547eb38 100644 --- a/src/test/ui/inference/issue-86162-1.rs +++ b/tests/ui/inference/issue-86162-1.rs diff --git a/src/test/ui/inference/issue-86162-1.stderr b/tests/ui/inference/issue-86162-1.stderr index 4f621b82d..4f621b82d 100644 --- a/src/test/ui/inference/issue-86162-1.stderr +++ b/tests/ui/inference/issue-86162-1.stderr diff --git a/src/test/ui/inference/issue-86162-2.rs b/tests/ui/inference/issue-86162-2.rs index b8c75dd77..b8c75dd77 100644 --- a/src/test/ui/inference/issue-86162-2.rs +++ b/tests/ui/inference/issue-86162-2.rs diff --git a/src/test/ui/inference/issue-86162-2.stderr b/tests/ui/inference/issue-86162-2.stderr index 9aff2cec1..9aff2cec1 100644 --- a/src/test/ui/inference/issue-86162-2.stderr +++ b/tests/ui/inference/issue-86162-2.stderr diff --git a/src/test/ui/inference/lub-glb-with-unbound-infer-var.rs b/tests/ui/inference/lub-glb-with-unbound-infer-var.rs index c9e117089..c9e117089 100644 --- a/src/test/ui/inference/lub-glb-with-unbound-infer-var.rs +++ b/tests/ui/inference/lub-glb-with-unbound-infer-var.rs diff --git a/src/test/ui/inference/need_type_info/channel.rs b/tests/ui/inference/need_type_info/channel.rs index e2ba5a941..e2ba5a941 100644 --- a/src/test/ui/inference/need_type_info/channel.rs +++ b/tests/ui/inference/need_type_info/channel.rs diff --git a/src/test/ui/inference/need_type_info/channel.stderr b/tests/ui/inference/need_type_info/channel.stderr index e33ace033..e33ace033 100644 --- a/src/test/ui/inference/need_type_info/channel.stderr +++ b/tests/ui/inference/need_type_info/channel.stderr diff --git a/src/test/ui/inference/need_type_info/concrete-impl.rs b/tests/ui/inference/need_type_info/concrete-impl.rs index 72e0e74f3..72e0e74f3 100644 --- a/src/test/ui/inference/need_type_info/concrete-impl.rs +++ b/tests/ui/inference/need_type_info/concrete-impl.rs diff --git a/src/test/ui/inference/need_type_info/concrete-impl.stderr b/tests/ui/inference/need_type_info/concrete-impl.stderr index aa3296995..aa3296995 100644 --- a/src/test/ui/inference/need_type_info/concrete-impl.stderr +++ b/tests/ui/inference/need_type_info/concrete-impl.stderr diff --git a/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs b/tests/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs index 3084f6eac..3084f6eac 100644 --- a/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs +++ b/tests/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs diff --git a/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr b/tests/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr index 2ad35ab03..2ad35ab03 100644 --- a/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr +++ b/tests/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative-enum.rs b/tests/ui/inference/need_type_info/expr-struct-type-relative-enum.rs index 42af9fa8d..42af9fa8d 100644 --- a/src/test/ui/inference/need_type_info/expr-struct-type-relative-enum.rs +++ b/tests/ui/inference/need_type_info/expr-struct-type-relative-enum.rs diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative-enum.stderr b/tests/ui/inference/need_type_info/expr-struct-type-relative-enum.stderr index 68ecb3813..68ecb3813 100644 --- a/src/test/ui/inference/need_type_info/expr-struct-type-relative-enum.stderr +++ b/tests/ui/inference/need_type_info/expr-struct-type-relative-enum.stderr diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs b/tests/ui/inference/need_type_info/expr-struct-type-relative-gat.rs index b0c0d3397..b0c0d3397 100644 --- a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs +++ b/tests/ui/inference/need_type_info/expr-struct-type-relative-gat.rs diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr b/tests/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr index cbc2477de..cbc2477de 100644 --- a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr +++ b/tests/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative.rs b/tests/ui/inference/need_type_info/expr-struct-type-relative.rs index c3ece2b16..c3ece2b16 100644 --- a/src/test/ui/inference/need_type_info/expr-struct-type-relative.rs +++ b/tests/ui/inference/need_type_info/expr-struct-type-relative.rs diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative.stderr b/tests/ui/inference/need_type_info/expr-struct-type-relative.stderr index 397d8e7be..397d8e7be 100644 --- a/src/test/ui/inference/need_type_info/expr-struct-type-relative.stderr +++ b/tests/ui/inference/need_type_info/expr-struct-type-relative.stderr diff --git a/src/test/ui/inference/need_type_info/issue-103053.rs b/tests/ui/inference/need_type_info/issue-103053.rs index 05169666f..05169666f 100644 --- a/src/test/ui/inference/need_type_info/issue-103053.rs +++ b/tests/ui/inference/need_type_info/issue-103053.rs diff --git a/src/test/ui/inference/need_type_info/issue-103053.stderr b/tests/ui/inference/need_type_info/issue-103053.stderr index 84f0475d8..84f0475d8 100644 --- a/src/test/ui/inference/need_type_info/issue-103053.stderr +++ b/tests/ui/inference/need_type_info/issue-103053.stderr diff --git a/src/test/ui/inference/need_type_info/self-ty-in-path.rs b/tests/ui/inference/need_type_info/self-ty-in-path.rs index 768a8cc37..768a8cc37 100644 --- a/src/test/ui/inference/need_type_info/self-ty-in-path.rs +++ b/tests/ui/inference/need_type_info/self-ty-in-path.rs diff --git a/src/test/ui/inference/need_type_info/self-ty-in-path.stderr b/tests/ui/inference/need_type_info/self-ty-in-path.stderr index 04b521dbd..04b521dbd 100644 --- a/src/test/ui/inference/need_type_info/self-ty-in-path.stderr +++ b/tests/ui/inference/need_type_info/self-ty-in-path.stderr diff --git a/src/test/ui/inference/need_type_info/type-alias-indirect.rs b/tests/ui/inference/need_type_info/type-alias-indirect.rs index 0ed02ddc5..0ed02ddc5 100644 --- a/src/test/ui/inference/need_type_info/type-alias-indirect.rs +++ b/tests/ui/inference/need_type_info/type-alias-indirect.rs diff --git a/src/test/ui/inference/need_type_info/type-alias-indirect.stderr b/tests/ui/inference/need_type_info/type-alias-indirect.stderr index 6161690df..6161690df 100644 --- a/src/test/ui/inference/need_type_info/type-alias-indirect.stderr +++ b/tests/ui/inference/need_type_info/type-alias-indirect.stderr diff --git a/src/test/ui/inference/need_type_info/type-alias.rs b/tests/ui/inference/need_type_info/type-alias.rs index f921b046b..f921b046b 100644 --- a/src/test/ui/inference/need_type_info/type-alias.rs +++ b/tests/ui/inference/need_type_info/type-alias.rs diff --git a/src/test/ui/inference/need_type_info/type-alias.stderr b/tests/ui/inference/need_type_info/type-alias.stderr index a33f49baf..a33f49baf 100644 --- a/src/test/ui/inference/need_type_info/type-alias.stderr +++ b/tests/ui/inference/need_type_info/type-alias.stderr diff --git a/src/test/ui/inference/newlambdas-ret-infer.rs b/tests/ui/inference/newlambdas-ret-infer.rs index 9b629838f..9b629838f 100644 --- a/src/test/ui/inference/newlambdas-ret-infer.rs +++ b/tests/ui/inference/newlambdas-ret-infer.rs diff --git a/src/test/ui/inference/newlambdas-ret-infer2.rs b/tests/ui/inference/newlambdas-ret-infer2.rs index abe31a05f..abe31a05f 100644 --- a/src/test/ui/inference/newlambdas-ret-infer2.rs +++ b/tests/ui/inference/newlambdas-ret-infer2.rs diff --git a/src/test/ui/inference/question-mark-type-infer.rs b/tests/ui/inference/question-mark-type-infer.rs index 10560f85e..10560f85e 100644 --- a/src/test/ui/inference/question-mark-type-infer.rs +++ b/tests/ui/inference/question-mark-type-infer.rs diff --git a/tests/ui/inference/question-mark-type-infer.stderr b/tests/ui/inference/question-mark-type-infer.stderr new file mode 100644 index 000000000..a9cb7e525 --- /dev/null +++ b/tests/ui/inference/question-mark-type-infer.stderr @@ -0,0 +1,14 @@ +error[E0282]: type annotations needed + --> $DIR/question-mark-type-infer.rs:10:21 + | +LL | l.iter().map(f).collect()? + | ^^^^^^^ cannot infer type of the type parameter `B` declared on the associated function `collect` + | +help: consider specifying the generic argument + | +LL | l.iter().map(f).collect::<Vec<_>>()? + | ++++++++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/inference/range-type-infer.rs b/tests/ui/inference/range-type-infer.rs index f07c04171..f07c04171 100644 --- a/src/test/ui/inference/range-type-infer.rs +++ b/tests/ui/inference/range-type-infer.rs diff --git a/src/test/ui/inference/simple-infer.rs b/tests/ui/inference/simple-infer.rs index 561e4fdec..561e4fdec 100644 --- a/src/test/ui/inference/simple-infer.rs +++ b/tests/ui/inference/simple-infer.rs diff --git a/src/test/ui/inference/str-as-char.fixed b/tests/ui/inference/str-as-char.fixed index 6aea809cb..6aea809cb 100644 --- a/src/test/ui/inference/str-as-char.fixed +++ b/tests/ui/inference/str-as-char.fixed diff --git a/src/test/ui/inference/str-as-char.rs b/tests/ui/inference/str-as-char.rs index eaa8d788c..eaa8d788c 100644 --- a/src/test/ui/inference/str-as-char.rs +++ b/tests/ui/inference/str-as-char.rs diff --git a/src/test/ui/inference/str-as-char.stderr b/tests/ui/inference/str-as-char.stderr index 2c84dac8e..2c84dac8e 100644 --- a/src/test/ui/inference/str-as-char.stderr +++ b/tests/ui/inference/str-as-char.stderr diff --git a/src/test/ui/inference/tutorial-suffix-inference-test.rs b/tests/ui/inference/tutorial-suffix-inference-test.rs index 849adfd53..849adfd53 100644 --- a/src/test/ui/inference/tutorial-suffix-inference-test.rs +++ b/tests/ui/inference/tutorial-suffix-inference-test.rs diff --git a/src/test/ui/inference/tutorial-suffix-inference-test.stderr b/tests/ui/inference/tutorial-suffix-inference-test.stderr index d83a1367d..d83a1367d 100644 --- a/src/test/ui/inference/tutorial-suffix-inference-test.stderr +++ b/tests/ui/inference/tutorial-suffix-inference-test.stderr diff --git a/src/test/ui/inference/type-infer-generalize-ty-var.rs b/tests/ui/inference/type-infer-generalize-ty-var.rs index a3d6916cb..a3d6916cb 100644 --- a/src/test/ui/inference/type-infer-generalize-ty-var.rs +++ b/tests/ui/inference/type-infer-generalize-ty-var.rs |