rust/tests/ui/return
Esteban Küber 42ec5c7b32 Detail expectation on non-() block tail in if then condition with no else
When encountering an `if` expression with no `else` where the then
block has a tail expression, we emit an E0308 type error. We now explain
why `()` was expected.
2025-12-22 13:55:49 +00: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 Merge typeck loop with static/const item eval loop 2025-05-09 15:31:27 +00:00
early-return-with-unreachable-code-24353.rs Skip unused variables warning for unreachable code 2025-11-21 08:48:45 +08: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 Make replacement suggestion _ in type verbose 2025-09-29 03:28:52 +00:00
issue-64620.rs hir: Add Become expression kind 2023-06-26 08:56:32 +00:00
issue-64620.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-82612-return-mutable-reference.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-82612-return-mutable-reference.stderr Detail expectation on non-() block tail in if then condition with no else 2025-12-22 13:55:49 +00:00
issue-86188-return-not-in-fn-body.rs hir: Add Become expression kind 2023-06-26 08:56:32 +00:00
issue-86188-return-not-in-fn-body.stderr Tweak multispan rendering 2024-12-12 23:36:27 +00:00
ret-bang.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
ret-non-nil.rs compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
ret-non-nil.stderr compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03: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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
return-from-diverging.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
return-from-residual-sugg-issue-125997.fixed Fixing span manipulation and indentation of the suggestion introduced by #126187 2024-08-25 20:30:06 +08:00
return-from-residual-sugg-issue-125997.rs Suggest adding Result return type for associated method in E0277. 2024-07-23 10:24:45 +08:00
return-from-residual-sugg-issue-125997.stderr Tweak E0277 when predicate comes indirectly from ? 2025-02-20 18:15:39 +00:00
return-impl-trait-bad.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
return-match-array-const.stderr Filter empty lines, comments and delimiters from previous to last multiline span rendering 2024-12-12 23:36:27 +00:00
return-nil.rs tests: remove //@ pretty-expanded usages 2024-11-26 02:50:48 +08:00
return-struct.rs Bugfix: 'can_have_side_effects()' would return 'false' for struct/enum/array/tuple literals unless *all* sub-expressions had side effects. This would easily allow side effects to slip through, and also wrongly label empty literals as having side effects. Add some tests for the last point 2023-08-10 02:26:11 +02:00
return-struct.stderr Point to where missing return type should go 2023-10-04 21:09:54 +00:00
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
return-type.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
return-unit-from-diverging.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
return-unit-from-diverging.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
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 Remove MaybeForgetReturn suggestion 2025-02-22 00:04:26 +00:00
tail-expr-as-potential-return.stderr Detail expectation on non-() block tail in if then condition with no else 2025-12-22 13:55:49 +00:00
tail-expr-if-as-return.rs feat: add unit test 2024-05-16 21:10:07 +08:00
tail-expr-if-as-return.stderr Detail expectation on non-() block tail in if then condition with no else 2025-12-22 13:55:49 +00:00