]> git.lizzy.rs Git - rust.git/blob - tests/target/extern.rs
Add a test for #3031 and update test
[rust.git] / tests / target / extern.rs
1 // rustfmt-normalize_comments: true
2
3 extern crate foo;
4 extern crate foo as bar;
5
6 extern crate chrono;
7 extern crate dotenv;
8 extern crate futures;
9
10 extern crate bar;
11 extern crate foo;
12
13 // #2315
14 extern crate proc_macro;
15 extern crate proc_macro2;
16
17 extern "C" {
18     fn c_func(x: *mut *mut libc::c_void);
19
20     fn c_func(
21         x: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
22         y: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY,
23     );
24
25     #[test123]
26     fn foo() -> uint64_t;
27
28     pub fn bar();
29 }
30
31 extern "C" {
32     fn DMR_GetDevice(
33         pHDev: *mut HDEV,
34         searchMode: DeviceSearchMode,
35         pSearchString: *const c_char,
36         devNr: c_uint,
37         wildcard: c_char,
38     ) -> TDMR_ERROR;
39
40     fn quux() -> (); // Post comment
41
42     pub type Foo;
43
44     type Bar;
45 }
46
47 extern "Rust" {
48     static ext: u32;
49     // Some comment.
50     pub static mut var: SomeType;
51 }
52
53 extern "C" {
54     fn syscall(
55         number: libc::c_long, // comment 1
56         // comm 2
57         ... // sup?
58     ) -> libc::c_long;
59
60     fn foo(x: *const c_char, ...) -> libc::c_long;
61 }
62
63 extern "C" {
64     pub fn freopen(
65         filename: *const c_char,
66         mode: *const c_char,
67         mode2: *const c_char,
68         mode3: *const c_char,
69         file: *mut FILE,
70     ) -> *mut FILE;
71 }
72
73 extern "C" {}