]> git.proxmox.com Git - rustc.git/blame - src/test/rustdoc/extern-impl.rs
New upstream version 1.19.0+dfsg1
[rustc.git] / src / test / rustdoc / extern-impl.rs
CommitLineData
a7813a04
XL
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
14pub struct Foo;
15
16impl Foo {
17 // @has - '//code' 'fn rust0()'
18 pub fn rust0() {}
19 // @has - '//code' 'fn rust1()'
20 pub extern "Rust" fn rust1() {}
7cac9316 21 // @has - '//code' 'extern "C" fn c0()'
a7813a04 22 pub extern fn c0() {}
7cac9316 23 // @has - '//code' 'extern "C" fn c1()'
a7813a04
XL
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
30pub trait Bar {}
31
32// @has - '//code' 'impl Bar for fn()'
33impl Bar for fn() {}
7cac9316 34// @has - '//code' 'impl Bar for extern "C" fn()'
a7813a04
XL
35impl Bar for extern fn() {}
36// @has - '//code' 'impl Bar for extern "system" fn()'
37impl Bar for extern "system" fn() {}