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 #[doc(alias="flatmap")] to Option::and_then #109093

Merged
merged 1 commit into from
Jun 4, 2023

Conversation

Dante-Broggi
Copy link
Contributor

I keep forgetting that rust calls this and_then and trying to search for flatmap. and_then's docs even mention "Some languages call this operation flatmap", but it doesn't show up as a result in the search at https://doc.rust-lang.org/std/?search=flatmap

I keep forgetting that rust calls this `and_then` and trying to search for `flatmap`.
`and_then`'s docs even mention "Some languages call this operation flatmap",
but it doesn't show up as a result in the search at `https://doc.rust-lang.org/std/?search=flatmap`
@rustbot
Copy link
Collaborator

rustbot commented Mar 13, 2023

r? @joshtriplett

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 13, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 13, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@anden3 anden3 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 14, 2023
@est31
Copy link
Member

est31 commented Jun 3, 2023

The relevant section of the policy:

we don't expect that people are currently searching Rust documentation for language-specific names from arbitrary languages they're familiar with, and we don't want to add that as a new documentation search feature; please don't add aliases based on your favorite language. Those mappings should live in separate guides or references. We do expect that people might look for the Rust name of a function they reasonably expect to exist in Rust (e.g. a system function or a C library function), to try to figure out what Rust called that function.

IMO that policy is too strict and this PR should be merged, but I think due to the policy, it means that this PR can't add flatmap, because it is neither a C library function, nor an assembly name, nor a system function.

Prior PRs like #81989 for example were rejected, but those were much larger in scope than this one so idk, maybe flatmap can get an exception.

@joshtriplett
Copy link
Member

I think this follows the policy: it seems reasonable to me that someone might search for "flatmap" in the Rust documentation expecting to find it.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 3, 2023

📌 Commit 7fb34c9 has been approved by joshtriplett

It is now in the queue for this repository.

@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 Jun 3, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 4, 2023
add `#[doc(alias="flatmap")]` to `Option::and_then`

I keep forgetting that rust calls this `and_then` and trying to search for `flatmap`. `and_then`'s docs even mention "Some languages call this operation flatmap", but it doesn't show up as a result in the search at `https://doc.rust-lang.org/std/?search=flatmap`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 4, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#109093 (add `#[doc(alias="flatmap")]` to `Option::and_then`)
 - rust-lang#110701 (Fix `x test core` when download-rustc is enabled)
 - rust-lang#111982 (Revert "Enable incremental independent of stage")
 - rust-lang#112158 (Add portable-simd mention)
 - rust-lang#112172 (doc: improve explanation)
 - rust-lang#112178 (Fix bug where private item with intermediate doc hidden re-export was not inlined)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7ee2505 into rust-lang:master Jun 4, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 4, 2023
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. T-libs Relevant to the library 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