]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/intra-doc/in-bodies.rs
Rollup merge of #106618 - jmillikin:os-net-rustdoc-wasm32, r=JohnTitor
[rust.git] / tests / rustdoc / intra-doc / in-bodies.rs
1 // we need to make sure that intra-doc links on trait impls get resolved in the right scope
2
3 #![deny(rustdoc::broken_intra_doc_links)]
4
5 pub mod inner {
6     pub struct SomethingOutOfScope;
7 }
8
9 pub mod other {
10     use inner::SomethingOutOfScope;
11     use SomeTrait;
12
13     pub struct OtherStruct;
14
15     /// Let's link to [SomethingOutOfScope] while we're at it.
16     impl SomeTrait for OtherStruct {}
17 }
18
19 pub trait SomeTrait {}
20
21 pub struct SomeStruct;
22
23 fn __implementation_details() {
24     use inner::SomethingOutOfScope;
25
26     // FIXME: intra-links resolve in their nearest module scope, not their actual scope in cases
27     // like this
28     // Let's link to [SomethingOutOfScope] while we're at it.
29     impl SomeTrait for SomeStruct {}
30 }