File tree 7 files changed +52
-6
lines changed
7 files changed +52
-6
lines changed Original file line number Diff line number Diff line change 1
1
// build-pass
2
2
#![ allow( dead_code) ]
3
3
#![ allow( non_camel_case_types) ]
4
+ #![ warn( clashing_extern_decl) ]
4
5
5
6
// pretty-expanded FIXME #23616
6
7
@@ -20,6 +21,7 @@ mod b {
20
21
use super :: rust_task;
21
22
extern {
22
23
pub fn rust_task_is_unwinding ( rt : * const rust_task ) -> bool ;
24
+ //~^ WARN `rust_task_is_unwinding` redeclared with a different signature
23
25
}
24
26
}
25
27
}
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 1
1
// run-pass
2
2
#![ allow( dead_code) ]
3
+ #![ warn( clashing_extern_decl) ]
3
4
// pretty-expanded FIXME #23616
4
5
5
6
extern {
6
7
#[ link_name = "malloc" ]
7
8
fn malloc1 ( len : i32 ) -> * const u8 ;
8
9
#[ link_name = "malloc" ]
10
+ //~^ WARN `malloc2` redeclares `malloc` with a different signature
9
11
fn malloc2 ( len : i32 , foo : i32 ) -> * const u8 ;
10
12
}
11
13
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 1
1
#![ allow( unused_variables) ]
2
2
#![ allow( non_camel_case_types) ]
3
+ #![ allow( clashing_extern_decl) ]
3
4
#![ deny( dead_code) ]
4
5
5
6
#![ crate_type="lib" ]
Original file line number Diff line number Diff line change 1
1
error: struct is never constructed: `Foo`
2
- --> $DIR/lint-dead-code-3.rs:13 :8
2
+ --> $DIR/lint-dead-code-3.rs:14 :8
3
3
|
4
4
LL | struct Foo;
5
5
| ^^^
6
6
|
7
7
note: the lint level is defined here
8
- --> $DIR/lint-dead-code-3.rs:3 :9
8
+ --> $DIR/lint-dead-code-3.rs:4 :9
9
9
|
10
10
LL | #![deny(dead_code)]
11
11
| ^^^^^^^^^
12
12
13
13
error: associated function is never used: `foo`
14
- --> $DIR/lint-dead-code-3.rs:15 :8
14
+ --> $DIR/lint-dead-code-3.rs:16 :8
15
15
|
16
16
LL | fn foo(&self) {
17
17
| ^^^
18
18
19
19
error: function is never used: `bar`
20
- --> $DIR/lint-dead-code-3.rs:20 :4
20
+ --> $DIR/lint-dead-code-3.rs:21 :4
21
21
|
22
22
LL | fn bar() {
23
23
| ^^^
24
24
25
25
error: enum is never used: `c_void`
26
- --> $DIR/lint-dead-code-3.rs:59 :6
26
+ --> $DIR/lint-dead-code-3.rs:60 :6
27
27
|
28
28
LL | enum c_void {}
29
29
| ^^^^^^
30
30
31
31
error: function is never used: `free`
32
- --> $DIR/lint-dead-code-3.rs:61 :5
32
+ --> $DIR/lint-dead-code-3.rs:62 :5
33
33
|
34
34
LL | fn free(p: *const c_void);
35
35
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
1
+ #![ allow( clashing_extern_decl) ]
1
2
// check-pass
2
3
3
4
// 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