diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.rs')
-rw-r--r-- | src/test/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.rs | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/test/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.rs b/src/test/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.rs deleted file mode 100644 index dae1241d3..000000000 --- a/src/test/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.rs +++ /dev/null @@ -1,56 +0,0 @@ -#![feature(type_changing_struct_update)] -#![allow(incomplete_features)] - -struct Machine<'a, S, M> { - state: S, - message: M, - lt_str: &'a str, - common_field: i32, -} - -struct State1; -struct State2; - -struct Message1; -struct Message2; - -fn update() { - let m1: Machine<State1, Message1> = Machine { - state: State1, - message: Message1, - lt_str: "hello", - common_field: 2, - }; - // single type update - let m2: Machine<State2, Message1> = Machine { - state: State2, - ..m1 - }; - // multiple type update - let m3: Machine<State2, Message2> = Machine { - state: State2, - message: Message2, - ..m1 - }; -} - -fn fail_update() { - let m1: Machine<f64, f64> = Machine { - state: 3.2, - message: 6.4, - lt_str: "hello", - common_field: 2, - }; - // single type update fail - let m2: Machine<i32, f64> = Machine { - ..m1 - //~^ ERROR mismatched types [E0308] - }; - // multiple type update fail - let m3 = Machine::<i32, i32> { - ..m1 - //~^ ERROR mismatched types [E0308] - }; -} - -fn main() {} |