Closed
Description
I tried this code:
#![no_implicit_prelude]
fn main() {
::core::assert!(false, "wow");
}
I expected to see this happen: It panics at runtime.
Instead, this happened: It fails to compile.
error: cannot find macro `panic` in this scope
--> src/main.rs:4:5
|
4 | ::core::assert!(false, "wow");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: consider importing one of these items:
core::panic
pin_utils::core_reexport::panic
std::panic
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Meta
rustc --version --verbose
:
rustc 1.51.0 (2fd73fabe 2021-03-23)
binary: rustc
commit-hash: 2fd73fabe469357a12c2c974c140f67e7cdd76d0
commit-date: 2021-03-23
host: x86_64-unknown-linux-gnu
release: 1.51.0
LLVM version: 11.0.1