Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 48aabbd

Browse files
committedApr 27, 2016
rustdoc: Render extern fn instead of extern "C" fn
1 parent 2b1e35e commit 48aabbd

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed
 

‎src/librustdoc/html/format.rs

+1
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ impl fmt::Display for AbiSpace {
766766
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
767767
match self.0 {
768768
Abi::Rust => Ok(()),
769+
Abi::C => write!(f, "extern "),
769770
abi => write!(f, "extern "{}" ", abi.name()),
770771
}
771772
}

‎src/test/rustdoc/extern-impl.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ impl Foo {
1818
pub fn rust0() {}
1919
// @has - '//code' 'fn rust1()'
2020
pub extern "Rust" fn rust1() {}
21-
// @has - '//code' 'extern "C" fn c0()'
21+
// @has - '//code' 'extern fn c0()'
2222
pub extern fn c0() {}
23-
// @has - '//code' 'extern "C" fn c1()'
23+
// @has - '//code' 'extern fn c1()'
2424
pub extern "C" fn c1() {}
2525
// @has - '//code' 'extern "system" fn system0()'
2626
pub extern "system" fn system0() {}
@@ -31,7 +31,7 @@ pub trait Bar {}
3131

3232
// @has - '//code' 'impl Bar for fn()'
3333
impl Bar for fn() {}
34-
// @has - '//code' 'impl Bar for extern "C" fn()'
34+
// @has - '//code' 'impl Bar for extern fn()'
3535
impl Bar for extern fn() {}
3636
// @has - '//code' 'impl Bar for extern "system" fn()'
3737
impl Bar for extern "system" fn() {}

‎src/test/rustdoc/ffi.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
extern crate rustdoc_ffi as lib;
1515

16-
// @has ffi/fn.foreigner.html //pre 'pub unsafe extern "C" fn foreigner(cold_as_ice: u32)'
16+
// @has ffi/fn.foreigner.html //pre 'pub unsafe extern fn foreigner(cold_as_ice: u32)'
1717
pub use lib::foreigner;
1818

1919
extern "C" {
20-
// @has ffi/fn.another.html //pre 'pub unsafe extern "C" fn another(cold_as_ice: u32)'
20+
// @has ffi/fn.another.html //pre 'pub unsafe extern fn another(cold_as_ice: u32)'
2121
pub fn another(cold_as_ice: u32);
2222
}

‎src/test/rustdoc/issue-22038.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
extern {
1212
// @has issue_22038/fn.foo1.html \
13-
// '//*[@class="rust fn"]' 'pub unsafe extern "C" fn foo1()'
13+
// '//*[@class="rust fn"]' 'pub unsafe extern fn foo1()'
1414
pub fn foo1();
1515
}
1616

@@ -21,7 +21,7 @@ extern "system" {
2121
}
2222

2323
// @has issue_22038/fn.bar.html \
24-
// '//*[@class="rust fn"]' 'pub extern "C" fn bar()'
24+
// '//*[@class="rust fn"]' 'pub extern fn bar()'
2525
pub extern fn bar() {}
2626

2727
// @has issue_22038/fn.baz.html \

‎src/test/rustdoc/variadic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
// except according to those terms.
1010

1111
extern "C" {
12-
// @has variadic/fn.foo.html //pre 'pub unsafe extern "C" fn foo(x: i32, ...)'
12+
// @has variadic/fn.foo.html //pre 'pub unsafe extern fn foo(x: i32, ...)'
1313
pub fn foo(x: i32, ...);
1414
}

0 commit comments

Comments
 (0)
Failed to load comments.