Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
300901b70509a0af2d971aa6f6104300da24212c
rust/tests/ui/macros/issue-78333.rs

14 lines
231 B
Rust
Raw Normal View History

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-10-24 18:35:46 -07:00
// 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!();
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1330ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API