]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized/unchanged-param.rs
Auto merge of #86155 - alexcrichton:abort-on-unwind, r=nikomatsakis
[rust.git] / src / test / ui / unsized / unchanged-param.rs
1 #![feature(relaxed_struct_unsize)]
2 // run-pass
3 // Test that we allow unsizing even if there is an unchanged param in the
4 // field getting unsized.
5 struct A<T, U: ?Sized + 'static>(T, B<T, U>);
6 struct B<T, U: ?Sized>(T, U);
7
8 fn main() {
9     let x: A<[u32; 1], [u32; 1]> = A([0; 1], B([0; 1], [0; 1]));
10     let y: &A<[u32; 1], [u32]> = &x;
11     assert_eq!(y.1.1.len(), 1);
12 }