rust/src/test/ui/macros/issue-78333.rs
Camelid d37e1e186e Qualify panic! as core::panic! in non-built-in core macros
Otherwise code like this

    #![no_implicit_prelude]

    fn main() {
        ::std::todo!();
        ::std::unimplemented!();
    }

will fail to compile, which is unfortunate and presumably unintended.

This changes many invocations of `panic!` in a `macro_rules!` definition
to invocations of `$crate::panic!`, which makes the invocations hygienic.

Note that this does not make the built-in macro `assert!` hygienic.
2020-11-23 11:28:25 -08:00

14 lines
231 B
Rust

// build-pass
#![no_implicit_prelude]
fn main() {
::std::panic!();
::std::todo!();
::std::unimplemented!();
::std::assert_eq!(0, 0);
::std::assert_ne!(0, 1);
::std::dbg!(123);
::std::unreachable!();
}