File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ struct Value;
33
44static settings_dir: String = format ! ( "" ) ;
55//~^ ERROR calls in statics are limited to constant functions
6- //~| ERROR calls in statics are limited to constant functions
76
87fn from_string ( _: String ) -> Value {
98 Value
Original file line number Diff line number Diff line change 11error[E0507]: cannot move out of static item `settings_dir`
2- --> $DIR/issue-64453.rs:14 :37
2+ --> $DIR/issue-64453.rs:13 :37
33 |
44LL | let settings_data = from_string(settings_dir);
55 | ^^^^^^^^^^^^ move occurs because `settings_dir` has type `String`, which does not implement the `Copy` trait
66
7- error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
8- --> $DIR/issue-64453.rs:4:31
9- |
10- LL | static settings_dir: String = format!("");
11- | ^^^^^^^^^^^
12- |
13- = note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
14-
157error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
168 --> $DIR/issue-64453.rs:4:31
179 |
@@ -20,7 +12,7 @@ LL | static settings_dir: String = format!("");
2012 |
2113 = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
2214
23- error: aborting due to 3 previous errors
15+ error: aborting due to 2 previous errors
2416
2517Some errors have detailed explanations: E0015, E0507.
2618For more information about an error, try `rustc --explain E0015`.
You can’t perform that action at this time.
0 commit comments