mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
review comments
This commit is contained in:
parent
f1772d5739
commit
bb37e5d3cd
@ -789,11 +789,14 @@ pub enum PatKind<'tcx> {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/// Inline or named constant found while lowering a pattern.
|
/// Inline or named constant found while lowering a pattern.
|
||||||
|
///
|
||||||
|
/// We only mark patterns referencing constants when they are bare names that could have been
|
||||||
|
/// new bindings if the `const` didn't exist.
|
||||||
ExpandedConstant {
|
ExpandedConstant {
|
||||||
/// [DefId] of the constant, we need this so that we have a
|
/// [DefId] of the constant, we need this so that we have a
|
||||||
/// reference that can be used by unsafety checking to visit nested
|
/// reference that can be used by unsafety checking to visit nested
|
||||||
/// unevaluated constants. If the `DefId` doesn't correspond to a local
|
/// unevaluated constants and for diagnostics. If the `DefId` doesn't
|
||||||
/// crate, it points at the `const` item.
|
/// correspond to a local crate, it points at the `const` item.
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
/// If `false`, then `def_id` points at a `const` item, otherwise it
|
/// If `false`, then `def_id` points at a `const` item, otherwise it
|
||||||
/// corresponds to a local inline const.
|
/// corresponds to a local inline const.
|
||||||
|
@ -696,10 +696,6 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> {
|
|||||||
misc_suggestion = Some(MiscPatternSuggestion::AttemptedIntegerLiteral {
|
misc_suggestion = Some(MiscPatternSuggestion::AttemptedIntegerLiteral {
|
||||||
start_span: pat.span.shrink_to_lo(),
|
start_span: pat.span.shrink_to_lo(),
|
||||||
});
|
});
|
||||||
} else if snippet.chars().all(|c| c.is_alphanumeric() || c == '_') {
|
|
||||||
interpreted_as_const = Some(pat.span);
|
|
||||||
interpreted_as_const_sugg =
|
|
||||||
Some(InterpretedAsConst { span: pat.span, variable: snippet });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user