rustdoc: intra doc links link to re-exported primitives#77757
rustdoc: intra doc links link to re-exported primitives#77757Stupremee wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
Some changes occurred in intra-doc-links. cc @jyn514 |
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jyn514 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
Nice! Does it work for methods on |
|
No, it doesn't, but I can try to make it work |
|
Oh... That was the sad hope haha. |
|
@Stupremee #63351 is a much harder issue, please don't mix it into any other changes. |
| .next(); | ||
| prim.or_else(|| { | ||
| let res = cx | ||
| .enter_resolver(|resolver| { | ||
| resolver.resolve_str_path_error(DUMMY_SP, &path_str, ns, module_id) | ||
| }) | ||
| .ok()? | ||
| .1; | ||
| PRIMITIVES | ||
| .iter() | ||
| .find(|(_, prim_res)| match (res, prim_res) { | ||
| (Res::PrimTy(ty1), Res::PrimTy(ty2)) if ty1 == *ty2 => true, | ||
| (_, _) => false, | ||
| }) | ||
| .copied() | ||
| }) |
There was a problem hiding this comment.
This does not look right. Instead of changing is_primitive to go through rustc_resolve, can you change some of the callsites not to use is_primitive? The only place that should be doing string comparisons is the ambiguity check for modules vs. primitives.
See also #77743 (comment).
| if path_str.contains(|ch: char| !(ch.is_alphanumeric() || ch == ':' || ch == '_')) { | ||
| return None; | ||
| } | ||
| let mut path_str = if let Ok((d, path)) = Disambiguator::from_str(&link) { |
There was a problem hiding this comment.
Can you split this refactor into a separate commit so the logic changes are easier to see?
|
I'm going to close this in favor of #77743, I like the approach there better. Sorry your code didn't make it in - if you're interested in working on other intra-doc issues let me know and I'm happy to mentor! |
Resolves #77267
r? @jyn514 @GuillaumeGomez