mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 05:03:21 +00:00
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:
parent
113c1476c9
commit
d708b444e4
5 changed files with 5 additions and 5 deletions
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue