Skip to content

Commit 9196f87

Browse files
committed
Make patterns_in_fns_without_body warn-by-default again
Fix some tests on Linux
1 parent bdffb97 commit 9196f87

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/librustc/lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ declare_lint! {
163163

164164
declare_lint! {
165165
pub PATTERNS_IN_FNS_WITHOUT_BODY,
166-
Deny,
166+
Warn,
167167
"patterns in functions without body were erroneously allowed"
168168
}
169169

src/test/compile-fail/no-patterns-in-args-2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![deny(patterns_in_fns_without_body)]
12+
1113
trait Tr {
1214
fn f1(mut arg: u8); //~ ERROR patterns aren't allowed in methods without bodies
1315
//~^ WARN was previously accepted

src/test/run-pass/linkage1.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ fn main() {
3232
// discarded. By adding and calling `other::bar`, we get around this problem.
3333
other::bar();
3434

35-
assert!(!foo.is_null());
36-
assert_eq!(unsafe { *foo }, 3);
37-
assert!(something_that_should_never_exist.is_null());
35+
unsafe {
36+
assert!(!foo.is_null());
37+
assert_eq!(*foo, 3);
38+
assert!(something_that_should_never_exist.is_null());
39+
}
3840
}

src/test/run-pass/thread-local-extern-static.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ extern {
2222
}
2323

2424
fn main() {
25-
assert_eq!(FOO, 3);
25+
unsafe {
26+
assert_eq!(FOO, 3);
27+
}
2628
}

0 commit comments

Comments
 (0)