Github Rustdoc: Fix macros 2.0 and built-in derives being shown at the wrong pat...
source link: https://github.com/rust-lang/rust/pull/77862
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Member
jyn514 left a comment
This is awful, but I don't know a better way to do it.
Outdated
for path_segment in macro_parent_module.data {
let path_segment = path_segment.to_string();
cur_mod = cur_mod.mods.iter_mut().find(|module| {
matches!(
module.name, Some(symbol)
if symbol.with(|mod_name| mod_name == path_segment)
)
})?;
}
Comment on lines
105 to 109
jyn514 on Oct 13, 2020
Member
Ugh, I really wish rustdoc didn't use its own data structures (#76382). That said, if this works I won't block on it, but it's unambiguously a hack.
@GuillaumeGomez before I sign off on this, do you know a better way to do this?
danielhenrymantilla on Oct 13, 2020
Author
Contributor
That said, if this works I won't block on it, but it's unambiguously a hack.
Definitely! The reason I've submitted this code (despite my not having cleaned that try
block elsewhere) was for you people to tell me if there was some obvious tool I had missed in places like here, given my lack of experience with rustdoc
and rustc
internals
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK