]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dst/dst-bad-deep-2.rs
Rollup merge of #100479 - compiler-errors:argument-type-error-improvements, r=lcnr
[rust.git] / src / test / ui / dst / dst-bad-deep-2.rs
1 // Try to initialise a DST struct where the lost information is deeply nested.
2 // This is an error because it requires an unsized rvalue. This is a problem
3 // because it would require stack allocation of an unsized temporary (*g in the
4 // test).
5
6 #![feature(unsized_tuple_coercion)]
7
8 pub fn main() {
9     let f: ([isize; 3],) = ([5, 6, 7],);
10     let g: &([isize],) = &f;
11     let h: &(([isize],),) = &(*g,);
12     //~^ ERROR the size for values of type
13 }