File tree Expand file tree Collapse file tree 7 files changed +52
-6
lines changed Expand file tree Collapse file tree 7 files changed +52
-6
lines changed Original file line number Diff line number Diff line change 11// build-pass
22#![ allow( dead_code) ]
33#![ allow( non_camel_case_types) ]
4+ #![ warn( clashing_extern_decl) ]
45
56// pretty-expanded FIXME #23616
67
@@ -20,6 +21,7 @@ mod b {
2021 use super :: rust_task;
2122 extern {
2223 pub fn rust_task_is_unwinding ( rt : * const rust_task ) -> bool ;
24+ //~^ WARN `rust_task_is_unwinding` redeclared with a different signature
2325 }
2426 }
2527}
Original file line number Diff line number Diff line change 1+ warning: `rust_task_is_unwinding` redeclared with a different signature
2+ --> $DIR/issue-1866.rs:23:13
3+ |
4+ LL | pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
5+ | ------------------------------------------------------------ `rust_task_is_unwinding` previously declared here
6+ ...
7+ LL | pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
8+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
9+ |
10+ note: the lint level is defined here
11+ --> $DIR/issue-1866.rs:4:9
12+ |
13+ LL | #![warn(clashing_extern_decl)]
14+ | ^^^^^^^^^^^^^^^^^^^^
15+ = note: expected `unsafe extern "C" fn(*const usize) -> bool`
16+ found `unsafe extern "C" fn(*const bool) -> bool`
17+
18+ warning: 1 warning emitted
19+
Original file line number Diff line number Diff line change 11// run-pass
22#![ allow( dead_code) ]
3+ #![ warn( clashing_extern_decl) ]
34// pretty-expanded FIXME #23616
45
56extern {
67 #[ link_name = "malloc" ]
78 fn malloc1 ( len : i32 ) -> * const u8 ;
89 #[ link_name = "malloc" ]
10+ //~^ WARN `malloc2` redeclares `malloc` with a different signature
911 fn malloc2 ( len : i32 , foo : i32 ) -> * const u8 ;
1012}
1113
Original file line number Diff line number Diff line change 1+ warning: `malloc2` redeclares `malloc` with a different signature
2+ --> $DIR/issue-5791.rs:9:5
3+ |
4+ LL | / #[link_name = "malloc"]
5+ LL | | fn malloc1(len: i32) -> *const u8;
6+ | |______________________________________- `malloc` previously declared here
7+ LL | / #[link_name = "malloc"]
8+ LL | |
9+ LL | | fn malloc2(len: i32, foo: i32) -> *const u8;
10+ | |________________________________________________^ this signature doesn't match the previous declaration
11+ |
12+ note: the lint level is defined here
13+ --> $DIR/issue-5791.rs:3:9
14+ |
15+ LL | #![warn(clashing_extern_decl)]
16+ | ^^^^^^^^^^^^^^^^^^^^
17+ = note: expected `unsafe extern "C" fn(i32) -> *const u8`
18+ found `unsafe extern "C" fn(i32, i32) -> *const u8`
19+
20+ warning: 1 warning emitted
21+
Original file line number Diff line number Diff line change 11#![ allow( unused_variables) ]
22#![ allow( non_camel_case_types) ]
3+ #![ allow( clashing_extern_decl) ]
34#![ deny( dead_code) ]
45
56#![ crate_type="lib" ]
Original file line number Diff line number Diff line change 11error: struct is never constructed: `Foo`
2- --> $DIR/lint-dead-code-3.rs:13 :8
2+ --> $DIR/lint-dead-code-3.rs:14 :8
33 |
44LL | struct Foo;
55 | ^^^
66 |
77note: the lint level is defined here
8- --> $DIR/lint-dead-code-3.rs:3 :9
8+ --> $DIR/lint-dead-code-3.rs:4 :9
99 |
1010LL | #![deny(dead_code)]
1111 | ^^^^^^^^^
1212
1313error: associated function is never used: `foo`
14- --> $DIR/lint-dead-code-3.rs:15 :8
14+ --> $DIR/lint-dead-code-3.rs:16 :8
1515 |
1616LL | fn foo(&self) {
1717 | ^^^
1818
1919error: function is never used: `bar`
20- --> $DIR/lint-dead-code-3.rs:20 :4
20+ --> $DIR/lint-dead-code-3.rs:21 :4
2121 |
2222LL | fn bar() {
2323 | ^^^
2424
2525error: enum is never used: `c_void`
26- --> $DIR/lint-dead-code-3.rs:59 :6
26+ --> $DIR/lint-dead-code-3.rs:60 :6
2727 |
2828LL | enum c_void {}
2929 | ^^^^^^
3030
3131error: function is never used: `free`
32- --> $DIR/lint-dead-code-3.rs:61 :5
32+ --> $DIR/lint-dead-code-3.rs:62 :5
3333 |
3434LL | fn free(p: *const c_void);
3535 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change 1+ #![ allow( clashing_extern_decl) ]
12// check-pass
23
34// In this test we check that the parser accepts an ABI string when it
You can’t perform that action at this time.
0 commit comments