File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ // Checks that the compiler complains about the missing closure body and does not
2+ // crash.
3+ // This is a regression test for <https://github.com/rust-lang/rust/issues/143128>.
4+
5+ fn main ( ) { |b : [ str ; _] | { } ; }
6+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for closures
7+ //~| ERROR the size for values of type `str` cannot be known at compilation time
Original file line number Diff line number Diff line change 1+ error[E0121]: the placeholder `_` is not allowed within types on item signatures for closures
2+ --> $DIR/missing-body.rs:5:23
3+ |
4+ LL | fn main() { |b: [str; _]| {}; }
5+ | ^ not allowed in type signatures
6+
7+ error[E0277]: the size for values of type `str` cannot be known at compilation time
8+ --> $DIR/missing-body.rs:5:17
9+ |
10+ LL | fn main() { |b: [str; _]| {}; }
11+ | ^^^^^^^^ doesn't have a size known at compile-time
12+ |
13+ = help: the trait `Sized` is not implemented for `str`
14+ = note: slice and array elements must have `Sized` type
15+
16+ error: aborting due to 2 previous errors
17+
18+ Some errors have detailed explanations: E0121, E0277.
19+ For more information about an error, try `rustc --explain E0121`.
You can’t perform that action at this time.
0 commit comments