about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-06-10 22:30:14 +0000
committerbors <bors@rust-lang.org>2018-06-10 22:30:14 +0000
commitb202bebdeea73c32c69592fcb60ff2afaa93d354 (patch)
tree56ce0075d8ceefd0fb3c685eb9637b3e91a0de8c /src
parenta805a2a5ebba2802f432d79874e59c24e398f82a (diff)
parentf2349d5ec6d2f184d8b83cebe255834f927568c3 (diff)
downloadrust-b202bebdeea73c32c69592fcb60ff2afaa93d354.tar.gz
rust-b202bebdeea73c32c69592fcb60ff2afaa93d354.zip
Auto merge of #51475 - GuillaumeGomez:fix-error-codes, r=Manishearth
Fix error codes
Diffstat (limited to 'src')
-rw-r--r--src/librustc/diagnostics.rs15
-rw-r--r--src/librustc/hir/check_attr.rs4
-rw-r--r--src/librustc/hir/lowering.rs2
-rw-r--r--src/librustc/infer/anon_types/mod.rs2
-rw-r--r--src/librustc_typeck/check/generator_interior.rs2
-rw-r--r--src/librustc_typeck/check/method/probe.rs2
-rw-r--r--src/librustc_typeck/diagnostics.rs4
-rw-r--r--src/test/compile-fail/edition-raw-pointer-method-2018.rs2
-rw-r--r--src/test/compile-fail/rfc-2008-non-exhaustive/invalid-attribute.rs6
-rw-r--r--src/test/ui/impl-trait/region-escape-via-bound.rs2
-rw-r--r--src/test/ui/impl-trait/region-escape-via-bound.stderr6
11 files changed, 23 insertions, 24 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs
index 61f05ca3473..7415ddd455d 100644
--- a/src/librustc/diagnostics.rs
+++ b/src/librustc/diagnostics.rs
@@ -2011,13 +2011,13 @@ a (non-transparent) struct containing a single float, while `Grams` is a
 transparent wrapper around a float. This can make a difference for the ABI.
 "##,
 
-E0909: r##"
+E0700: r##"
 The `impl Trait` return type captures lifetime parameters that do not
 appear within the `impl Trait` itself.
 
 Erroneous code example:
 
-```compile-fail,E0909
+```compile-fail,E0700
 use std::cell::Cell;
 
 trait Trait<'a> { }
@@ -2058,13 +2058,13 @@ where 'x: 'y
 ```
 "##,
 
-E0910: r##"
+E0701: r##"
 This error indicates that a `#[non_exhaustive]` attribute was incorrectly placed
 on something other than a struct or enum.
 
 Examples of erroneous code:
 
-```compile_fail,E0910
+```compile_fail,E0701
 # #![feature(non_exhaustive)]
 
 #[non_exhaustive]
@@ -2072,13 +2072,13 @@ trait Foo { }
 ```
 "##,
 
-E0911: r##"
+E0702: r##"
 This error indicates that a `#[non_exhaustive]` attribute had a value. The
 `#[non_exhaustive]` should be empty.
 
 Examples of erroneous code:
 
-```compile_fail,E0911
+```compile_fail,E0702
 # #![feature(non_exhaustive)]
 
 #[non_exhaustive(anything)]
@@ -2139,6 +2139,5 @@ register_diagnostics! {
     E0657, // `impl Trait` can only capture lifetimes bound at the fn level
     E0687, // in-band lifetimes cannot be used in `fn`/`Fn` syntax
     E0688, // in-band lifetimes cannot be mixed with explicit lifetime binders
-
-    E0906, // closures cannot be static
+    E0697, // closures cannot be static
 }
