2020-07-18 00:27:41 +00:00
|
|
|
warning: any use of this value will cause an error
|
2020-07-17 20:03:33 +00:00
|
|
|
--> $SRC_DIR/libcore/hint.rs:LL:COL
|
|
|
|
|
|
|
|
|
LL | unsafe { intrinsics::unreachable() }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| entering unreachable code
|
|
|
|
| inside `std::hint::unreachable_unchecked` at $SRC_DIR/libcore/hint.rs:LL:COL
|
2020-07-18 00:27:41 +00:00
|
|
|
| inside `foo` at $DIR/const_unsafe_unreachable_ub.rs:9:18
|
|
|
|
| inside `BAR` at $DIR/const_unsafe_unreachable_ub.rs:14:28
|
2020-07-17 20:03:33 +00:00
|
|
|
|
|
2020-07-18 00:27:41 +00:00
|
|
|
::: $DIR/const_unsafe_unreachable_ub.rs:14:1
|
2020-07-17 20:03:33 +00:00
|
|
|
|
|
|
|
|
LL | const BAR: bool = unsafe { foo(false) };
|
|
|
|
| ----------------------------------------
|
|
|
|
|
|
2020-07-18 00:27:41 +00:00
|
|
|
note: the lint level is defined here
|
|
|
|
--> $DIR/const_unsafe_unreachable_ub.rs:13:8
|
|
|
|
|
|
|
|
|
LL | #[warn(const_err)]
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0080]: evaluation of constant expression failed
|
|
|
|
--> $DIR/const_unsafe_unreachable_ub.rs:17:3
|
|
|
|
|
|
|
|
|
LL | assert_eq!(BAR, true);
|
|
|
|
| ^^^^^^^^^^^---^^^^^^^^
|
|
|
|
| |
|
|
|
|
| referenced constant has errors
|
|
|
|
|
|
|
|
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
|
|
|
|
error: erroneous constant used
|
|
|
|
--> $DIR/const_unsafe_unreachable_ub.rs:17:3
|
|
|
|
|
|
|
|
|
LL | assert_eq!(BAR, true);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
|
|
|
|
|
2020-07-17 20:03:33 +00:00
|
|
|
= note: `#[deny(const_err)]` on by default
|
2020-07-18 00:27:41 +00:00
|
|
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-07-17 20:03:33 +00:00
|
|
|
|
2020-07-18 00:27:41 +00:00
|
|
|
error: aborting due to 2 previous errors; 1 warning emitted
|
2020-07-17 20:03:33 +00:00
|
|
|
|
2020-07-18 00:27:41 +00:00
|
|
|
For more information about this error, try `rustc --explain E0080`.
|