-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add primitive intra-links #49459
Add primitive intra-links #49459
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! The basic design looks good, but there are a couple things that i'd like to see differently.
src/librustdoc/clean/mod.rs
Outdated
if let Some(ref fragment) = *fragment { | ||
// This is a primitive so the url is done "by hand". | ||
Some((s.clone(), | ||
format!("https://doc.rust-lang.org/{}std/primitive.{}.html", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't link to the stable std docs anywhere, since libstd itself has a doc_html_root
set to the nightly docs. I would prefer if you could somehow grab the url root for std to combine with the "hand-made" primitive link, or at least always link to nightly.
src/librustdoc/clean/mod.rs
Outdated
"i8", "i16", "i32", "i64", "i128", "isize", | ||
"f32", "f64", | ||
"str", "bool", "char"]; | ||
const PRIMITIVES_DEF: &[Def] = &[Def::PrimTy(hir::PrimTy::TyUint(syntax::ast::UintTy::U8)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these listings are supposed to be related to each other, can you at least make it a &[(&str, Def)]
? A map of some kind would be best, but since it's a const, the slice-of-tuples will work.
74426f7
to
039d291
Compare
039d291
to
561e8ef
Compare
Updated. |
Looks great! Thanks for getting into this! @bors r+ |
📌 Commit 561e8ef has been approved by |
…isdreavus Add primitive intra-links Part of #43466. r? @QuietMisdreavus
☀️ Test successful - status-appveyor, status-travis |
Part of #43466.
r? @QuietMisdreavus