Skip to content
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

Merged
merged 1 commit into from
Mar 31, 2018
Merged

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Mar 28, 2018

Part of #43466.

r? @QuietMisdreavus

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 28, 2018
Copy link
Member

@QuietMisdreavus QuietMisdreavus left a 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.

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",
Copy link
Member

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.

"i8", "i16", "i32", "i64", "i128", "isize",
"f32", "f64",
"str", "bool", "char"];
const PRIMITIVES_DEF: &[Def] = &[Def::PrimTy(hir::PrimTy::TyUint(syntax::ast::UintTy::U8)),
Copy link
Member

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.

@GuillaumeGomez GuillaumeGomez force-pushed the primitive-intra-links branch 2 times, most recently from 74426f7 to 039d291 Compare March 29, 2018 11:42
@GuillaumeGomez
Copy link
Member Author

Updated.

@QuietMisdreavus
Copy link
Member

Looks great! Thanks for getting into this!

@bors r+

@bors
Copy link
Contributor

bors commented Mar 29, 2018

📌 Commit 561e8ef has been approved by QuietMisdreavus

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 29, 2018
@bors
Copy link
Contributor

bors commented Mar 31, 2018

⌛ Testing commit 561e8ef with merge 1c5283b...

bors added a commit that referenced this pull request Mar 31, 2018
@bors
Copy link
Contributor

bors commented Mar 31, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: QuietMisdreavus
Pushing 1c5283b to master...

@bors bors merged commit 561e8ef into rust-lang:master Mar 31, 2018
@GuillaumeGomez GuillaumeGomez deleted the primitive-intra-links branch March 31, 2018 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants