]> git.lizzy.rs Git - rust.git/blob - src/test/ui/structs-enums/struct-order-of-eval-2.rs
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / ui / structs-enums / struct-order-of-eval-2.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 struct S {
5     f0: String,
6     f1: String,
7 }
8
9 pub fn main() {
10     let s = "Hello, world!".to_string();
11     let s = S {
12         f1: s.to_string(),
13         f0: s
14     };
15     assert_eq!(s.f0, "Hello, world!");
16 }