]> git.lizzy.rs Git - rust.git/commitdiff
add the lint back to the list, and fix tests
authorRalf Jung <post@ralfj.de>
Wed, 19 Sep 2018 15:22:03 +0000 (17:22 +0200)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Thu, 25 Oct 2018 14:48:15 +0000 (16:48 +0200)
24 files changed:
src/librustc_lint/builtin.rs
src/librustc_lint/lib.rs
src/test/ui/array_const_index-0.rs
src/test/ui/array_const_index-0.stderr
src/test/ui/array_const_index-1.rs
src/test/ui/array_const_index-1.stderr
src/test/ui/consts/const-err-early.rs
src/test/ui/consts/const-err-early.stderr
src/test/ui/consts/const-err-multi.rs
src/test/ui/consts/const-err-multi.stderr
src/test/ui/consts/const-eval/const-eval-overflow2.rs
src/test/ui/consts/const-eval/const-eval-overflow2.stderr
src/test/ui/consts/const-eval/const-eval-overflow2b.rs
src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
src/test/ui/consts/const-eval/const-eval-overflow2c.rs
src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
src/test/ui/consts/const-eval/pub_const_err.rs
src/test/ui/consts/const-eval/pub_const_err_bin.rs
src/test/ui/consts/const-eval/union-const-eval-field.rs
src/test/ui/consts/const-eval/union-const-eval-field.stderr
src/test/ui/consts/const-eval/unused-broken-const.rs [new file with mode: 0644]
src/test/ui/consts/const-eval/unused-broken-const.stderr [new file with mode: 0644]
src/test/ui/consts/const-slice-oob.rs
src/test/ui/consts/const-slice-oob.stderr

index 597b6ae236676263a352f5e2858c90e788f65b61..c50f57e6c903dc58aad380c79b8e0611c5d608a7 100644 (file)
@@ -1607,17 +1607,6 @@ fn check_const(cx: &LateContext, body_id: hir::BodyId) {
     let _ = cx.tcx.const_eval(param_env.and(cid));
 }
 
-struct UnusedBrokenConstVisitor<'a, 'tcx: 'a>(&'a LateContext<'a, 'tcx>);
-
-impl<'a, 'tcx, 'v> hir::intravisit::Visitor<'v> for UnusedBrokenConstVisitor<'a, 'tcx> {
-    fn visit_nested_body(&mut self, id: hir::BodyId) {
-        check_const(self.0, id);
-    }
-    fn nested_visit_map<'this>(&'this mut self) -> hir::intravisit::NestedVisitorMap<'this, 'v> {
-        hir::intravisit::NestedVisitorMap::None
-    }
-}
-
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedBrokenConst {
     fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         match it.node {
@@ -1627,10 +1616,6 @@ fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
             hir::ItemKind::Static(_, _, body_id) => {
                 check_const(cx, body_id);
             },
-            hir::ItemKind::Ty(ref ty, _) => hir::intravisit::walk_ty(
-                &mut UnusedBrokenConstVisitor(cx),
-                ty
-            ),
             _ => {},
         }
     }
