]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/unchanged-param.rs
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / ui / unsized / unchanged-param.rs
1 // run-pass
2 // Test that we allow unsizing even if there is an unchanged param in the
3 // field getting unsized.
4 struct A<T, U: ?Sized + 'static>(#[allow(unused_tuple_struct_fields)] T, B<T, U>);
5 struct B<T, U: ?Sized>(#[allow(unused_tuple_struct_fields)] T, U);
6
7 fn main() {
8     let x: A<[u32; 1], [u32; 1]> = A([0; 1], B([0; 1], [0; 1]));
9     let y: &A<[u32; 1], [u32]> = &x;
10     assert_eq!(y.1.1.len(), 1);
11 }