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 a disclaimer to the net::ip methods that are susceptible to change #60239

Open
little-dude opened this issue Apr 24, 2019 · 6 comments
Open
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@little-dude
Copy link
Contributor

This issue has come up in #60145
See in particular @the8472's comment.

The IP specifications are constantly changing as new RFCs get written and accepted, and the bits of the specification that are implemented in the standard library may need to be updated accordingly. That means that in the future, we may have to change the behavior of methods that are stable (I think that this is allowed by Rust's rules regarding stability as long as we don't modify the API, but someone more knowledgeable should confirm).

For this reason, it would be nice to add a disclaimer in the documentation of the methods which behavior is susceptible to change in the future, a little bit like the Platform Specific Behavior disclaimer in the doc of some IO methods.

cc @the8472

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Apr 24, 2019
@DevQps
Copy link
Contributor

DevQps commented May 4, 2019

@little-dude Would you like to do this yourself? Or would you like me to do it?

I am also wondering: What do you think is the most appropriate location on placing this disclaimer? Somewhere just above the "Organization" heading inside net::ip?

@little-dude
Copy link
Contributor Author

little-dude commented Nov 20, 2019

@GuillaumeGomez would it be possible to display a yellow box similar to the "This is a nightly-only experimental API" but with a custom message? I think that adding a entire "stability" heading for each method is a little heavy...

Something like this:

documentation sample example

@Mark-Simulacrum
Copy link
Member

I am against adding such a special feature to rustdoc; a stability heading makes sense here IMO - if it's too heavy to put it on each method, that may be avoidable by putting a general header at the type level and linking to it from the functions, but I would lean towards functions for the default.

@little-dude
Copy link
Contributor Author

Ok, I'm going to go with the heading then.

@GuillaumeGomez
Copy link
Member

You can provide a custom message to the unstable attribute like this:

#[unstable(feature = "unstable_test_feature", reason = "put your stuff here", issue = "0")]

little-dude added a commit to little-dude/rust that referenced this issue Jan 12, 2020
Feature tracking issue: rust-lang#27709

- Stabilize the following methods:
    - `IpAddr::is_global`
    - `IpAddr::is_documentation`
    - `Ipv4Addr::is_global`
    - `Ipv4addr::is_shared`
    - `Ipv4Addr::is_ietf_protocol_assignment`
    - `Ipv4addr::is_benchmarking`
    - `Ipv4Addr::is_reserved`
    - `Ipv6Addr::is_global`
    - `Ipv6Addr::is_unique_local`
    - `Ipv6Addr::is_unicast_link_local_strict`
    - `Ipv6Addr::is_unicast_link_local`
    - `Ipv6Addr::is_unicast_site_local`
    - `Ipv6Addr::is_documentation`
    - `Ipv6Addr::is_unicast_global`
    - `Ipv6Addr::multicast_scope`
- Stabilize the following enum: `Ipv6MulticastScope`
- Document IP helpers stability guarantees (fixes rust-lang#60239)
@steveklabnik
Copy link
Member

Triage: not 100% sure what all methods would need this here, it seems like the ones directly referenced aren't stabilized yet.

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 C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants