summary refs log tree commit diff
path: root/src/test/ui/unsized/unchanged-param.rs
blob: 93c7af68ac388e145714fe11c473d29eb0b5b16b (plain)
1
2
3
4
5
6
7
8
9
10
11
// run-pass
// Test that we allow unsizing even if there is an unchanged param in the
// field getting unsized.
struct A<T, U: ?Sized + 'static>(T, B<T, U>);
struct B<T, U: ?Sized>(T, U);

fn main() {
    let x: A<[u32; 1], [u32; 1]> = A([0; 1], B([0; 1], [0; 1]));
    let y: &A<[u32; 1], [u32]> = &x;
    assert_eq!(y.1.1.len(), 1);
}