rust/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
734 B
Rust
Raw Normal View History

// 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() {}