Skip to content

Commit

Permalink
Make patterns_in_fns_without_body warn-by-default again
Browse files Browse the repository at this point in the history
Fix some tests on Linux
  • Loading branch information
petrochenkov committed Jul 8, 2017
1 parent bdffb97 commit 9196f87
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ declare_lint! {

declare_lint! {
pub PATTERNS_IN_FNS_WITHOUT_BODY,
Deny,
Warn,
"patterns in functions without body were erroneously allowed"
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/compile-fail/no-patterns-in-args-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/test/run-pass/linkage1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
4 changes: 3 additions & 1 deletion src/test/run-pass/thread-local-extern-static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ extern {
}

fn main() {
assert_eq!(FOO, 3);
unsafe {
assert_eq!(FOO, 3);
}
}

0 comments on commit 9196f87

Please sign in to comment.