]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/extern-impl.rs
0e78746704fb150a838c7a885902e729a947d7f1
[rust.git] / src / test / rustdoc / extern-impl.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![crate_name = "foo"]
12
13 // @has foo/struct.Foo.html
14 pub struct Foo;
15
16 impl Foo {
17     // @has - '//code' 'fn rust0()'
18     pub fn rust0() {}
19     // @has - '//code' 'fn rust1()'
20     pub extern "Rust" fn rust1() {}
21     // @has - '//code' 'extern fn c0()'
22     pub extern fn c0() {}
23     // @has - '//code' 'extern fn c1()'
24     pub extern "C" fn c1() {}
25     // @has - '//code' 'extern "system" fn system0()'
26     pub extern "system" fn system0() {}
27 }
28
29 // @has foo/trait.Bar.html
30 pub trait Bar {}
31
32 // @has - '//code' 'impl Bar for fn()'
33 impl Bar for fn() {}
34 // @has - '//code' 'impl Bar for extern fn()'
35 impl Bar for extern fn() {}
36 // @has - '//code' 'impl Bar for extern "system" fn()'
37 impl Bar for extern "system" fn() {}