-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8574982
commit 8231957
Showing
6 changed files
with
61 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
error[E0015]: cannot perform deref coercion on `A` in statics | ||
error[E0658]: cannot call conditionally-const method `<A as Deref>::deref` in statics | ||
--> $DIR/issue-25901.rs:4:24 | ||
| | ||
LL | static S: &'static B = &A; | ||
| ^^ | ||
| | ||
= 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(|| ...)` | ||
= note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information | ||
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0015`. | ||
For more information about this error, try `rustc --explain E0658`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters