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

https://gitlab.com/alx741/rust · Rust · 37 lines · 13 code · 5 blank · 19 comment · 3 complexity · c39035f37e1af7132a90dbce05a8f79a MD5 · raw file

  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. #![crate_name = "foo"]
  11. // @has foo/struct.Foo.html
  12. pub struct Foo;
  13. impl Foo {
  14. // @has - '//code' 'fn rust0()'
  15. pub fn rust0() {}
  16. // @has - '//code' 'fn rust1()'
  17. pub extern "Rust" fn rust1() {}
  18. // @has - '//code' 'extern fn c0()'
  19. pub extern fn c0() {}
  20. // @has - '//code' 'extern fn c1()'
  21. pub extern "C" fn c1() {}
  22. // @has - '//code' 'extern "system" fn system0()'
  23. pub extern "system" fn system0() {}
  24. }
  25. // @has foo/trait.Bar.html
  26. pub trait Bar {}
  27. // @has - '//code' 'impl Bar for fn()'
  28. impl Bar for fn() {}
  29. // @has - '//code' 'impl Bar for extern fn()'
  30. impl Bar for extern fn() {}
  31. // @has - '//code' 'impl Bar for extern "system" fn()'
  32. impl Bar for extern "system" fn() {}