-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Report an ambiguity if both modules and primitives are in scope for intra-doc links #75815
Conversation
Some changes occurred in intra-doc-links. cc @jyn514 |
(rust_highfive has picked a reviewer for you, use r? to override) |
Wow, that's more errors than I expected.
|
I just realized |
This is ready for review. |
Thanks! @bors: r+ |
📌 Commit cdffc57b2c5f0c494b4b94726088b3a228f5f2cc has been approved by |
⌛ Testing commit cdffc57b2c5f0c494b4b94726088b3a228f5f2cc with merge 907ba2b614a2d1b1384fc7d0a8a987e676d5d184... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - checks-actions |
Network error. @bors retry Although I expect this to conflict with some of the intra-doc link PRs. |
💔 Test failed - checks-actions |
- Add a new `prim@` disambiguator, since both modules and primitives are in the same namespace - Refactor `report_ambiguity` into a closure Additionally, I noticed that rustdoc would previously allow `[struct@char]` if `char` resolved to a primitive (not if it had a DefId). I fixed that and added a test case.
This also changes human intuition -> intuition. 'human intuition' sounds vaguely menacing.
cdffc57
to
25cfd57
Compare
…r=Mark-Simulacrum publish-toolstate: show more context on HTTP error The default display for HTTPError in Python does not include the request body. For GitHub API, the body includes more details about the error (like rate limiting). This could help diagnosing errors like this: rust-lang#75815 (comment)
@bors r=guillaumegomez |
📌 Commit 25cfd57 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
I very much dislike this use of “prim”, which feels unprecedented as a keyword (I dunno, maybe the compiler uses it, maybe not, but as a user of the language I haven’t seen anyone do it this way). Could we change it to the full word “primitive”? That would match Rust’s general style of identifiers and the filenames rustdoc emits for the primitives ( |
@chris-morgan you can already use |
OK, I didn’t read carefully enough to notice that; thanks for pointing it out. But my point still mostly stands, because the I-think-unprecedented “prim” is still both supported and what the note suggests. If I submit another PR that drops prim in favour of primitive, would it be accepted? |
If you drop prim, go ahead and drop the rest of the duplicate disambiguators at the same time: #74430 (comment) I don't feel strongly either way, I think it would need FCP though since they already exist on nightly but haven't hit stable. I can start an FCP if you make a PR. |
@chris-morgan are you still interested in working on this? The beta branch is in a couple weeks and I'd prefer to make breaking changes before intra-doc links stabilize. |
Closes #75381
prim@
disambiguator, since both modules and primitives are in the same namespacereport_ambiguity
into a closureAdditionally, I noticed that rustdoc would previously allow
[struct@char]
ifchar
resolved to a primitive (not if it had a DefId). I fixed that and added a test case.I also need to update libstd to use
prim@char
instead oftype@char
. If possible I would also like to refactorambiguity_error
to useDisambiguator
instead of its own hand-rolled match - that ran into issues withprim@
(I updated one and not the other) and it would be better for them to be in sync.