Fix double warning about illegal floating-point literal pattern
This commit is contained in:
parent
5249414809
commit
d019c71df9
12 changed files with 50 additions and 272 deletions
|
@ -272,12 +272,14 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> {
|
|||
|
||||
let kind = match cv.ty.kind() {
|
||||
ty::Float(_) => {
|
||||
tcx.struct_span_lint_hir(
|
||||
lint::builtin::ILLEGAL_FLOATING_POINT_LITERAL_PATTERN,
|
||||
id,
|
||||
span,
|
||||
|lint| lint.build("floating-point types cannot be used in patterns").emit(),
|
||||
);
|
||||
if self.include_lint_checks {
|
||||
tcx.struct_span_lint_hir(
|
||||
lint::builtin::ILLEGAL_FLOATING_POINT_LITERAL_PATTERN,
|
||||
id,
|
||||
span,
|
||||
|lint| lint.build("floating-point types cannot be used in patterns").emit(),
|
||||
);
|
||||
}
|
||||
PatKind::Constant { value: cv }
|
||||
}
|
||||
ty::Adt(adt_def, _) if adt_def.is_union() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue