forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#132823 - RalfJung:conditional-const-calls, …
…r=fee1-dead,compiler-errors require const_impl_trait gate for all conditional and trait const calls Alternative to rust-lang#132786. `@compiler-errors` this is basically what I meant with my proposals. I found it's easier to express this in code than English. ;) r? `@compiler-errors`
- Loading branch information
Showing
15 changed files
with
272 additions
and
395 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
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,28 +1,13 @@ | ||
error[E0015]: cannot call non-const fn `<cross_crate::Const as cross_crate::MyTrait>::func` in constant functions | ||
--> $DIR/cross-crate.rs:23:11 | ||
error[E0658]: cannot call conditionally-const method `<cross_crate::Const as cross_crate::MyTrait>::func` in constant functions | ||
--> $DIR/cross-crate.rs:22:5 | ||
| | ||
LL | Const.func(); | ||
| ^^^^^^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
help: add `#![feature(const_trait_impl)]` to the crate attributes to enable | ||
| | ||
LL + #![feature(const_trait_impl)] | ||
| | ||
|
||
error[E0015]: cannot call non-const fn `<cross_crate::Const as cross_crate::MyTrait>::func` in constant functions | ||
--> $DIR/cross-crate.rs:23:11 | ||
| | ||
LL | Const.func(); | ||
| ^^^^^^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
help: add `#![feature(const_trait_impl)]` to the crate attributes to enable | ||
| | ||
LL + #![feature(const_trait_impl)] | ||
| ^^^^^^^^^^^^ | ||
| | ||
= 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 2 previous errors | ||
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`. |
Oops, something went wrong.