2020-07-17 19:27:41 -05:00
|
|
|
warning: any use of this value will cause an error
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/hint.rs:LL:COL
|
2020-07-17 15:03:33 -05:00
|
|
|
|
|
|
|
|
LL | unsafe { intrinsics::unreachable() }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| |
|
|
|
|
| entering unreachable code
|
2020-09-02 02:40:56 -05:00
|
|
|
| inside `unreachable_unchecked` at $SRC_DIR/core/src/hint.rs:LL:COL
|
2021-04-26 07:53:41 -05:00
|
|
|
| inside `foo` at $DIR/const_unsafe_unreachable_ub.rs:8:18
|
|
|
|
| inside `BAR` at $DIR/const_unsafe_unreachable_ub.rs:13:28
|
2020-07-17 15:03:33 -05:00
|
|
|
|
|
2021-04-26 07:53:41 -05:00
|
|
|
::: $DIR/const_unsafe_unreachable_ub.rs:13:1
|
2020-07-17 15:03:33 -05:00
|
|
|
|
|
|
|
|
LL | const BAR: bool = unsafe { foo(false) };
|
|
|
|
| ----------------------------------------
|
|
|
|
|
|
2020-07-17 19:27:41 -05:00
|
|
|
note: the lint level is defined here
|
2021-04-26 07:53:41 -05:00
|
|
|
--> $DIR/const_unsafe_unreachable_ub.rs:12:8
|
2020-07-17 19:27:41 -05:00
|
|
|
|
|
|
|
|
LL | #[warn(const_err)]
|
|
|
|
| ^^^^^^^^^
|
2021-01-30 07:49:22 -06:00
|
|
|
= 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>
|
2020-07-17 19:27:41 -05:00
|
|
|
|
2021-01-24 05:50:30 -06:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2021-04-26 07:53:41 -05:00
|
|
|
--> $DIR/const_unsafe_unreachable_ub.rs:16:14
|
2020-07-17 19:27:41 -05:00
|
|
|
|
|
|
|
|
LL | assert_eq!(BAR, true);
|
2021-01-24 05:50:30 -06:00
|
|
|
| ^^^ referenced constant has errors
|
2020-07-17 19:27:41 -05:00
|
|
|
|
|
|
|
error: erroneous constant used
|
2021-04-26 07:53:41 -05:00
|
|
|
--> $DIR/const_unsafe_unreachable_ub.rs:16:3
|
2020-07-17 19:27:41 -05:00
|
|
|
|
|
|
|
|
LL | assert_eq!(BAR, true);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
|
|
|
|
|
2020-07-17 15:03:33 -05:00
|
|
|
= note: `#[deny(const_err)]` on by default
|
2021-01-30 07:49:22 -06:00
|
|
|
= 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>
|
2020-07-17 19:27:41 -05:00
|
|
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-07-17 15:03:33 -05:00
|
|
|
|
2020-07-17 19:27:41 -05:00
|
|
|
error: aborting due to 2 previous errors; 1 warning emitted
|
2020-07-17 15:03:33 -05:00
|
|
|
|
2020-07-17 19:27:41 -05:00
|
|
|
For more information about this error, try `rustc --explain E0080`.
|