File tree Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Original file line number Diff line number Diff line change
1
+ pub mod my_trait {
2
+ pub trait MyTrait {
3
+ fn my_fn ( & self ) -> Self ;
4
+ }
5
+ }
6
+
7
+ pub mod prelude {
8
+ #[ doc( inline) ]
9
+ pub use crate :: my_trait:: MyTrait ;
10
+ }
11
+
12
+ pub struct SomeStruct ;
13
+
14
+ impl my_trait:: MyTrait for SomeStruct {
15
+ fn my_fn ( & self ) -> SomeStruct {
16
+ SomeStruct
17
+ }
18
+ }
Original file line number Diff line number Diff line change
1
+ // aux-build:implementors_inline.rs
2
+ // build-aux-docs
3
+ // ignore-cross-compile
4
+
5
+ extern crate implementors_inline;
6
+
7
+ // @!has implementors/implementors_js/trait.MyTrait.js
8
+ // @has implementors/implementors_inline/my_trait/trait.MyTrait.js
9
+ // @!has implementors/implementors_inline/prelude/trait.MyTrait.js
10
+ // @has implementors_inline/my_trait/trait.MyTrait.html
11
+ // @has - '//script/@src' '../../implementors/implementors_inline/my_trait/trait.MyTrait.js'
12
+ // @has implementors_js/trait.MyTrait.html
13
+ // @has - '//script/@src' '../implementors/implementors_inline/my_trait/trait.MyTrait.js'
14
+ /// When re-exporting this trait, the HTML will be inlined,
15
+ /// but, vitally, the JavaScript will be located only at the
16
+ /// one canonical path.
17
+ pub use implementors_inline:: prelude:: MyTrait ;
18
+
19
+ pub struct OtherStruct ;
20
+
21
+ impl MyTrait for OtherStruct {
22
+ fn my_fn ( & self ) -> OtherStruct {
23
+ OtherStruct
24
+ }
25
+ }
Original file line number Diff line number Diff line change 1
- #![ allow ( rustdoc:: broken_intra_doc_links) ]
1
+ #![ forbid ( rustdoc:: broken_intra_doc_links) ]
2
2
3
3
//! Email me at <hello@example.com>.
4
4
//! Email me at <hello-world@example.com>.
5
- //! Email me at <hello@localhost> (this warns but will still become a link).
5
+ //! Email me at <hello@localhost>.
6
+ //! Email me at <prim@i32>.
6
7
// @has email_address/index.html '//a[@href="mailto:hello@example.com"]' 'hello@example.com'
7
8
// @has email_address/index.html '//a[@href="mailto:hello-world@example.com"]' 'hello-world@example.com'
8
9
// @has email_address/index.html '//a[@href="mailto:hello@localhost"]' 'hello@localhost'
10
+ // @has email_address/index.html '//a[@href="mailto:prim@i32"]' 'prim@i32'
You can’t perform that action at this time.
0 commit comments