Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/ui/inline-const/required-const.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// build-fail
// compile-flags: -Zmir-opt-level=3
#![feature(inline_const)]

fn foo<T>() {
if false {
const { panic!() } //~ ERROR E0080
}
}

fn main() {
foo::<i32>();
}
11 changes: 11 additions & 0 deletions tests/ui/inline-const/required-const.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0080]: evaluation of `foo::<i32>::{constant#0}` failed
--> $DIR/required-const.rs:7:17
|
LL | const { panic!() }
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/required-const.rs:7:17
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.