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

The "unstable" documentation attribute on intrinsics should mention the specific stabilized interface for each individual intrinsic #34338

Closed
bstrie opened this issue Jun 18, 2016 · 9 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-intrinsics Area: intrinsics C-feature-request Category: A feature request, i.e: not implemented / a PR. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@bstrie
Copy link
Contributor

bstrie commented Jun 18, 2016

Today if one navigates to the docs to, for example, intrinsic::volatile_store (http://doc.rust-lang.org/core/intrinsics/fn.volatile_store.html) you see this warning:

Unstable (core_intrinsics): intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library

But not all intrinsics have stabilized interfaces, and even when they exist this message is not helpful in determining exactly what those interfaces are.

In the specific example of intrinsic::volatile_store, this should mention that its stabilized interface is ptr::write_volatile (https://doc.rust-lang.org/std/ptr/fn.write_volatile.html).

Intrinsics that do not have such stabilized interfaces should have instead reference issues in the Rust bug tracker that involve creating stabilized interfaces, or alternately a metabug that covers all unstable intrinsics that do not have stable interfaces.

If it has been decided that a given intrinsic will never have a stabilized interface for whatever reason, then the unstable documentation attribute should contain the reason why, and/or a link to the discussion where such a decision was arrived upon.

@bstrie bstrie added A-docs E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Jun 18, 2016
@steveklabnik steveklabnik added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed A-docs labels Jun 27, 2016
wesleywiser added a commit to wesleywiser/rust that referenced this issue Nov 9, 2016
wesleywiser added a commit to wesleywiser/rust that referenced this issue Nov 9, 2016
wesleywiser added a commit to wesleywiser/rust that referenced this issue Nov 9, 2016
eddyb added a commit to eddyb/rust that referenced this issue Nov 11, 2016
Add documentation to some of the unstable intrinsics

Part of rust-lang#34338
eddyb added a commit to eddyb/rust that referenced this issue Nov 12, 2016
Add documentation to some of the unstable intrinsics

Part of rust-lang#34338
@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Jul 25, 2017
@bstrie
Copy link
Contributor Author

bstrie commented Oct 4, 2018

Revisiting this, today the intrinsics docs warning message no longer says anything about "instead they should be used through stabilized interfaces in the rest of the standard library", which obviates half of this bug by no longer causing doc readers to wonder at what the stable replacement might be. It also seems that some of the intrinsics have had this issue addressed (e.g. my original example of volatile_store). While it would still be valuable to be sure that any intrinsic with a stable counterpart has that counterpart mentioned in its docs, I'd say that this bug could be closed at the blessing of the docs team.

@QuietMisdreavus QuietMisdreavus added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools and removed T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 5, 2018
@QuietMisdreavus
Copy link
Member

Triage: Punting this to docs team; the unstable attribute doesn't carry any additional information for intrinsics, so any link back to one's stable interface would have to go into the hand-written portion of their docs. That means that this is effectively a checklist issue, if anyone is interested in taking this up... 👀

@DevQps
Copy link
Contributor

DevQps commented Apr 5, 2019

@bstrie @QuietMisdreavus I just saw that if you click the "This is a nightly-only experimental API."-part in intrinsic::volatile_store it still expands and shows the message: "intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library".

I don't mind picking up this issue! I just have three questions:

  • Should the expanded intrinsics message be removed (about them unlikely to be ever stabilized)?
  • Would you like me to create a checklist? (Create a new issue for this, or somehow copy this in the original message again for easy discoverability when reading this issue?)
  • Where could I find the stable interfaces associated with each intrinsic?

@DevQps
Copy link
Contributor

DevQps commented Aug 8, 2019

@bstrie @QuietMisdreavus Could you maybe still respond to my previous message? Then hopefully I can take this up soon!

@bstrie
Copy link
Contributor Author

bstrie commented Aug 12, 2019

@DevQps Hello! For definitive answers to those questions I would direct you to ask the docs team, but I can hazard guesses:

  1. It's desirable that intrinsics mention that they aren't candidates for stabilization, so that people are absolutely clear about the stability/portability guarantees of the API.

  2. A checklist would be great, yes! If you manage to come up with a simple list of intrinsics that need documenting I can edit it into the original issue body.

  3. Finding the stabilized versions of each intrinsic is probably a matter of asking around; at least as of when this issue was filed part of the problem was that there wasn't such a document available. :P

@LeSeulArtichaut
Copy link
Contributor

LeSeulArtichaut commented Jan 30, 2020

I’ve started working on this, I will probably open a PR pretty soon

For the moment, I have documented the f32/f64 operations, the type_name and type_id functions, and some memory-related functions

@DevQps
Copy link
Contributor

DevQps commented Jan 30, 2020

Great to hear that!

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 2, 2020
…r=steveklabnik

Add documentation to compiler intrinsics

This adds documentation to the compiler intrinsics having stable standard implementations.

Relates to rust-lang#34338 (cc @bstrie)

r? @steveklabnik (for reassignment?)
@jonas-schievink jonas-schievink added A-intrinsics Area: intrinsics T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Mar 6, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Apr 30, 2020
document missing stable counterparts of intrinsics

Notes the stable counterpart of each intrinsic in case one exists.

Implements rust-lang#34338

r? @Dylan-DPC
@DevQps
Copy link
Contributor

DevQps commented Oct 24, 2020

@lcnr @LeSeulArtichaut Thank you both for your hard work! I think #71672 implements this issue and we can probably close this now I guess? Or am I missing something?

@steveklabnik I have been off for a a few months (more then I would have hoped for...) but I am finally back to do some work again :)

@Dylan-DPC
Copy link
Member

Closing this as it is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-intrinsics Area: intrinsics C-feature-request Category: A feature request, i.e: not implemented / a PR. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants