]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Render `extern fn` instead of `extern "C" fn`
authorOliver Middleton <olliemail27@gmail.com>
Wed, 27 Apr 2016 17:43:51 +0000 (18:43 +0100)
committerOliver Middleton <olliemail27@gmail.com>
Wed, 27 Apr 2016 17:43:51 +0000 (18:43 +0100)
src/librustdoc/html/format.rs
src/test/rustdoc/extern-impl.rs
src/test/rustdoc/ffi.rs
src/test/rustdoc/issue-22038.rs
src/test/rustdoc/variadic.rs

index 72414ad4c5e9c5dc444580b52ff6ffaf4cf690b3..a64df41f2865c7a30dcbf364708d6711a9e40aa6 100644 (file)
@@ -766,6 +766,7 @@ impl fmt::Display for AbiSpace {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match self.0 {
             Abi::Rust => Ok(()),
+            Abi::C => write!(f, "extern "),
             abi => write!(f, "extern &quot;{}&quot; ", abi.name()),
         }
     }
index 5c64b4118c3ab1a748e2175b3f74c82baa123efc..0e78746704fb150a838c7a885902e729a947d7f1 100644 (file)
@@ -18,9 +18,9 @@ impl Foo {
     pub fn rust0() {}
     // @has - '//code' 'fn rust1()'
     pub extern "Rust" fn rust1() {}
-    // @has - '//code' 'extern "C" fn c0()'
+    // @has - '//code' 'extern fn c0()'
     pub extern fn c0() {}
-    // @has - '//code' 'extern "C" fn c1()'
+    // @has - '//code' 'extern fn c1()'
     pub extern "C" fn c1() {}
     // @has - '//code' 'extern "system" fn system0()'
     pub extern "system" fn system0() {}
@@ -31,7 +31,7 @@ pub trait Bar {}
 
 // @has - '//code' 'impl Bar for fn()'
 impl Bar for fn() {}
-// @has - '//code' 'impl Bar for extern "C" fn()'
+// @has - '//code' 'impl Bar for extern fn()'
 impl Bar for extern fn() {}
 // @has - '//code' 'impl Bar for extern "system" fn()'
 impl Bar for extern "system" fn() {}
index 8511d461703de58dfc9cf656656f0ec2b1839e53..3997dcd81e153e75a20cb5a7fc2a5447e59ce788 100644 (file)
 
 extern crate rustdoc_ffi as lib;
 
-// @has ffi/fn.foreigner.html //pre 'pub unsafe extern "C" fn foreigner(cold_as_ice: u32)'
+// @has ffi/fn.foreigner.html //pre 'pub unsafe extern fn foreigner(cold_as_ice: u32)'
 pub use lib::foreigner;
 
 extern "C" {
-    // @has ffi/fn.another.html //pre 'pub unsafe extern "C" fn another(cold_as_ice: u32)'
+    // @has ffi/fn.another.html //pre 'pub unsafe extern fn another(cold_as_ice: u32)'
     pub fn another(cold_as_ice: u32);
 }
index 75df53589454f6d3927e8d8fc382d9f3b4f7fc9d..6f84428b0798ff36965118296d20a204c61fa4b3 100644 (file)
@@ -10,7 +10,7 @@
 
 extern {
     // @has issue_22038/fn.foo1.html \
-    //      '//*[@class="rust fn"]' 'pub unsafe extern "C" fn foo1()'
+    //      '//*[@class="rust fn"]' 'pub unsafe extern fn foo1()'
     pub fn foo1();
 }
 
@@ -21,7 +21,7 @@
 }
 
 // @has issue_22038/fn.bar.html \
-//      '//*[@class="rust fn"]' 'pub extern "C" fn bar()'
+//      '//*[@class="rust fn"]' 'pub extern fn bar()'
 pub extern fn bar() {}
 
 // @has issue_22038/fn.baz.html \
index 6ba776ba4679f845c2dd9f3f880e586f7d056b34..1b60c2a334fa5ea7ae15a4bd553a9cdd9bc791a6 100644 (file)
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 extern "C" {
-    // @has variadic/fn.foo.html //pre 'pub unsafe extern "C" fn foo(x: i32, ...)'
+    // @has variadic/fn.foo.html //pre 'pub unsafe extern fn foo(x: i32, ...)'
     pub fn foo(x: i32, ...);
 }