os-rust/tests/ui/type
Matthias Krüger aa184c558f
Rollup merge of #122195 - jieyouxu:impl-return-note, r=fmease
Note that the caller chooses a type for type param

```
error[E0308]: mismatched types
  --> $DIR/return-impl-trait.rs:23:5
   |
LL | fn other_bounds<T>() -> T
   |                 -       -
   |                 |       |
   |                 |       expected `T` because of return type
   |                 |       help: consider using an impl return type: `impl Trait`
   |                 expected this type parameter
...
LL |     ()
   |     ^^ expected type parameter `T`, found `()`
   |
   = note: expected type parameter `T`
                   found unit type `()`
   = note: the caller chooses the type of T which can be different from ()
```

Tried to see if "expected this type parameter" can be replaced, but that goes all the way to `rustc_infer` so seems not worth the effort and can affect other diagnostics.

Revives #112088 and #104755.
2024-03-22 20:31:28 +01:00
..
ascription [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-check When displaying multispans, ignore empty lines adjacent to ... 2024-03-18 16:25:36 +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
clarify-error-for-generics-with-default-issue-120785.rs Update item order in test 2024-02-28 19:28:34 -05:00
clarify-error-for-generics-with-default-issue-120785.stderr Update item order in test 2024-02-28 19:28:34 -05:00
closure-with-wrong-borrows.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
closure-with-wrong-borrows.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-58355.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-58355.stderr Provide more context on derived obligation error primary label 2024-01-30 21:28:18 +00:00
issue-67690-type-alias-bound-diagnostic-crash.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-91268.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-94187-verbose-type-name.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +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 Deduplicate more sized errors on call exprs 2024-01-24 02:53:15 +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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
missing-let-in-binding-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
missing-let-in-binding-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01: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 Show number in error message even for one error 2023-11-24 19:15:52 +01: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 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
missing-let-in-binding.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
missing-let-in-binding.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
missing-let-in-binding.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01: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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-alias-bounds.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +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 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-arg-out-of-scope.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00: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 Detect more cases of = to : typo 2024-03-01 02:03:00 +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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-ascription-with-fn-call.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-ascription-with-fn-call.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-ascription.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +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 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-error-break-tail.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-error-break-tail.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01: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 [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +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 recurse into refs when comparing tys for diagnostics 2023-12-07 23:00:46 -05: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 On object safety error, mention new enum as alternative 2023-10-29 23:55:46 +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 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-parameter-names.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-parameter-names.stderr Note that type param is chosen by caller when suggesting return impl Trait 2024-03-16 23:20:42 +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 Show number in error message even for one error 2023-11-24 19:15:52 +01: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 Note that type param is chosen by caller when suggesting return impl Trait 2024-03-16 23:20:42 +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 Show number in error message even for one error 2023-11-24 19:15:52 +01: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 Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-unsatisfiable.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-unsatisfiable.usage.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
verbose.normal.stderr don't elide shared parts of types in diagnostics when --verbose is passed 2023-12-24 16:47:18 -05:00
verbose.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
verbose.verbose.stderr don't elide shared parts of types in diagnostics when --verbose is passed 2023-12-24 16:47:18 -05: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