-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subtype FRU fields first in type_changing_struct_update
- Loading branch information
1 parent
e652caa
commit 0ec16f3
Showing
4 changed files
with
91 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/test/ui/rfcs/rfc-2528-type-changing-struct-update/coerce-in-base-expr.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// check-pass | ||
|
||
#![feature(type_changing_struct_update)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::any::Any; | ||
|
||
struct Foo<A, B: ?Sized, C: ?Sized> { | ||
a: A, | ||
b: Box<B>, | ||
c: Box<C>, | ||
} | ||
|
||
struct B; | ||
struct C; | ||
|
||
fn main() { | ||
let y = Foo::<usize, dyn Any, dyn Any> { | ||
a: 0, | ||
b: Box::new(B), | ||
..Foo { | ||
a: 0, | ||
b: Box::new(B), | ||
// C needs to be told to coerce to `Box<dyn Any>` | ||
c: Box::new(C), | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters