Make patterns_in_fns_without_body warn-by-default again

Fix some tests on Linux
This commit is contained in:
Vadim Petrochenkov 2017-07-08 03:01:11 +03:00
parent bdffb9722d
commit 9196f874e4
4 changed files with 11 additions and 5 deletions

View File

@ -163,7 +163,7 @@ declare_lint! {
declare_lint! {
pub PATTERNS_IN_FNS_WITHOUT_BODY,
Deny,
Warn,
"patterns in functions without body were erroneously allowed"
}

View File

@ -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

View File

@ -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());
}
}

View File

@ -22,5 +22,7 @@ extern {
}
fn main() {
assert_eq!(FOO, 3);
unsafe {
assert_eq!(FOO, 3);
}
}