mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
11 lines
378 B
Rust
11 lines
378 B
Rust
//@ 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>(#[allow(dead_code)] T, B<T, U>);
|
|
struct B<T, U: ?Sized>(#[allow(dead_code)] 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);
|
|
}
|