Skip to content

Commit d5b40bf

Browse files
committed
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.
2 parents e5fddb6 + d708b44 commit d5b40bf

5 files changed

+5
-5
lines changed

tests/ui/logic_bug.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused, clippy::many_single_char_names)]
1+
#![allow(unused, clippy::many_single_char_names, clippy::diverging_sub_expression)]
22
#![warn(clippy::logic_bug)]
33

44
fn main() {

tests/ui/nonminimal_bool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused, clippy::many_single_char_names)]
1+
#![allow(unused, clippy::many_single_char_names, clippy::diverging_sub_expression)]
22
#![warn(clippy::nonminimal_bool)]
33

44
fn main() {

tests/ui/nonminimal_bool_methods.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused, clippy::many_single_char_names)]
1+
#![allow(unused, clippy::many_single_char_names, clippy::diverging_sub_expression)]
22
#![warn(clippy::nonminimal_bool)]
33

44
fn methods_with_negation() {

tests/ui/wildcard_enum_match_arm.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
dead_code,
88
clippy::single_match,
99
clippy::wildcard_in_or_patterns,
10-
clippy::unnested_or_patterns
10+
clippy::unnested_or_patterns, clippy::diverging_sub_expression
1111
)]
1212

1313
use std::io::ErrorKind;

tests/ui/wildcard_enum_match_arm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
dead_code,
88
clippy::single_match,
99
clippy::wildcard_in_or_patterns,
10-
clippy::unnested_or_patterns
10+
clippy::unnested_or_patterns, clippy::diverging_sub_expression
1111
)]
1212

1313
use std::io::ErrorKind;

0 commit comments

Comments
 (0)