diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index ce120a32d90..2d088c4f6d1 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -163,7 +163,7 @@ declare_lint! { declare_lint! { pub PATTERNS_IN_FNS_WITHOUT_BODY, - Deny, + Warn, "patterns in functions without body were erroneously allowed" } 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 ca5ba4c063c..967c292fa68 100644 --- a/src/test/compile-fail/no-patterns-in-args-2.rs +++ b/src/test/compile-fail/no-patterns-in-args-2.rs @@ -8,6 +8,8 @@ // 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 diff --git a/src/test/run-pass/linkage1.rs b/src/test/run-pass/linkage1.rs index 17abf9cb1f2..591610e88b1 100644 --- a/src/test/run-pass/linkage1.rs +++ b/src/test/run-pass/linkage1.rs @@ -32,7 +32,9 @@ fn main() { // discarded. By adding and calling `other::bar`, we get around this problem. other::bar(); - assert!(!foo.is_null()); - assert_eq!(unsafe { *foo }, 3); - assert!(something_that_should_never_exist.is_null()); + unsafe { + assert!(!foo.is_null()); + assert_eq!(*foo, 3); + assert!(something_that_should_never_exist.is_null()); + } } diff --git a/src/test/run-pass/thread-local-extern-static.rs b/src/test/run-pass/thread-local-extern-static.rs index 92a95cad0d3..87188db9dc0 100644 --- a/src/test/run-pass/thread-local-extern-static.rs +++ b/src/test/run-pass/thread-local-extern-static.rs @@ -22,5 +22,7 @@ extern { } fn main() { - assert_eq!(FOO, 3); + unsafe { + assert_eq!(FOO, 3); + } }