Rollup merge of #90417 - lcnr:stabilize-relaxed-struct-unsizing, r=wesleywiser

stabilize `relaxed_struct_unsize`

closes #81793

the fcp is already complete.
This commit is contained in:
Matthias Krüger 2021-11-02 23:48:47 +01:00 committed by GitHub
commit bc487f7dd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 70 deletions

View file

@ -1,10 +0,0 @@
// 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; //~ ERROR mismatched types
assert_eq!(y.1.1.len(), 1);
}

View file

@ -1,14 +0,0 @@
error[E0308]: mismatched types
--> $DIR/feature-gate-relaxed_struct_unsize.rs:8:34
|
LL | let y: &A<[u32; 1], [u32]> = &x;
| ------------------- ^^ expected slice `[u32]`, found array `[u32; 1]`
| |
| expected due to this
|
= note: expected reference `&A<[u32; 1], [u32]>`
found reference `&A<[u32; 1], [u32; 1]>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.

View file

@ -1,4 +1,3 @@
#![feature(relaxed_struct_unsize)]
// run-pass
// Test that we allow unsizing even if there is an unchanged param in the
// field getting unsized.