]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/rustc-incoherent-impls.rs
Rollup merge of #107773 - Mark-Simulacrum:rename-auto-template, r=estebank
[rust.git] / tests / rustdoc / rustc-incoherent-impls.rs
1 // aux-build:incoherent-impl-types.rs
2 // build-aux-docs
3
4 #![crate_name = "foo"]
5 #![feature(rustc_attrs)]
6
7 extern crate incoherent_impl_types;
8
9 // The only way this actually shows up is if the type gets inlined.
10 #[doc(inline)]
11 pub use incoherent_impl_types::FooTrait;
12
13 // @has foo/trait.FooTrait.html
14 // @count - '//section[@id="method.do_something"]' 1
15 impl dyn FooTrait {
16     #[rustc_allow_incoherent_impl]
17     pub fn do_something() {}
18 }
19
20 #[doc(inline)]
21 pub use incoherent_impl_types::FooStruct;
22
23 // @has foo/struct.FooStruct.html
24 // @count - '//section[@id="method.do_something"]' 1
25 impl FooStruct {
26     #[rustc_allow_incoherent_impl]
27     pub fn do_something() {}
28 }