2024-12-23 21:49:48 +00:00
|
|
|
error[E0015]: cannot call non-const function `format` in statics
|
2019-09-30 11:05:04 +02:00
|
|
|
--> $DIR/issue-64453.rs:4:31
|
|
|
|
|
|
|
|
|
|
|
LL | static settings_dir: String = format!("");
|
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
2021-12-10 01:10:05 +08:00
|
|
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
|
2024-02-20 20:55:13 -07:00
|
|
|
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
|
2021-02-13 14:52:25 -05:00
|
|
|
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2019-09-30 11:05:04 +02:00
|
|
|
|
2021-07-16 16:54:47 +02:00
|
|
|
error[E0507]: cannot move out of static item `settings_dir`
|
2024-10-06 19:59:19 +02:00
|
|
|
--> $DIR/issue-64453.rs:13:37
|
2021-07-16 16:54:47 +02:00
|
|
|
|
|
|
|
|
|
LL | let settings_data = from_string(settings_dir);
|
|
|
|
|
| ^^^^^^^^^^^^ move occurs because `settings_dir` has type `String`, which does not implement the `Copy` trait
|
2024-03-13 03:41:41 +00:00
|
|
|
|
|
|
|
|
|
help: consider cloning the value if the performance cost is acceptable
|
|
|
|
|
|
|
|
|
|
|
LL | let settings_data = from_string(settings_dir.clone());
|
|
|
|
|
| ++++++++
|
2021-07-16 16:54:47 +02:00
|
|
|
|
2024-10-06 19:59:19 +02:00
|
|
|
error: aborting due to 2 previous errors
|
2019-09-30 11:05:04 +02:00
|
|
|
|
2020-05-21 12:49:38 -07:00
|
|
|
Some errors have detailed explanations: E0015, E0507.
|
|
|
|
|
For more information about an error, try `rustc --explain E0015`.
|