rust/tests/ui/issues/issue-25901.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
741 B
Plaintext
Raw Permalink Normal View History

error[E0015]: cannot perform non-const deref coercion on `A` in statics
2018-12-25 15:56:47 +00:00
--> $DIR/issue-25901.rs:4:24
2018-07-15 21:11:54 +00:00
|
LL | static S: &'static B = &A;
2023-04-16 11:12:37 +00:00
| ^^
2021-12-09 17:10:05 +00:00
|
= note: attempting to deref into `B`
note: deref defined here
--> $DIR/issue-25901.rs:10:5
|
LL | type Target = B;
| ^^^^^^^^^^^
note: impl defined here, but it is not `const`
--> $DIR/issue-25901.rs:9:1
|
LL | impl Deref for A {
| ^^^^^^^^^^^^^^^^
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
2018-07-15 21:11:54 +00:00
error: aborting due to 1 previous error
2018-07-15 21:11:54 +00:00
For more information about this error, try `rustc --explain E0015`.