diff --git a/src/librustc/hir/check_attr.rs b/src/librustc/hir/check_attr.rs
index 591cb9d5ad6..c71b47fa4e1 100644
--- a/src/librustc/hir/check_attr.rs
+++ b/src/librustc/hir/check_attr.rs
@@ -126,7 +126,7 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
             _ => {
                 struct_span_err!(self.tcx.sess,
                                  attr.span,
-                                 E0910,
+                                 E0701,
                                  "attribute can only be applied to a struct or enum")
                     .span_label(item.span, "not a struct or enum")
                     .emit();
@@ -137,7 +137,7 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
         if attr.meta_item_list().is_some() || attr.value_str().is_some() {
             struct_span_err!(self.tcx.sess,
                              attr.span,
-                             E0911,
+                             E0702,
                              "attribute should be empty")
                 .span_label(item.span, "not empty")
                 .emit();
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs
index 1e48a54e018..35d580d1c15 100644
--- a/src/librustc/hir/lowering.rs
+++ b/src/librustc/hir/lowering.rs
@@ -3093,7 +3093,7 @@ impl<'a> LoweringContext<'a> {
                             span_err!(
                                 this.sess,
                                 fn_decl_span,
-                                E0906,
+                                E0697,
                                 "closures cannot be static"
                             );
                         }
diff --git a/src/librustc/infer/anon_types/mod.rs b/src/librustc/infer/anon_types/mod.rs
index 4cc5e885b8a..a7879025eea 100644
--- a/src/librustc/infer/anon_types/mod.rs
+++ b/src/librustc/infer/anon_types/mod.rs
@@ -556,7 +556,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for ReverseMapper<'cx, 'gcx, 'tcx>
                         let mut err = struct_span_err!(
                             self.tcx.sess,
                             span,
-                            E0909,
+                            E0700,
                             "hidden type for `impl Trait` captures lifetime that \
                              does not appear in bounds",
                         );
diff --git a/src/librustc_typeck/check/generator_interior.rs b/src/librustc_typeck/check/generator_interior.rs
index e234e2f0192..e2090493079 100644
--- a/src/librustc_typeck/check/generator_interior.rs
+++ b/src/librustc_typeck/check/generator_interior.rs
@@ -65,7 +65,7 @@ impl<'a, 'gcx, 'tcx> InteriorVisitor<'a, 'gcx, 'tcx> {
                    expr, scope, ty, self.expr_count, yield_span);
 
             if self.fcx.any_unresolved_type_vars(&ty) {
-                let mut err = struct_span_err!(self.fcx.tcx.sess, source_span, E0907,
+                let mut err = struct_span_err!(self.fcx.tcx.sess, source_span, E0698,
                     "type inside generator must be known in this context");
                 err.span_note(yield_span,
                               "the type is part of the generator because of this `yield`");
diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs
index 7c51765f060..834c7d4e9e3 100644
--- a/src/librustc_typeck/check/method/probe.rs
+++ b/src/librustc_typeck/check/method/probe.rs
@@ -335,7 +335,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
                         // so we do a future-compat lint here for the 2015 edition
                         // (see https://github.com/rust-lang/rust/issues/46906)
                         if self.tcx.sess.rust_2018() {
-                          span_err!(self.tcx.sess, span, E0908,
+                          span_err!(self.tcx.sess, span, E0699,
                                     "the type of this value must be known \
                                      to call a method on a raw pointer on it");
                         } else {
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index e6a66cd613e..e4c73218de5 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -4668,7 +4668,7 @@ alignment.
 "##,
 
 
-E0908: r##"
+E0699: r##"
 A method was called on a raw pointer whose inner type wasn't completely known.
 
 For example, you may have done something like:
@@ -4797,5 +4797,5 @@ register_diagnostics! {
     E0640, // infer outlives requirements
     E0641, // cannot cast to/from a pointer with an unknown kind
     E0645, // trait aliases not finished
-    E0907, // type inside generator must be known in this context
+    E0698, // type inside generator must be known in this context
 }
diff --git a/src/test/compile-fail/edition-raw-pointer-method-2018.rs b/src/test/compile-fail/edition-raw-pointer-method-2018.rs
index d01cac019e3..d0cf81d59cf 100644
--- a/src/test/compile-fail/edition-raw-pointer-method-2018.rs
+++ b/src/test/compile-fail/edition-raw-pointer-method-2018.rs
@@ -18,5 +18,5 @@ fn main() {
     let x = 0;
     let y = &x as *const _;
     let _ = y.is_null();
-    //~^ error: the type of this value must be known to call a method on a raw pointer on it [E0908]
+    //~^ error: the type of this value must be known to call a method on a raw pointer on it [E0699]
 }
diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/invalid-attribute.rs b/src/test/compile-fail/rfc-2008-non-exhaustive/invalid-attribute.rs
index e48d989c01d..df4fe1e77e9 100644
--- a/src/test/compile-fail/rfc-2008-non-exhaustive/invalid-attribute.rs
+++ b/src/test/compile-fail/rfc-2008-non-exhaustive/invalid-attribute.rs
@@ -11,15 +11,15 @@
 #![feature(non_exhaustive)]
 
 #[non_exhaustive(anything)]
-//~^ ERROR attribute should be empty [E0911]
+//~^ ERROR attribute should be empty [E0702]
 struct Foo;
 
 #[non_exhaustive]
-//~^ ERROR attribute can only be applied to a struct or enum [E0910]
+//~^ ERROR attribute can only be applied to a struct or enum [E0701]
 trait Bar { }
 
 #[non_exhaustive]
-//~^ ERROR attribute can only be applied to a struct or enum [E0910]
+//~^ ERROR attribute can only be applied to a struct or enum [E0701]
 union Baz {
     f1: u16,
     f2: u16
diff --git a/src/test/ui/impl-trait/region-escape-via-bound.rs b/src/test/ui/impl-trait/region-escape-via-bound.rs
index e73f15606dc..c40c5f4cc31 100644
--- a/src/test/ui/impl-trait/region-escape-via-bound.rs
+++ b/src/test/ui/impl-trait/region-escape-via-bound.rs
@@ -24,7 +24,7 @@ trait Trait<'a> { }
 impl Trait<'b> for Cell<&'a u32> { }
 
 fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
-    //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0909]
+    //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0700]
 where 'x: 'y
 {
     x
diff --git a/src/test/ui/impl-trait/region-escape-via-bound.stderr b/src/test/ui/impl-trait/region-escape-via-bound.stderr
index 4281a4c10ad..b673111d219 100644
--- a/src/test/ui/impl-trait/region-escape-via-bound.stderr
+++ b/src/test/ui/impl-trait/region-escape-via-bound.stderr
@@ -1,4 +1,4 @@
-error[E0909]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
+error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
   --> $DIR/region-escape-via-bound.rs:26:29
    |
 LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
@@ -8,7 +8,7 @@ note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined
   --> $DIR/region-escape-via-bound.rs:26:1
    |
 LL | / fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
-LL | |     //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0909]
+LL | |     //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0700]
 LL | | where 'x: 'y
 LL | | {
 LL | |     x
@@ -17,4 +17,4 @@ LL | | }
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0909`.
+For more information about this error, try `rustc --explain E0700`.