Skip to content

Commit edd7d4a

Browse files
committedMar 22, 2023
More general captures
This avoids repetition
1 parent febd59e commit edd7d4a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎compiler/rustc_codegen_llvm/src/llvm_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
424424
.filter_map(|s| {
425425
let enable_disable = match s.chars().next() {
426426
None => return None,
427-
Some(c @ '+' | c @ '-') => c,
427+
Some(c @ ('+' | '-')) => c,
428428
Some(_) => {
429429
if diagnostics {
430430
sess.emit_warning(UnknownCTargetFeaturePrefix { feature: s });

‎compiler/rustc_hir_typeck/src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
231231

232232
let ty = ensure_sufficient_stack(|| match &expr.kind {
233233
hir::ExprKind::Path(
234-
qpath @ hir::QPath::Resolved(..) | qpath @ hir::QPath::TypeRelative(..),
234+
qpath @ (hir::QPath::Resolved(..) | hir::QPath::TypeRelative(..)),
235235
) => self.check_expr_path(qpath, expr, args),
236236
_ => self.check_expr_kind(expr, expected),
237237
});

‎compiler/rustc_resolve/src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
703703
PathResult::NonModule(path_res) if let Some(res) = path_res.full_res() => {
704704
check_consistency(self, &path, path_span, kind, initial_res, res)
705705
}
706-
path_res @ PathResult::NonModule(..) | path_res @ PathResult::Failed { .. } => {
706+
path_res @ (PathResult::NonModule(..) | PathResult::Failed { .. }) => {
707707
let mut suggestion = None;
708708
let (span, label) = if let PathResult::Failed { span, label, .. } = path_res {
709709
// try to suggest if it's not a macro, maybe a function

0 commit comments

Comments
 (0)
Please sign in to comment.