Auto merge of #78343 - camelid:macros-qualify-panic, r=m-ou-se

Qualify `panic!` as `core::panic!` in non-built-in `core` macros

Fixes #78333.

-----

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.
This commit is contained in:
bors 2020-11-23 22:05:28 +00:00
commit d5b40bf469
5 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
#![allow(unused, clippy::many_single_char_names)] #![allow(unused, clippy::many_single_char_names, clippy::diverging_sub_expression)]
#![warn(clippy::logic_bug)] #![warn(clippy::logic_bug)]
fn main() { fn main() {

View File

@ -1,4 +1,4 @@
#![allow(unused, clippy::many_single_char_names)] #![allow(unused, clippy::many_single_char_names, clippy::diverging_sub_expression)]
#![warn(clippy::nonminimal_bool)] #![warn(clippy::nonminimal_bool)]
fn main() { fn main() {

View File

@ -1,4 +1,4 @@
#![allow(unused, clippy::many_single_char_names)] #![allow(unused, clippy::many_single_char_names, clippy::diverging_sub_expression)]
#![warn(clippy::nonminimal_bool)] #![warn(clippy::nonminimal_bool)]
fn methods_with_negation() { fn methods_with_negation() {

View File

@ -7,7 +7,7 @@
dead_code, dead_code,
clippy::single_match, clippy::single_match,
clippy::wildcard_in_or_patterns, clippy::wildcard_in_or_patterns,
clippy::unnested_or_patterns clippy::unnested_or_patterns, clippy::diverging_sub_expression
)] )]
use std::io::ErrorKind; use std::io::ErrorKind;

View File

@ -7,7 +7,7 @@
dead_code, dead_code,
clippy::single_match, clippy::single_match,
clippy::wildcard_in_or_patterns, clippy::wildcard_in_or_patterns,
clippy::unnested_or_patterns clippy::unnested_or_patterns, clippy::diverging_sub_expression
)] )]
use std::io::ErrorKind; use std::io::ErrorKind;