]> git.lizzy.rs Git - rust.git/commitdiff
Move E0006 into E0005
authorManish Goregaokar <manishsmail@gmail.com>
Mon, 29 Jun 2015 17:27:35 +0000 (22:57 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Thu, 23 Jul 2015 07:15:11 +0000 (12:45 +0530)
src/librustc/diagnostics.rs
src/librustc/middle/check_match.rs

index 0c3c9b2ec8011faec42e2d38576e452da2166c65..75d94cdffb13db61df179a42bc86081323e0c250 100644 (file)
@@ -72,7 +72,7 @@ fn foo(x: Option<String>) {
 E0003: r##"
 Not-a-Number (NaN) values cannot be compared for equality and hence can never
 match the input to a match expression. To match against NaN values, you should
-instead use the `is_nan()` method in a guard, like so: 
+instead use the `is_nan()` method in a guard, like so:
 
 ```
 match number {
@@ -96,7 +96,6 @@ fn foo(x: Option<String>) {
 "anything else".
 "##,
 
-// FIXME: Remove duplication here?
 E0005: r##"
 Patterns used to bind names must be irrefutable, that is, they must guarantee
 that a name will be extracted in all cases. If you encounter this error you
@@ -104,13 +103,6 @@ fn foo(x: Option<String>) {
 failure.
 "##,
 
-E0006: r##"
-Patterns used to bind names must be irrefutable, that is, they must guarantee
-that a name will be extracted in all cases. If you encounter this error you
-probably need to use a `match` or `if let` to deal with the possibility of
-failure.
-"##,
-
 E0007: r##"
 This error indicates that the bindings in a match arm would require a value to
 be moved into more than one location, thus violating unique ownership. Code like
@@ -1262,6 +1254,7 @@ fn foo<'a>(arg: &Box<SomeTrait+'a>) { ... }
 
 
 register_diagnostics! {
+    // E0006 // merged with E0005
     E0017,
     E0022,
     E0038,
index d8c2341df2d9f487c54bfd5d775f747cae47290e..ea86fa318b45dd900dab06a12d23c93d1db05efa 100644 (file)
@@ -1049,7 +1049,7 @@ fn check_fn(cx: &mut MatchCheckCtxt,
 
     for input in &decl.inputs {
         is_refutable(cx, &*input.pat, |pat| {
-            span_err!(cx.tcx.sess, input.pat.span, E0006,
+            span_err!(cx.tcx.sess, input.pat.span, E0005,
                 "refutable pattern in function argument: `{}` not covered",
                 pat_to_string(pat)
             );