]> git.lizzy.rs Git - rust.git/blob - tests/ui/walk-struct-literal-with.rs
Auto merge of #106742 - compiler-errors:new-solver-make-it-not-ice, r=lcnr
[rust.git] / tests / ui / walk-struct-literal-with.rs
1 struct Mine{
2     test: String,
3     other_val: isize
4 }
5
6 impl Mine{
7     fn make_string_bar(mut self) -> Mine{
8         self.test = "Bar".to_string();
9         self
10     }
11 }
12
13 fn main(){
14     let start = Mine{test:"Foo".to_string(), other_val:0};
15     let end = Mine{other_val:1, ..start.make_string_bar()};
16     println!("{}", start.test); //~ ERROR borrow of moved value: `start`
17 }