rust/tests/ui/return
Matthias Krüger 80cf576f59
Rollup merge of #127110 - surechen:fix_125488_06, r=compiler-errors
Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.

Recommit after refactoring based on comment:
https://github.com/rust-lang/rust/pull/126017#issuecomment-2189149361

But when changing return type's lifetime to `ReError` will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message.
```rust
fn test11(x: &usize) -> &_ {
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
    &x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear)
}
```

fixes #125488

r? ``@pnkfelix``
2024-06-29 22:10:58 +02:00
..
dont-suggest-through-inner-const.rs Don't skip inner const when looking for body for suggestion 2024-05-23 19:49:48 -04:00
dont-suggest-through-inner-const.stderr Don't skip inner const when looking for body for suggestion 2024-05-23 19:49:48 -04:00
infer-return-ty-for-fn-sig-issue-125488.fixed Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. 2024-06-29 14:23:33 +08:00
infer-return-ty-for-fn-sig-issue-125488.rs Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. 2024-06-29 14:23:33 +08:00
infer-return-ty-for-fn-sig-issue-125488.stderr Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. 2024-06-29 14:23:33 +08:00
issue-64620.rs
issue-64620.stderr
issue-82612-return-mutable-reference.rs
issue-82612-return-mutable-reference.stderr
issue-86188-return-not-in-fn-body.rs
issue-86188-return-not-in-fn-body.stderr
ret-bang.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
ret-non-nil.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
ret-non-nil.stderr Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
return-disjoint-regions.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
return-disjoint-regions.stderr Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
return-from-diverging.rs
return-from-diverging.stderr
return-from-residual-sugg-issue-125997.fixed For E0277 suggest adding Result return type for function which using QuesionMark ? in the body. 2024-06-12 11:33:22 +08:00
return-from-residual-sugg-issue-125997.rs For E0277 suggest adding Result return type for function which using QuesionMark ? in the body. 2024-06-12 11:33:22 +08:00
return-from-residual-sugg-issue-125997.stderr For E0277 suggest adding Result return type for function which using QuesionMark ? in the body. 2024-06-12 11:33:22 +08:00
return-impl-trait-bad.rs
return-impl-trait-bad.stderr Note that type param is chosen by caller when suggesting return impl Trait 2024-03-16 23:20:42 +00:00
return-impl-trait.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
return-impl-trait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
return-impl-trait.stderr Note that type param is chosen by caller when suggesting return impl Trait 2024-03-16 23:20:42 +00:00
return-match-array-const.rs
return-match-array-const.stderr
return-nil.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
return-struct.rs
return-struct.stderr
return-ty-mismatch-note.rs tests: update tests for more conservative return ty mismatch note 2024-06-18 21:06:53 +00:00
return-ty-mismatch-note.stderr tests: update tests for more conservative return ty mismatch note 2024-06-18 21:06:53 +00:00
return-type.rs
return-type.stderr
return-unit-from-diverging.rs
return-unit-from-diverging.stderr
suggest-a-value.rs Suggest value on bare return 2024-04-14 09:42:53 -04:00
suggest-a-value.stderr Fix 1-tuple value suggestion 2024-04-14 09:42:53 -04:00
tail-expr-as-potential-return.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
tail-expr-as-potential-return.stderr
tail-expr-if-as-return.rs feat: add unit test 2024-05-16 21:10:07 +08:00
tail-expr-if-as-return.stderr feat: add unit test 2024-05-16 21:10:07 +08:00