mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Make patterns_in_fns_without_body
warn-by-default again
Fix some tests on Linux
This commit is contained in:
parent
bdffb9722d
commit
9196f874e4
@ -163,7 +163,7 @@ declare_lint! {
|
||||
|
||||
declare_lint! {
|
||||
pub PATTERNS_IN_FNS_WITHOUT_BODY,
|
||||
Deny,
|
||||
Warn,
|
||||
"patterns in functions without body were erroneously allowed"
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -22,5 +22,7 @@ extern {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
assert_eq!(FOO, 3);
|
||||
unsafe {
|
||||
assert_eq!(FOO, 3);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user