]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-64453.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-64453.rs
1 struct Project;
2 struct Value;
3
4 static settings_dir: String = format!("");
5 //~^ ERROR cannot call non-const fn
6 //~| ERROR is not yet stable as a const
7
8 fn from_string(_: String) -> Value {
9     Value
10 }
11 fn set_editor(_: Value) {}
12
13 fn main() {
14     let settings_data = from_string(settings_dir);
15     //~^ ERROR cannot move out of static item
16     let args: i32 = 0;
17
18     match args {
19         ref x if x == &0 => set_editor(settings_data),
20         ref x if x == &1 => set_editor(settings_data),
21         _ => unimplemented!(),
22     }
23 }