index 211b8471115cc458ac976bc78a3da4cf805a66ce..5bf2b76e66849b6a5346a8d1a089b0cfd98a7199 100644 (file)
@@ -152,6 +152,7 @@ macro_rules! add_lint_group {
         UnreachablePub: UnreachablePub,
         UnnameableTestItems: UnnameableTestItems::new(),
         TypeAliasBounds: TypeAliasBounds,
+        UnusedBrokenConst: UnusedBrokenConst,
         TrivialConstraints: TrivialConstraints,
         TypeLimits: TypeLimits::new(),
         MissingDoc: MissingDoc::new(),
index 0ad297eeb5cdb9f8f6058e322295f0ad3b83a4e7..e82458b10d97e4ce9e60d50fabc673fbfbd3a788 100644 (file)
@@ -14,5 +14,5 @@
 //~| ERROR any use of this value will cause an error
 
 fn main() {
-    let _ = B; //~ ERROR erroneous constant used
+    let _ = B;
 }
index 38163b1f4b1998b2ebfc88c67e07d15fc0261c40..49c316eee12b2948d41ba40359fef868ee2d6685 100644 (file)
@@ -8,12 +8,5 @@ LL | const B: i32 = (&A)[1];
    |
    = note: #[deny(const_err)] on by default
 
-error[E0080]: erroneous constant used
-  --> $DIR/array_const_index-0.rs:17:13
-   |
-LL |     let _ = B; //~ ERROR erroneous constant used
-   |             ^ referenced constant has errors
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0080`.
index 4c7dcfbb347d86825b0719e5f302e22ff34a5985..21028a447f4e071a371d7bb397cb2380b157470d 100644 (file)
@@ -14,5 +14,5 @@
 //~| ERROR any use of this value will cause an error
 
 fn main() {
-    let _ = B; //~ ERROR erroneous constant used
+    let _ = B;
 }
index b122e590c8854edd4e4e11ef0a4e2ae644a986c2..fa0e6e6afc6b0a0232208fc2c1f173f7aed9c9a6 100644 (file)
@@ -8,12 +8,5 @@ LL | const B: i32 = A[1];
    |
    = note: #[deny(const_err)] on by default
 
-error[E0080]: erroneous constant used
-  --> $DIR/array_const_index-1.rs:17:13
-   |
-LL |     let _ = B; //~ ERROR erroneous constant used
-   |             ^ referenced constant has errors
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0080`.
index 1cbfb918427750973d276b16e389106c45f7be6f..39b1b342eac3149752718d55ad5d48e24e3669c9 100644 (file)
 pub const E: u8 = [5u8][1]; //~ ERROR const_err
 
 fn main() {
-    let _a = A; //~ ERROR erroneous constant used
-    let _b = B; //~ ERROR erroneous constant used
-    let _c = C; //~ ERROR erroneous constant used
-    let _d = D; //~ ERROR erroneous constant used
-    let _e = E; //~ ERROR erroneous constant used
-    let _e = [6u8][1]; //~ ERROR index out of bounds
+    let _a = A;
+    let _b = B;
+    let _c = C;
+    let _d = D;
+    let _e = E;
+    let _e = [6u8][1];
 }
index 8cc112191b512e15c9be5e07a0c231def4253476..1dd6c096e3739b6c13cf4268d2826a8210813f2f 100644 (file)
@@ -44,42 +44,5 @@ LL | pub const E: u8 = [5u8][1]; //~ ERROR const_err
    |                   |
    |                   index out of bounds: the len is 1 but the index is 1
 
-error[E0080]: erroneous constant used
-  --> $DIR/const-err-early.rs:20:14
-   |
-LL |     let _a = A; //~ ERROR erroneous constant used
-   |              ^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-err-early.rs:21:14
-   |
-LL |     let _b = B; //~ ERROR erroneous constant used
-   |              ^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-err-early.rs:22:14
-   |
-LL |     let _c = C; //~ ERROR erroneous constant used
-   |              ^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-err-early.rs:23:14
-   |
-LL |     let _d = D; //~ ERROR erroneous constant used
-   |              ^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-err-early.rs:24:14
-   |
-LL |     let _e = E; //~ ERROR erroneous constant used
-   |              ^ referenced constant has errors
-
-error: index out of bounds: the len is 1 but the index is 1
-  --> $DIR/const-err-early.rs:25:14
-   |
-LL |     let _e = [6u8][1]; //~ ERROR index out of bounds
-   |              ^^^^^^^^
-
-error: aborting due to 11 previous errors
+error: aborting due to 5 previous errors
 
-For more information about this error, try `rustc --explain E0080`.
index 20eaebfbe56560904abee64fb17ba8176da8bc24..5cf3114c64a6b7daea0c229e741d656c59b72bd8 100644 (file)
@@ -21,5 +21,4 @@
 
 fn main() {
     let _ = (A, B, C, D);
-    //~^ ERROR erroneous constant used
 }
index da6f31a38868c5868958f6ba0b95957f4ea6eed9..e77a31a9f5fa0eaf35563322783b4bcd667e7ad0 100644 (file)
@@ -36,12 +36,5 @@ LL | pub const D: i8 = 50 - A;
    |                   |
    |                   referenced constant has errors
 
-error[E0080]: erroneous constant used
-  --> $DIR/const-err-multi.rs:23:13
-   |
-LL |     let _ = (A, B, C, D);
-   |             ^^^^^^^^^^^^ referenced constant has errors
-
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0080`.
index c61a1b3edb726c3a5ddb8b55e9b4b4e8e4c01130..8e094a7f7dcc77d1c21722d9585374f6c4652f6b 100644 (file)
      );
 
 fn main() {
-    foo(VALS_I8); //~ ERROR erroneous constant used
-    foo(VALS_I16); //~ ERROR erroneous constant used
-    foo(VALS_I32); //~ ERROR erroneous constant used
-    foo(VALS_I64); //~ ERROR erroneous constant used
+    foo(VALS_I8);
+    foo(VALS_I16);
+    foo(VALS_I32);
+    foo(VALS_I64);
 
-    foo(VALS_U8); //~ ERROR erroneous constant used
-    foo(VALS_U16); //~ ERROR erroneous constant used
-    foo(VALS_U32); //~ ERROR erroneous constant used
-    foo(VALS_U64); //~ ERROR erroneous constant used
+    foo(VALS_U8);
+    foo(VALS_U16);
+    foo(VALS_U32);
+    foo(VALS_U64);
 }
 
 fn foo<T>(_: T) {
index 0484335fd0c239930187a7ab299d6a343dbcc6fd..596ba6bb223f0c9c82e30319b075e24e8685b01d 100644 (file)
@@ -82,54 +82,5 @@ LL | |      u64::MIN - 1,
 LL | |      );
    | |_______^
 
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2.rs:63:5
-   |
-LL |     foo(VALS_I8); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2.rs:64:5
-   |
-LL |     foo(VALS_I16); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2.rs:65:5
-   |
-LL |     foo(VALS_I32); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2.rs:66:5
-   |
-LL |     foo(VALS_I64); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2.rs:68:5
-   |
-LL |     foo(VALS_U8); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2.rs:69:5
-   |
-LL |     foo(VALS_U16); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2.rs:70:5
-   |
-LL |     foo(VALS_U32); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2.rs:71:5
-   |
-LL |     foo(VALS_U64); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error: aborting due to 16 previous errors
+error: aborting due to 8 previous errors
 
-For more information about this error, try `rustc --explain E0080`.
index 47b0977ec1d55275e9ab2d9bc7d1310e2b9e72f1..c69d03071e756969702093b9de64abc7ad065dd0 100644 (file)
      );
 
 fn main() {
-    foo(VALS_I8); //~ ERROR erroneous constant used
-    foo(VALS_I16); //~ ERROR erroneous constant used
-    foo(VALS_I32); //~ ERROR erroneous constant used
-    foo(VALS_I64); //~ ERROR erroneous constant used
+    foo(VALS_I8);
+    foo(VALS_I16);
+    foo(VALS_I32);
+    foo(VALS_I64);
 
-    foo(VALS_U8); //~ ERROR erroneous constant used
-    foo(VALS_U16); //~ ERROR erroneous constant used
-    foo(VALS_U32); //~ ERROR erroneous constant used
-    foo(VALS_U64); //~ ERROR erroneous constant used
+    foo(VALS_U8);
+    foo(VALS_U16);
+    foo(VALS_U32);
+    foo(VALS_U64);
 }
 
 fn foo<T>(_: T) {
index 8922b35a0b22f0cdae483f55a126e1e59f2b8a9c..82f245eaee86654f068082e9a6ed86695b4e32c6 100644 (file)
@@ -82,54 +82,5 @@ LL | |      u64::MAX + 1,
 LL | |      );
    | |_______^
 
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2b.rs:63:5
-   |
-LL |     foo(VALS_I8); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2b.rs:64:5
-   |
-LL |     foo(VALS_I16); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2b.rs:65:5
-   |
-LL |     foo(VALS_I32); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2b.rs:66:5
-   |
-LL |     foo(VALS_I64); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2b.rs:68:5
-   |
-LL |     foo(VALS_U8); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2b.rs:69:5
-   |
-LL |     foo(VALS_U16); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2b.rs:70:5
-   |
-LL |     foo(VALS_U32); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2b.rs:71:5
-   |
-LL |     foo(VALS_U64); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error: aborting due to 16 previous errors
+error: aborting due to 8 previous errors
 
-For more information about this error, try `rustc --explain E0080`.
index b4e1a0bc099af6e53ae3c89056674224fb5994ac..f442661ec630b78dc02694b48c070f34623eecc5 100644 (file)
      );
 
 fn main() {
-    foo(VALS_I8); //~ ERROR erroneous constant used
-    foo(VALS_I16); //~ ERROR erroneous constant used
-    foo(VALS_I32); //~ ERROR erroneous constant used
-    foo(VALS_I64); //~ ERROR erroneous constant used
+    foo(VALS_I8);
+    foo(VALS_I16);
+    foo(VALS_I32);
+    foo(VALS_I64);
 
-    foo(VALS_U8); //~ ERROR erroneous constant used
-    foo(VALS_U16); //~ ERROR erroneous constant used
-    foo(VALS_U32); //~ ERROR erroneous constant used
-    foo(VALS_U64); //~ ERROR erroneous constant used
+    foo(VALS_U8);
+    foo(VALS_U16);
+    foo(VALS_U32);
+    foo(VALS_U64);
 }
 
 fn foo<T>(_: T) {
index 023156a40dd6d01bffd9bf1e60ac73fff9e612f0..91064eb867d868523e4c3c5dd9c721cefec77e34 100644 (file)
@@ -82,54 +82,5 @@ LL | |      u64::MAX * 2,
 LL | |      );
    | |_______^
 
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2c.rs:63:5
-   |
-LL |     foo(VALS_I8); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2c.rs:64:5
-   |
-LL |     foo(VALS_I16); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2c.rs:65:5
-   |
-LL |     foo(VALS_I32); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2c.rs:66:5
-   |
-LL |     foo(VALS_I64); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2c.rs:68:5
-   |
-LL |     foo(VALS_U8); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2c.rs:69:5
-   |
-LL |     foo(VALS_U16); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2c.rs:70:5
-   |
-LL |     foo(VALS_U32); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
-  --> $DIR/const-eval-overflow2c.rs:71:5
-   |
-LL |     foo(VALS_U64); //~ ERROR erroneous constant used
-   |     ^^^^^^^^^^^^^ referenced constant has errors
-
-error: aborting due to 16 previous errors
+error: aborting due to 8 previous errors
 
-For more information about this error, try `rustc --explain E0080`.
index 48c172b5e31646ebc00fcc371714b3b3abc0acda..41cf844a8e299234842e27d85902a267d383699a 100644 (file)
@@ -17,5 +17,3 @@
 //~^ WARN any use of this value will cause an error
 
 pub type Foo = [i32; 0 - 1];
-//~^ WARN attempt to subtract with overflow
-//~| WARN this array length cannot be used
index 849d40cf107b7a4a100a86f72527fab8e8e291b7..0ee7d603e31ad1a10d2850b8f38141ae9d831370 100644 (file)
@@ -15,7 +15,5 @@
 //~^ WARN any use of this value will cause an error
 
 pub type Foo = [i32; 0 - 1];
-//~^ WARN attempt to subtract with overflow
-//~| WARN this array length cannot be used
 
 fn main() {}
index 759dab6c2566151bfb0259e302435b1bd1b61d73..c0bfbc17629fc3cfcb0f6a665e0c7078446b26a2 100644 (file)
@@ -36,12 +36,10 @@ const fn read_field2() -> Field2 {
 const fn read_field3() -> Field3 {
     const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR any use of this value
     FIELD3
-    //~^ erroneous constant used
 }
 
 fn main() {
     assert_eq!(read_field1(), FLOAT1_AS_I32);
     assert_eq!(read_field2(), 1.0);
     assert_eq!(read_field3(), unsafe { UNION.field3 });
-    //~^ ERROR evaluation of constant expression failed
 }
index 6a64f0c36716fb9061fe38b380658cd3a048379e..565cd916ffcb110244724ffd24d96b31e5dbd1e0 100644 (file)
@@ -6,25 +6,5 @@ LL |     const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR any use of th
    |
    = note: #[deny(const_err)] on by default
 
-error[E0080]: erroneous constant used
-  --> $DIR/union-const-eval-field.rs:38:5
-   |
-LL |     FIELD3
-   |     ^^^^^^ referenced constant has errors
-
-error[E0080]: evaluation of constant expression failed
-  --> $DIR/union-const-eval-field.rs:45:5
-   |
-LL |     FIELD3
-   |     ------ referenced constant has errors
-...
-LL |     assert_eq!(read_field3(), unsafe { UNION.field3 });
-   |     ^^^^^^^^^^^-------------^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                inside call to `read_field3`
-   |
-   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
-
-error: aborting due to 3 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/unused-broken-const.rs b/src/test/ui/consts/const-eval/unused-broken-const.rs
new file mode 100644 (file)
index 0000000..53ce82f
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// make sure that an *unused* broken const triggers an error even in a check build
+
+// compile-flags: --emit=dep-info,metadata
+
+const FOO: i32 = [][0];
+//~^ ERROR any use of this value will cause an error
+
+fn main() {}
diff --git a/src/test/ui/consts/const-eval/unused-broken-const.stderr b/src/test/ui/consts/const-eval/unused-broken-const.stderr
new file mode 100644 (file)
index 0000000..5fb2a37
--- /dev/null
@@ -0,0 +1,14 @@
+warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type
+
+error: any use of this value will cause an error
+  --> $DIR/unused-broken-const.rs:15:1
+   |
+LL | const FOO: i32 = [][0];
+   | ^^^^^^^^^^^^^^^^^-----^
+   |                  |
+   |                  index out of bounds: the len is 0 but the index is 0
+   |
+   = note: #[deny(const_err)] on by default
+
+error: aborting due to previous error
+
index cc7f86f97a1fd869353d978345b5e858b1a3820b..04d9b01633b15f15fe3130e219177cb75fbcab96 100644 (file)
@@ -17,5 +17,4 @@
 
 fn main() {
     let _ = BAR;
-    //~^ ERROR erroneous constant used
 }
index 763afae62eaacfa8804992f60f2768903354cac4..4a8ad5ed6ca77083d64a5b1aefdf11df4a195bcf 100644 (file)
@@ -8,12 +8,5 @@ LL | const BAR: u32 = FOO[5];
    |
    = note: #[deny(const_err)] on by default
 
-error[E0080]: erroneous constant used
-  --> $DIR/const-slice-oob.rs:19:13
-   |
-LL |     let _ = BAR;
-   |             ^^^ referenced constant has errors
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0080`.