Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit efe24bd

Browse files
committed
Add a test for rust-lang#3030
1 parent 4c1b0c2 commit efe24bd

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/source/match.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,3 +521,18 @@ fn issue_3040() {
521521
}
522522
}
523523
}
524+
525+
// #3030
526+
fn issue_3030() {
527+
match input.trim().parse::<f64>() {
528+
Ok(val)
529+
if !(
530+
// A valid number is the same as what rust considers to be valid,
531+
// except for +1., NaN, and Infinity.
532+
val.is_infinite() || val
533+
.is_nan() || input.ends_with(".") || input.starts_with("+")
534+
)
535+
=> {
536+
}
537+
}
538+
}

tests/target/match.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,3 +552,15 @@ fn issue_3040() {
552552
}
553553
}
554554
}
555+
556+
// #3030
557+
fn issue_3030() {
558+
match input.trim().parse::<f64>() {
559+
Ok(val)
560+
if !(
561+
// A valid number is the same as what rust considers to be valid,
562+
// except for +1., NaN, and Infinity.
563+
val.is_infinite() || val.is_nan() || input.ends_with(".") || input.starts_with("+")
564+
) => {}
565+
}
566+
}

0 commit comments

Comments
 (0)