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

rustdoc: Resolve &str as str #80885

Merged
merged 1 commit into from
Jan 12, 2021
Merged

Conversation

camelid
Copy link
Member

@camelid camelid commented Jan 10, 2021

People almost always are referring to &str, not str, so this will
save a manual link resolve in many cases.

Note that we already accept & (resolves to reference) in intra-doc
links, so this shouldn't cause breakage.

r? @jyn514

People almost always are referring to `&str`, not `str`, so this will
save a manual link resolve in many cases.

Note that we already accept `&` (resolves to `reference`) in intra-doc
links, so this shouldn't cause breakage.
@camelid camelid added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 10, 2021
@rust-highfive
Copy link
Collaborator

Some changes occurred in intra-doc-links.

cc @jyn514

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 10, 2021
@jyn514
Copy link
Member

jyn514 commented Jan 10, 2021

I am not sure about this. I think special-casing &str (without ::) might be ok, but I would feel weird documenting this: we found one edge case people hit a lot and solved specifically that, but it's not orthogonal, you can't generalize it.

@Manishearth what do you think?

JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 11, 2021
…n514

rustdoc: Remove `*` intra-doc alias for `pointer`

It's not valid Rust code and it can easily be confused with a wildcard
glob pattern or something else. People can always use `pointer` instead,
so it's just removing an alias.

It hasn't hit stable yet (I think it's still on nightly), so it's okay
to remove it. (We can always add it back later if we change our mind
too.)

r? `@jyn514`
cc rust-lang#80885 (comment)
@Manishearth
Copy link
Member

I'm okay with having &str special cased, it and slice are basically the only two types that get referred to on the regular as being inside a different type. It's fine IMO.

@jyn514
Copy link
Member

jyn514 commented Jan 11, 2021

Ok, seems good.

@bors r+

@bors
Copy link
Contributor

bors commented Jan 11, 2021

📌 Commit 2750e36 has been approved by jyn514

@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 Jan 11, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 12, 2021
Rollup of 9 pull requests

Successful merges:

 - rust-lang#79997 (Emit a reactor for cdylib target on wasi)
 - rust-lang#79998 (Use correct ABI for wasm32 by default)
 - rust-lang#80042 (Split a func into cold/hot parts, reducing binary size)
 - rust-lang#80324 (Explain method-call move errors in loops)
 - rust-lang#80864 (std/core docs: fix wrong link in PartialEq)
 - rust-lang#80870 (resolve: Simplify built-in macro table)
 - rust-lang#80885 (rustdoc: Resolve `&str` as `str`)
 - rust-lang#80904 (Fix small typo)
 - rust-lang#80923 (Merge different function exits)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7e16025 into rust-lang:master Jan 12, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 12, 2021
@camelid camelid deleted the intra-doc-str-ref branch January 12, 2021 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-enhancement Category: An issue proposing an enhancement or a PR with one. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants