File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -426,8 +426,10 @@ pub macro debug_assert_matches($($arg:tt)*) {
426
426
#[ macro_export]
427
427
#[ stable( feature = "matches_macro" , since = "1.42.0" ) ]
428
428
#[ rustc_diagnostic_item = "matches_macro" ]
429
+ #[ allow_internal_unstable( non_exhaustive_omitted_patterns_lint, stmt_expr_attributes) ]
429
430
macro_rules! matches {
430
431
( $expression: expr, $pattern: pat $( if $guard: expr) ? $( , ) ?) => {
432
+ #[ allow( non_exhaustive_omitted_patterns) ]
431
433
match $expression {
432
434
$pattern $( if $guard) ? => true ,
433
435
_ => false
Original file line number Diff line number Diff line change 76
76
#![ feature( min_specialization) ]
77
77
#![ feature( never_type) ]
78
78
#![ feature( next_index) ]
79
+ #![ feature( non_exhaustive_omitted_patterns_lint) ]
79
80
#![ feature( numfmt) ]
80
81
#![ feature( pattern) ]
81
82
#![ feature( pointer_is_aligned_to) ]
Original file line number Diff line number Diff line change @@ -213,3 +213,9 @@ fn _expression() {
213
213
}
214
214
) ;
215
215
}
216
+
217
+ #[ deny( non_exhaustive_omitted_patterns) ]
218
+ fn _matches_does_not_trigger_non_exhaustive_omitted_patterns_lint ( o : core:: sync:: atomic:: Ordering ) {
219
+ // Ordering is a #[non_exhaustive] enum from a separate crate
220
+ let _m = matches ! ( o, core:: sync:: atomic:: Ordering :: Relaxed ) ;
221
+ }
You can’t perform that action at this time.
0 commit comments