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