]> git.proxmox.com Git - rustc.git/blame - src/tools/rustfmt/tests/source/extern.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / rustfmt / tests / source / extern.rs
CommitLineData
f20569fa
XL
1// rustfmt-normalize_comments: true
2
3 extern crate foo ;
4 extern crate foo as bar ;
5
6extern crate futures;
7extern crate dotenv;
8extern crate chrono;
9
10extern crate foo;
11extern crate bar;
12
13// #2315
14extern crate proc_macro2;
15extern crate proc_macro;
16
17// #3128
18extern crate serde; // 1.0.78
19extern crate serde_derive; // 1.0.78
20extern crate serde_json; // 1.0.27
21
22 extern "C" {
23 fn c_func(x: *mut *mut libc::c_void);
24
25 fn c_func(x: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, y: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY);
26
27 #[test123]
28 fn foo() -> uint64_t;
29
30pub fn bar() ;
31 }
32
33extern {
34 fn DMR_GetDevice(pHDev: *mut HDEV, searchMode: DeviceSearchMode, pSearchString: *const c_char, devNr: c_uint, wildcard: c_char) -> TDMR_ERROR;
35
36 fn quux() -> (); // Post comment
37
38 pub type
39 Foo;
40
41 type Bar;
42}
43
44extern "Rust" { static ext: u32;
45 // Some comment.
46 pub static mut var : SomeType ; }
47
48extern "C" {
49 fn syscall(number: libc::c_long /* comment 1 */, /* comm 2 */ ... /* sup? */) -> libc::c_long;
50
51 fn foo (x: *const c_char , ... ) ->
52libc::c_long;
53 }
54
55 extern {
56 pub fn freopen(filename: *const c_char, mode: *const c_char
57 , mode2: *const c_char
58 , mode3: *const c_char,
59 file: *mut FILE)
60 -> *mut FILE;
61
62
63 const fn foo(
64
65 ) ->
66 *mut Bar;
67 unsafe fn foo(
68
69 ) -> *
70 mut
71 Bar;
72
73 pub(super) const fn foo() -> *mut Bar;
74 pub(crate) unsafe fn foo() -> *mut Bar;
75 }
76
77extern {
78
79}