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.
This commit is contained in:
Camelid 2020-10-24 18:35:46 -07:00
parent 113c1476c9
commit d708b444e4
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)]
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)]
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)]
fn methods_with_negation() {

View file

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

View file

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