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.
Auto merge of rust-lang#98307 - matthiaskrgr:rollup-rb3huha, r=matthi…
…askrgr Rollup of 4 pull requests Successful merges: - rust-lang#98235 (Drop magic value 3 from code) - rust-lang#98267 (Don't omit comma when suggesting wildcard arm after macro expr) - rust-lang#98276 (Mention formatting macros when encountering `ArgumentV1` method in const) - rust-lang#98296 (Add a link to the unstable book page on Generator doc comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
20 changed files
with
361 additions
and
281 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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const fn failure() { | ||
panic!("{:?}", 0); | ||
//~^ ERROR cannot call non-const formatting macro in constant functions | ||
//~| ERROR erroneous constant used | ||
//~| ERROR erroneous constant used | ||
//~| WARN this was previously accepted by the compiler | ||
//~| WARN this was previously accepted by the compiler | ||
} | ||
|
||
const fn print() { | ||
println!("{:?}", 0); | ||
//~^ ERROR cannot call non-const formatting macro in constant functions | ||
//~| ERROR `Arguments::<'a>::new_v1` is not yet stable as a const fn | ||
//~| ERROR cannot call non-const fn `_print` in constant functions | ||
//~| ERROR erroneous constant used | ||
//~| ERROR erroneous constant used | ||
//~| WARN this was previously accepted by the compiler | ||
//~| WARN this was previously accepted by the compiler | ||
} | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
error[E0015]: cannot call non-const formatting macro in constant functions | ||
--> $DIR/format.rs:2:20 | ||
| | ||
LL | panic!("{:?}", 0); | ||
| ^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
= note: this error originates in the macro `$crate::const_format_args` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0015]: cannot call non-const formatting macro in constant functions | ||
--> $DIR/format.rs:11:22 | ||
| | ||
LL | println!("{:?}", 0); | ||
| ^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: `Arguments::<'a>::new_v1` is not yet stable as a const fn | ||
--> $DIR/format.rs:11:5 | ||
| | ||
LL | println!("{:?}", 0); | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: add `#![feature(const_fmt_arguments_new)]` to the crate attributes to enable | ||
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0015]: cannot call non-const fn `_print` in constant functions | ||
--> $DIR/format.rs:11:5 | ||
| | ||
LL | println!("{:?}", 0); | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
= note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: erroneous constant used | ||
--> $DIR/format.rs:2:12 | ||
| | ||
LL | panic!("{:?}", 0); | ||
| ^^^^^^ referenced constant has errors | ||
| | ||
= note: `#[deny(const_err)]` on by default | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> | ||
|
||
error: erroneous constant used | ||
--> $DIR/format.rs:2:20 | ||
| | ||
LL | panic!("{:?}", 0); | ||
| ^ referenced constant has errors | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> | ||
= note: this error originates in the macro `$crate::const_format_args` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: erroneous constant used | ||
--> $DIR/format.rs:11:14 | ||
| | ||
LL | println!("{:?}", 0); | ||
| ^^^^^^ referenced constant has errors | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> | ||
|
||
error: erroneous constant used | ||
--> $DIR/format.rs:11:22 | ||
| | ||
LL | println!("{:?}", 0); | ||
| ^ referenced constant has errors | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> | ||
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to 8 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0015`. |
Oops, something went wrong.