]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/ref-pattern-binding.fixed
Rollup merge of #106805 - madsravn:master, r=compiler-errors
[rust.git] / tests / ui / suggestions / ref-pattern-binding.fixed
1 // run-rustfix
2 #![allow(unused)]
3
4 struct S {
5     f: String,
6 }
7
8 fn main() {
9     let ref _moved @ ref _from = String::from("foo"); //~ ERROR
10     let ref _moved @ ref _from = String::from("foo"); //~ ERROR
11     let ref _moved @ ref _from = String::from("foo"); //~ ERROR
12     //~^ ERROR
13     let ref _moved @ ref _from = String::from("foo"); // ok
14     let ref _moved @ S { ref f } = S { f: String::from("foo") }; //~ ERROR
15     let ref _moved @ S { ref f } = S { f: String::from("foo") }; //~ ERROR
16     //~^ ERROR
17     let ref _moved @ S { ref f } = S { f: String::from("foo") }; // ok
18     let ref _moved @ S { ref f } = S { f: String::from("foo") }; //~ ERROR
19 }