os-rust/tests/ui/type
bors 94bc9c737e Auto merge of #114811 - estebank:impl-ambiguity, r=wesleywiser
Show more information when multiple `impl`s apply

- When there are `impl`s without type params, show only those (to avoid showing overly generic `impl`s).
```
error[E0283]: type annotations needed
  --> $DIR/multiple-impl-apply.rs:34:9
   |
LL |     let y = x.into();
   |         ^     ---- type must be known at this point
   |
note: multiple `impl`s satisfying `_: From<Baz>` found
  --> $DIR/multiple-impl-apply.rs:14:1
   |
LL | impl From<Baz> for Bar {
   | ^^^^^^^^^^^^^^^^^^^^^^
...
LL | impl From<Baz> for Foo {
   | ^^^^^^^^^^^^^^^^^^^^^^
   = note: required for `Baz` to implement `Into<_>`
help: consider giving `y` an explicit type
   |
LL |     let y: /* Type */ = x.into();
   |          ++++++++++++
```

- Lower the importance of `T: Sized`, `T: WellFormed` and coercion errors, to prioritize more relevant errors. The pre-existing deduplication logic deals with hiding redundant errors better that way, and we show errors with more metadata that is useful to the user.

- Show `<SelfTy as Trait>::assoc_fn` suggestion in more cases.
```
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
  --> $DIR/cross-return-site-inference.rs:38:16
   |
LL |     return Err(From::from("foo"));
   |                ^^^^^^^^^^ cannot call associated function of trait
   |
help: use a fully-qualified path to a specific available implementation
   |
LL |     return Err(</* self type */ as From>::from("foo"));
   |                +++++++++++++++++++     +
```

Fix #88284.
2023-10-06 18:44:32 +00:00
..
ascription soften the wording for removing type ascription 2023-05-01 16:37:00 +08:00
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-check Reorder fullfillment errors to keep more interesting ones first 2023-10-04 02:04:14 +00:00
binding-assigned-block-without-tail-expression.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
binding-assigned-block-without-tail-expression.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
closure-with-wrong-borrows.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
closure-with-wrong-borrows.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-58355.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-58355.stderr Note base types of coercion 2023-05-12 00:10:52 +00:00
issue-67690-type-alias-bound-diagnostic-crash.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-67690-type-alias-bound-diagnostic-crash.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-91268.rs Exit when there are unmatched delims to avoid noisy diagnostics 2023-02-28 07:55:19 +00:00
issue-91268.stderr remove duplicated diagnostic for unclosed delimiter 2023-02-28 07:57:17 +00:00
issue-94187-verbose-type-name.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-100584.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-100584.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-101866.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-101866.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-102598.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-102598.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-103271.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-103271.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
missing-let-in-binding-2.fixed Suggest let for possible binding with ty 2023-05-08 10:56:20 +08:00
missing-let-in-binding-2.rs Suggest let for possible binding with ty 2023-05-08 10:56:20 +08:00
missing-let-in-binding-2.stderr Suggest let for possible binding with ty 2023-05-08 10:56:20 +08:00
missing-let-in-binding-3.rs fix ice in suggesting 2023-05-08 11:16:17 +08:00
missing-let-in-binding-3.stderr fix ice in suggesting 2023-05-08 11:16:17 +08:00
missing-let-in-binding-4.rs code refactor and fix wrong suggestion 2023-05-08 14:56:36 +08:00
missing-let-in-binding-4.stderr code refactor and fix wrong suggestion 2023-05-08 14:56:36 +08:00
missing-let-in-binding.fixed Rip it out 2023-05-01 16:15:13 +08:00
missing-let-in-binding.rs Rip it out 2023-05-01 16:15:13 +08:00
missing-let-in-binding.stderr Rip it out 2023-05-01 16:15:13 +08:00
option-ref-advice.rs Rename tests/ui/issues/issue-100605.rs to ../type/option-ref-advice.rs 2023-08-05 15:36:19 +02:00
option-ref-advice.stderr Rename tests/ui/issues/issue-100605.rs to ../type/option-ref-advice.rs 2023-08-05 15:36:19 +02:00
subtyping-opaque-type.rs move subtyper change reveal_all 2023-10-05 18:56:30 +03:00
type-alias-bounds.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-alias-bounds.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-annotation-needed.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-annotation-needed.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-arg-out-of-scope.rs Generalize E0401 2023-09-10 23:06:14 +02:00
type-arg-out-of-scope.stderr Generalize E0401 2023-09-10 23:06:14 +02:00
type-ascription-instead-of-initializer.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-ascription-instead-of-initializer.stderr Make removal suggestion not verbose 2023-02-14 20:22:10 +00:00
type-ascription-instead-of-statement-end.rs Rip it out 2023-05-01 16:15:13 +08:00
type-ascription-instead-of-statement-end.stderr soften the wording for removing type ascription 2023-05-01 16:37:00 +08:00
type-ascription-precedence.rs fix test cases 2023-05-01 16:15:17 +08:00
type-ascription-precedence.stderr fix test cases 2023-05-01 16:15:17 +08:00
type-ascription-soundness.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-ascription-soundness.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
type-ascription-with-fn-call.fixed Rip it out 2023-05-01 16:15:13 +08:00
type-ascription-with-fn-call.rs Rip it out 2023-05-01 16:15:13 +08:00
type-ascription-with-fn-call.stderr soften the wording for removing type ascription 2023-05-01 16:37:00 +08:00
type-ascription.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-check-defaults.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-check-defaults.stderr Don't sort strings right after we just sorted by types 2023-06-27 23:31:06 +00:00
type-dependent-def-issue-49241.rs Suppress "erroneous constant used" for constants tainted by errors 2023-05-15 00:00:00 +00:00
type-dependent-def-issue-49241.stderr Suppress "erroneous constant used" for constants tainted by errors 2023-05-15 00:00:00 +00:00
type-error-break-tail.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-error-break-tail.stderr Use verbose suggestion for break without value 2023-09-25 22:10:08 +00:00
type-mismatch-multiple.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-mismatch-multiple.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-mismatch-same-crate-name.rs Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
type-mismatch-same-crate-name.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
type-mismatch.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-mismatch.stderr Tweak borrow suggestion 2023-05-08 03:36:30 +00:00
type-parameter-defaults-referencing-Self-ppaux.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-parameter-defaults-referencing-Self-ppaux.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-parameter-defaults-referencing-Self.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-parameter-defaults-referencing-Self.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-parameter-names.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-parameter-names.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-params-in-different-spaces-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-params-in-different-spaces-1.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-params-in-different-spaces-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-params-in-different-spaces-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-params-in-different-spaces-3.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-params-in-different-spaces-3.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-path-err-node-types.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-path-err-node-types.stderr refactor(resolve): clean up the early error return caused by non-call 2023-05-10 22:35:01 +08:00
type-recursive-box-shadowed.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-recursive-box-shadowed.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-recursive.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-recursive.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-shadow.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-shadow.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-unsatisfiable.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-unsatisfiable.usage.stderr Provide RHS type hint when reporting operator error 2023-04-27 01:34:03 +00:00
wrong-call-return-type-due-to-generic-arg.rs Emit a hint for bad call return types due to generic arguments 2023-01-13 13:34:55 +09:00
wrong-call-return-type-due-to-generic-arg.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00