mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
ace436743f
Without it non-WF types could pass typeck and then later fail in MIR/const eval
17 lines
734 B
Rust
17 lines
734 B
Rust
// Regression test for #121443
|
|
// Checks that no ICE occurs upon encountering
|
|
// a tuple with unsized element that is not
|
|
// the last element
|
|
|
|
type Fn = dyn FnOnce() -> u8;
|
|
|
|
const TEST: Fn = some_fn;
|
|
//~^ ERROR cannot find value `some_fn` in this scope
|
|
//~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time
|
|
//~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time
|
|
const TEST2: (Fn, u8) = (TEST, 0);
|
|
//~^ ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time
|
|
//~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time
|
|
|
|
fn main() {}
|