forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustdoc: Resolve doc links on fields during early resolution
- Loading branch information
1 parent
3d237ab
commit 6d590ba
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Traits in scope are collected for doc links in field attributes. | ||
|
||
// check-pass | ||
// aux-build: assoc-field-dep.rs | ||
|
||
extern crate assoc_field_dep; | ||
pub use assoc_field_dep::*; | ||
|
||
#[derive(Clone)] | ||
pub struct Struct; | ||
|
||
pub mod mod1 { | ||
pub struct Fields { | ||
/// [crate::Struct::clone] | ||
pub field: u8, | ||
} | ||
} | ||
|
||
pub mod mod2 { | ||
pub enum Fields { | ||
V { | ||
/// [crate::Struct::clone] | ||
field: u8, | ||
}, | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/test/rustdoc-ui/intra-doc/auxiliary/assoc-field-dep.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#[derive(Clone)] | ||
pub struct Struct; | ||
|
||
pub mod dep_mod1 { | ||
pub struct Fields { | ||
/// [crate::Struct::clone] | ||
pub field: u8, | ||
} | ||
} | ||
|
||
pub mod dep_mod2 { | ||
pub enum Fields { | ||
V { | ||
/// [crate::Struct::clone] | ||
field: u8, | ||
}, | ||
} | ||
} |