forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#87003 - m-ou-se:rollup-x7mhv3v, r=m-ou-se
Rollup of 5 pull requests Successful merges: - rust-lang#86855 (Fix comments about unique borrows) - rust-lang#86881 (Inline implementation of lookup_line) - rust-lang#86937 (Change linked tracking issue for more_qualified_paths) - rust-lang#86994 (Update the comment on `lower_expr_try`) - rust-lang#87000 (Use #[track_caller] in const panic diagnostics.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
12 changed files
with
83 additions
and
55 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#![feature(const_panic)] | ||
#![allow(non_fmt_panics)] | ||
#![crate_type = "lib"] | ||
|
||
#[track_caller] | ||
const fn a() -> u32 { | ||
panic!("hey") | ||
} | ||
|
||
#[track_caller] | ||
const fn b() -> u32 { | ||
a() | ||
} | ||
|
||
const fn c() -> u32 { | ||
b() | ||
//~^ ERROR evaluation of constant value failed | ||
//~| NOTE the evaluated program panicked | ||
//~| NOTE inside | ||
} | ||
|
||
const X: u32 = c(); | ||
//~^ NOTE inside |
15 changes: 15 additions & 0 deletions
15
src/test/ui/consts/const-eval/const_panic_track_caller.stderr
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,15 @@ | ||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/const_panic_track_caller.rs:16:5 | ||
| | ||
LL | b() | ||
| ^^^ | ||
| | | ||
| the evaluated program panicked at 'hey', $DIR/const_panic_track_caller.rs:16:5 | ||
| inside `c` at $DIR/const_panic_track_caller.rs:16:5 | ||
... | ||
LL | const X: u32 = c(); | ||
| --- inside `X` at $DIR/const_panic_track_caller.rs:22:16 | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0080`. |
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