Skip to content

Commit f929a49

Browse files
committed
NaN patterns: indicate that is_NaN is a method
1 parent fdd71be commit f929a49

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc/middle/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[arm]) {
119119
for walk_pat(*pat) |p| {
120120
if pat_matches_nan(p) {
121121
cx.tcx.sess.span_warn(p.span, "unmatchable NaN in pattern, \
122-
use is_NaN() in a guard instead");
122+
use the is_NaN method in a guard instead");
123123
}
124124
}
125125

src/test/compile-fail/issue-6804.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ fn main() {
88
NaN => {},
99
_ => {},
1010
};
11-
//~^^^ WARNING unmatchable NaN in pattern, use is_NaN() in a guard instead
11+
//~^^^ WARNING unmatchable NaN in pattern, use the is_NaN method in a guard instead
1212
match [x, 1.0] {
1313
[NaN, _] => {},
1414
_ => {},
1515
};
16-
//~^^^ WARNING unmatchable NaN in pattern, use is_NaN() in a guard instead
16+
//~^^^ WARNING unmatchable NaN in pattern, use the is_NaN method in a guard instead
1717
}
1818

1919
// At least one error is needed so that compilation fails

0 commit comments

Comments
 (0)