diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-06-25 05:30:20 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-07-08 01:56:27 +0300 |
| commit | 96bcdac9e483e0e7d8a02f82c0ab961a536cafc4 (patch) | |
| tree | 008bb8627d6179ea901734ded8806ff6bfdac268 /src/test | |
| parent | affb8ee8316c7720a1f752d70d3fa2542100f425 (diff) | |
| download | rust-96bcdac9e483e0e7d8a02f82c0ab961a536cafc4.tar.gz rust-96bcdac9e483e0e7d8a02f82c0ab961a536cafc4.zip | |
Make sufficiently old or low-impact compatibility lints deny-by-default
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/defaulted-unit-warning.rs | 5 | ||||
| -rw-r--r-- | src/test/compile-fail/directory_ownership/backcompat-warnings.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/imports/rfc-1560-warning-cycle.rs | 8 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-32995-2.rs | 9 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-32995.rs | 17 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-38293.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-39404.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/no-patterns-in-args-2.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/safe-extern-statics-mut.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/safe-extern-statics.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/type-parameter-invalid-lint.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/compare-method/proj-outlives-region.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/compare-method/proj-outlives-region.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/compare-method/region-extra.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/compare-method/region-extra.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/compare-method/region-unrelated.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/compare-method/region-unrelated.stderr | 6 |
17 files changed, 17 insertions, 66 deletions
diff --git a/src/test/compile-fail/defaulted-unit-warning.rs b/src/test/compile-fail/defaulted-unit-warning.rs index ed6263d0fdb..3f4e1cce548 100644 --- a/src/test/compile-fail/defaulted-unit-warning.rs +++ b/src/test/compile-fail/defaulted-unit-warning.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![allow(dead_code)] -#![allow(unreachable_code)] -#![deny(resolve_trait_on_defaulted_unit)] +#![allow(unused)] trait Deserialize: Sized { fn deserialize() -> Result<Self, String>; @@ -38,4 +36,3 @@ fn smeg() { fn main() { smeg(); } - diff --git a/src/test/compile-fail/directory_ownership/backcompat-warnings.rs b/src/test/compile-fail/directory_ownership/backcompat-warnings.rs index 75e3426a399..519792dfa3a 100644 --- a/src/test/compile-fail/directory_ownership/backcompat-warnings.rs +++ b/src/test/compile-fail/directory_ownership/backcompat-warnings.rs @@ -10,12 +10,8 @@ // error-pattern: cannot declare a new module at this location // error-pattern: will become a hard error -// error-pattern: compilation successful - -#![feature(rustc_attrs)] #[path="mod_file_not_owning_aux3.rs"] mod foo; -#[rustc_error] fn main() {} diff --git a/src/test/compile-fail/imports/rfc-1560-warning-cycle.rs b/src/test/compile-fail/imports/rfc-1560-warning-cycle.rs index 1d67bf3a1cd..95bdf5e9b15 100644 --- a/src/test/compile-fail/imports/rfc-1560-warning-cycle.rs +++ b/src/test/compile-fail/imports/rfc-1560-warning-cycle.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(rustc_attrs)] #![allow(unused)] pub struct Foo; @@ -20,12 +19,11 @@ mod bar { use *; //~ NOTE `Foo` could refer to the name imported here use bar::*; //~ NOTE `Foo` could also refer to the name imported here fn f(_: Foo) {} - //~^ WARN `Foo` is ambiguous + //~^ ERROR `Foo` is ambiguous //~| WARN hard error in a future release //~| NOTE see issue #38260 - //~| NOTE #[warn(legacy_imports)] on by default + //~| NOTE #[deny(legacy_imports)] on by default } } -#[rustc_error] -fn main() {} //~ ERROR compilation successful +fn main() {} diff --git a/src/test/compile-fail/issue-32995-2.rs b/src/test/compile-fail/issue-32995-2.rs index cb68d52ef96..0e917ad95d9 100644 --- a/src/test/compile-fail/issue-32995-2.rs +++ b/src/test/compile-fail/issue-32995-2.rs @@ -8,23 +8,17 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(parenthesized_params_in_types_and_modules)] -//~^ NOTE lint level defined here -//~| NOTE lint level defined here -//~| NOTE lint level defined here -#![allow(dead_code, unused_variables)] #![feature(conservative_impl_trait)] +#![allow(unused)] fn main() { { fn f<X: ::std::marker()::Send>() {} } //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted - //~| NOTE issue #42238 { fn f() -> impl ::std::marker()::Send { } } //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted - //~| NOTE issue #42238 } #[derive(Clone)] @@ -33,4 +27,3 @@ struct X; impl ::std::marker()::Copy for X {} //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted -//~| NOTE issue #42238 diff --git a/src/test/compile-fail/issue-32995.rs b/src/test/compile-fail/issue-32995.rs index f2ed8bf53ea..4b7f82943ba 100644 --- a/src/test/compile-fail/issue-32995.rs +++ b/src/test/compile-fail/issue-32995.rs @@ -8,26 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(parenthesized_params_in_types_and_modules)] -//~^ NOTE lint level defined here -//~| NOTE lint level defined here -//~| NOTE lint level defined here -//~| NOTE lint level defined here -//~| NOTE lint level defined here -//~| NOTE lint level defined here -//~| NOTE lint level defined here -#![allow(dead_code, unused_variables)] +#![allow(unused)] fn main() { let x: usize() = 1; //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted - //~| NOTE issue #42238 let b: ::std::boxed()::Box<_> = Box::new(1); //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted - //~| NOTE issue #42238 macro_rules! pathexpr { ($p:path) => { $p } @@ -36,27 +26,22 @@ fn main() { let p = pathexpr!(::std::str()::from_utf8)(b"foo").unwrap(); //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted - //~| NOTE issue #42238 let p = pathexpr!(::std::str::from_utf8())(b"foo").unwrap(); //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted - //~| NOTE issue #42238 let o : Box<::std::marker()::Send> = Box::new(1); //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted - //~| NOTE issue #42238 let o : Box<Send + ::std::marker()::Sync> = Box::new(1); //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted - //~| NOTE issue #42238 } fn foo<X:Default>() { let d : X() = Default::default(); //~^ ERROR parenthesized parameters may only be used with a trait //~| WARN previously accepted - //~| NOTE issue #42238 } diff --git a/src/test/compile-fail/issue-38293.rs b/src/test/compile-fail/issue-38293.rs index bf24621a869..bd352b204bd 100644 --- a/src/test/compile-fail/issue-38293.rs +++ b/src/test/compile-fail/issue-38293.rs @@ -11,7 +11,6 @@ // Test that `fn foo::bar::{self}` only imports `bar` in the type namespace. #![allow(unused)] -#![deny(legacy_imports)] mod foo { pub fn f() { } diff --git a/src/test/compile-fail/issue-39404.rs b/src/test/compile-fail/issue-39404.rs index 8b49772494a..56bfe27a4ff 100644 --- a/src/test/compile-fail/issue-39404.rs +++ b/src/test/compile-fail/issue-39404.rs @@ -8,12 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(missing_fragment_specifier)] //~ NOTE lint level defined here -#![allow(unused_macros)] +#![allow(unused)] macro_rules! m { ($i) => {} } //~^ ERROR missing fragment specifier //~| WARN previously accepted -//~| NOTE issue #40107 fn main() {} diff --git a/src/test/compile-fail/no-patterns-in-args-2.rs b/src/test/compile-fail/no-patterns-in-args-2.rs index 385d012cade..ca5ba4c063c 100644 --- a/src/test/compile-fail/no-patterns-in-args-2.rs +++ b/src/test/compile-fail/no-patterns-in-args-2.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(patterns_in_fns_without_body)] - trait Tr { fn f1(mut arg: u8); //~ ERROR patterns aren't allowed in methods without bodies //~^ WARN was previously accepted @@ -17,6 +15,7 @@ trait Tr { //~^ WARN was previously accepted fn g1(arg: u8); // OK fn g2(_: u8); // OK + #[allow(anonymous_parameters)] fn g3(u8); // OK } diff --git a/src/test/compile-fail/safe-extern-statics-mut.rs b/src/test/compile-fail/safe-extern-statics-mut.rs index b5f3b4535df..ed8d5900776 100644 --- a/src/test/compile-fail/safe-extern-statics-mut.rs +++ b/src/test/compile-fail/safe-extern-statics-mut.rs @@ -10,9 +10,6 @@ // aux-build:extern-statics.rs -#![allow(unused)] -#![deny(safe_extern_statics)] - extern crate extern_statics; use extern_statics::*; diff --git a/src/test/compile-fail/safe-extern-statics.rs b/src/test/compile-fail/safe-extern-statics.rs index 7e96897ee88..4d939f33c46 100644 --- a/src/test/compile-fail/safe-extern-statics.rs +++ b/src/test/compile-fail/safe-extern-statics.rs @@ -11,7 +11,6 @@ // aux-build:extern-statics.rs #![allow(unused)] -#![deny(safe_extern_statics)] extern crate extern_statics; use extern_statics::*; diff --git a/src/test/compile-fail/type-parameter-invalid-lint.rs b/src/test/compile-fail/type-parameter-invalid-lint.rs index c7a1197372d..f424cbf0c32 100644 --- a/src/test/compile-fail/type-parameter-invalid-lint.rs +++ b/src/test/compile-fail/type-parameter-invalid-lint.rs @@ -10,7 +10,6 @@ // gate-test-default_type_parameter_fallback -#![deny(invalid_type_param_default)] #![allow(unused)] fn avg<T=i32>(_: T) {} diff --git a/src/test/ui/compare-method/proj-outlives-region.rs b/src/test/ui/compare-method/proj-outlives-region.rs index 54cfe4be9c1..eab01e9e982 100644 --- a/src/test/ui/compare-method/proj-outlives-region.rs +++ b/src/test/ui/compare-method/proj-outlives-region.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![allow(dead_code)] -#![deny(extra_requirement_in_impl)] - // Test that we elaborate `Type: 'region` constraints and infer various important things. trait Master<'a, T: ?Sized, U> { diff --git a/src/test/ui/compare-method/proj-outlives-region.stderr b/src/test/ui/compare-method/proj-outlives-region.stderr index 2a707c6eb8b..b1b5aedea70 100644 --- a/src/test/ui/compare-method/proj-outlives-region.stderr +++ b/src/test/ui/compare-method/proj-outlives-region.stderr @@ -1,10 +1,10 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/proj-outlives-region.rs:22:5 + --> $DIR/proj-outlives-region.rs:19:5 | -17 | fn foo() where T: 'a; +14 | fn foo() where T: 'a; | --------------------- definition of `foo` from trait ... -22 | fn foo() where U: 'a { } //~ ERROR E0276 +19 | fn foo() where U: 'a { } //~ ERROR E0276 | ^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `U: 'a` | = note: #[deny(extra_requirement_in_impl)] on by default diff --git a/src/test/ui/compare-method/region-extra.rs b/src/test/ui/compare-method/region-extra.rs index d61d0250211..e359f080968 100644 --- a/src/test/ui/compare-method/region-extra.rs +++ b/src/test/ui/compare-method/region-extra.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![allow(dead_code)] -#![deny(extra_requirement_in_impl)] - // Test that you cannot add an extra where clause in the impl relating // two regions. diff --git a/src/test/ui/compare-method/region-extra.stderr b/src/test/ui/compare-method/region-extra.stderr index e657813221a..bc42b505818 100644 --- a/src/test/ui/compare-method/region-extra.stderr +++ b/src/test/ui/compare-method/region-extra.stderr @@ -1,10 +1,10 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/region-extra.rs:22:5 + --> $DIR/region-extra.rs:19:5 | -18 | fn foo(); +15 | fn foo(); | --------- definition of `foo` from trait ... -22 | fn foo() where 'a: 'b { } +19 | fn foo() where 'a: 'b { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b` error: aborting due to previous error diff --git a/src/test/ui/compare-method/region-unrelated.rs b/src/test/ui/compare-method/region-unrelated.rs index 8f79b30bd5f..719e15fdb61 100644 --- a/src/test/ui/compare-method/region-unrelated.rs +++ b/src/test/ui/compare-method/region-unrelated.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![allow(dead_code)] -#![deny(extra_requirement_in_impl)] - // Test that we elaborate `Type: 'region` constraints and infer various important things. trait Master<'a, T: ?Sized, U> { diff --git a/src/test/ui/compare-method/region-unrelated.stderr b/src/test/ui/compare-method/region-unrelated.stderr index 9e822bd8b07..b02aa5eeb2f 100644 --- a/src/test/ui/compare-method/region-unrelated.stderr +++ b/src/test/ui/compare-method/region-unrelated.stderr @@ -1,10 +1,10 @@ error[E0276]: impl has stricter requirements than trait - --> $DIR/region-unrelated.rs:22:5 + --> $DIR/region-unrelated.rs:19:5 | -17 | fn foo() where T: 'a; +14 | fn foo() where T: 'a; | --------------------- definition of `foo` from trait ... -22 | fn foo() where V: 'a { } +19 | fn foo() where V: 'a { } | ^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `V: 'a` | = note: #[deny(extra_requirement_in_impl)] on by default |
