Skip to content

Commit 591b724

Browse files
Rollup merge of #154369 - ver-nyan:fix-bit_or-pat_macro-msg, r=JohnTitor
Fix `pattern_from_macro_note` for bit-or expr This is a continuation of issue rust-lang/rust#99380 (and pr rust-lang/rust#124488) but covers bit-or pattern. Essentially a `pat1 | pat2`, or any bit-or pattern used in a `$e:expr` was not firing the `.pattern_from_macro_note` diagnostic bc `ast::Expr::is_approximately_pattern()` did not cover bit-or. The cover for bit-or is only added in `lower_expr_within_pat()`, otherwise doing it in `is_approximately_pattern()` would result in the suggestion `if (i + 2) = 2 => if let (i + 2) = 2` from `suggest_pattern_match_with_let()` (which is the only other place `ast::Expr::is_approximately_pattern()` is used from what i see). resolves rust-lang/rust#99380 refs rust-lang/rust#124488
2 parents ed60ee9 + 7c07fa3 commit 591b724

0 file changed

File tree

    0 commit comments

    Comments
     (0)