From 701f6e51b2aab7a761e5c9c81cff476e81eef7e0 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Mon, 18 Nov 2019 10:06:21 -0800 Subject: Fix broken incremental test This test does not actually emit any warnings, since `#![allow(warnings)]` was specified. `compiletest` was erroneously ignoring `//~` tests and looking only for `//[X]~` ones. As a result of the changes in the previous commit, we now look for `//~` comments in incremental tests and expect them to appear in *all* revisions. --- src/test/incremental/warnings-reemitted.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/incremental/warnings-reemitted.rs b/src/test/incremental/warnings-reemitted.rs index a1d11f8aa5b..5fc89395827 100644 --- a/src/test/incremental/warnings-reemitted.rs +++ b/src/test/incremental/warnings-reemitted.rs @@ -2,9 +2,8 @@ // compile-flags: -Coverflow-checks=on // build-pass (FIXME(62277): could be check-pass?) -#![allow(warnings)] #![warn(const_err)] fn main() { - 255u8 + 1; //~ WARNING this expression will panic at run-time + let _ = 255u8 + 1; //~ WARNING attempt to add with overflow } -- cgit 1.4.1-3-g733a5 From ae2293837e4c66deaeeb6a895087cb5c76e935ea Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Mon, 18 Nov 2019 10:43:11 -0800 Subject: Change some tests to use the shorter comment style --- .../ui/associated-types/cache/project-fn-ret-contravariant.rs | 4 +--- src/test/ui/error-codes/E0161.rs | 10 ++-------- .../where-clause-inherent-impl-underscore.rs | 3 +-- .../ui/underscore-lifetime/where-clause-trait-impl-region.rs | 3 +-- .../underscore-lifetime/where-clause-trait-impl-underscore.rs | 3 +-- 5 files changed, 6 insertions(+), 17 deletions(-) (limited to 'src/test') diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs index ebf52918153..8c6073e2f7a 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs +++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs @@ -47,6 +47,4 @@ fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { } #[rustc_error] -fn main() { } -//[ok]~^ ERROR fatal error triggered by #[rustc_error] -//[oneuse]~^^ ERROR fatal error triggered by #[rustc_error] +fn main() { } //[ok,oneuse]~ ERROR fatal error triggered by #[rustc_error] diff --git a/src/test/ui/error-codes/E0161.rs b/src/test/ui/error-codes/E0161.rs index 2ca17050ae2..58217ff74b8 100644 --- a/src/test/ui/error-codes/E0161.rs +++ b/src/test/ui/error-codes/E0161.rs @@ -20,14 +20,8 @@ fn foo(x: Box<[i32]>) { box *x; - //[migrate]~^ ERROR E0161 - //[nll]~^^ ERROR E0161 - //[zflags]~^^^ ERROR E0161 - //[edition]~^^^^ ERROR E0161 - //[migrateul]~^^^^^ ERROR E0161 - //[nllul]~^^^^^^ ERROR E0161 - //[zflagsul]~^^^^^^^ ERROR E0161 - //[editionul]~^^^^^^^^ ERROR E0161 + //[migrate,nll,zflags,edition]~^ ERROR E0161 + //[migrateul,nllul,zflagsul,editionul]~^^ ERROR E0161 } fn main() {} diff --git a/src/test/ui/underscore-lifetime/where-clause-inherent-impl-underscore.rs b/src/test/ui/underscore-lifetime/where-clause-inherent-impl-underscore.rs index b50cce335bd..38189816da8 100644 --- a/src/test/ui/underscore-lifetime/where-clause-inherent-impl-underscore.rs +++ b/src/test/ui/underscore-lifetime/where-clause-inherent-impl-underscore.rs @@ -11,8 +11,7 @@ struct Foo { impl Foo where T: WithRegion<'_> -//[rust2015]~^ ERROR `'_` cannot be used here -//[rust2018]~^^ ERROR `'_` cannot be used here +//[rust2015,rust2018]~^ ERROR `'_` cannot be used here { } fn main() {} diff --git a/src/test/ui/underscore-lifetime/where-clause-trait-impl-region.rs b/src/test/ui/underscore-lifetime/where-clause-trait-impl-region.rs index f2d483e66e0..09e5bbd846d 100644 --- a/src/test/ui/underscore-lifetime/where-clause-trait-impl-region.rs +++ b/src/test/ui/underscore-lifetime/where-clause-trait-impl-region.rs @@ -9,8 +9,7 @@ trait Foo { } impl Foo for Vec where T: WithType<&u32> -//[rust2015]~^ ERROR `&` without an explicit lifetime name cannot be used here -//[rust2018]~^^ ERROR `&` without an explicit lifetime name cannot be used here +//[rust2015,rust2018]~^ ERROR `&` without an explicit lifetime name cannot be used here { } fn main() {} diff --git a/src/test/ui/underscore-lifetime/where-clause-trait-impl-underscore.rs b/src/test/ui/underscore-lifetime/where-clause-trait-impl-underscore.rs index 94e4426e822..371d2e4ba43 100644 --- a/src/test/ui/underscore-lifetime/where-clause-trait-impl-underscore.rs +++ b/src/test/ui/underscore-lifetime/where-clause-trait-impl-underscore.rs @@ -9,8 +9,7 @@ trait Foo { } impl Foo for Vec where T: WithRegion<'_> -//[rust2015]~^ ERROR `'_` cannot be used here -//[rust2018]~^^ ERROR `'_` cannot be used here +//[rust2015,rust2018]~^ ERROR `'_` cannot be used here { } fn main() {} -- cgit 1.4.1-3-g733a5