Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRelease channels take 2 #507
Conversation
brson
and others
added some commits
Oct 28, 2014
This comment has been minimized.
This comment has been minimized.
|
cc @wycats, this is a culmination in what feature-related work we were discussing at the work week. |
This comment has been minimized.
This comment has been minimized.
steveklabnik
reviewed
Dec 9, 2014
| Some additional restrictions are enforced by the compiler as a sanity | ||
| check that they are being used correctly. | ||
|
|
||
| * The `deprecated` attribute *must*` be paired with a `stable` |
This comment has been minimized.
This comment has been minimized.
tshepang
reviewed
Dec 9, 2014
| of unstable language features and libraries APIs while providing | ||
| strong stability guarantees in stable releases. | ||
|
|
||
| It also redesigns and simplifies stability attributes to beter |
This comment has been minimized.
This comment has been minimized.
tshepang
reviewed
Dec 9, 2014
| `since` parameter. | ||
|
|
||
| (Occassionally unstable APIs may be deprecated for the sake of easing | ||
| user transitions, in which case they recieve both the `stable` and |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
andrew-d
commented
Dec 9, 2014
|
Just thinking out loud: it would be interesting if we could use a Cargo feature to enable some potentially-unstable APIs in a crate. For example, a Cargo feature "use_experimental" to conditionally-compile in use of some unstable |
Valloric
reviewed
Dec 9, 2014
| which version each feature of the language and each feature of the | ||
| library was stabilized, and by detecting every feature used by a | ||
| crate, rustc can determine the minimum version required; and rustc may | ||
| assume that the crate will be compatible with future stable |
This comment has been minimized.
This comment has been minimized.
Valloric
Dec 9, 2014
This whole "rustc automatically determines the compatible version" idea is wishful thinking. There will be tons of subtle (and often unexpected) language/compiler/library changes that affect backwards compatibility across versions. This happens with every compiler/language/framework and while unfortunate, any expectations to the contrary are unrealistic.
Assuming that rustc can then automatically determine that any non-trivial library built and tested with rustc 1.5 will work just fine with rustc 1.3 because it only declares it's using features available from 1.3 onwards is again, wishful thinking. Such a library would have to be tested by the authors before one could confidently say it works with 1.3.
Any attempts at heuristically figuring out library & compiler/language compatibility will produce more harm than good. Someone will end up using a library that hasn't been tested with an older compiler/language/std version and if they're extremely lucky, the library will fail in obvious ways. If they're unlucky, it will behave only slightly differently than the author of the library intended.
A much better, simpler and more robust approach is to just enforce that a minimum language version is specified for a library. The KISS rule is a good idea here. Any attempts by a software system at "lets figure out what he user actually meant" almost always end in tears. Examples:
- The JavaScript equality table.
- "Error-correcting" parsers for HTML4.
- Perl.
This comment has been minimized.
This comment has been minimized.
nrc
Dec 11, 2014
Member
This all sounded good when we were discussing it in person, but now I see it written down, it does look rather complex.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
We do understand that this is not a rock-solid guarantee (what the minimum version of a crate is), but we also see the benefits of this detection to far outweigh the alternatives. One alternative (which it sounds like @Valloric is arguing for) is to simply do nothing, but this is strictly less useful than the system proposed here. If the compiler detects that 1.3 is required, then it must have at least 1.3, the failure mode is if a newer compiler is actually required. This is why a manual specification via Cargo.toml is allowed if necessary. We do not expect the majority of code to require a custom annotation in their Cargo.toml to request a particular nightly version.
Put another way, I personally doubt that adding this infrastructure will do more harm than good, and I also personally expect it to be quite a useful tool in upgrading rustc over time.
This comment has been minimized.
This comment has been minimized.
Valloric
Dec 19, 2014
I'm not suggesting to do nothing, I'm suggesting the simplest and sanest approach of just demanding that every library state what is the minimum version of rust it requires (I mentioned this in my previous post). Libraries already have to specify the version of a library dependency (AFAIK you can't say "I depend on libfoo" without specifying the version of libfoo) and for the same reasons they should also specify the version of the language they require.
Extend this idea of heuristics to library dependencies to see how absurd it is: libraries say they require libfoo and cargo waves a magic wand, applies some heuristics and pulls out a "compatible" version. It's obvious this won't work, and yet we want to do this for the language.
The language itself is a versioned dependency much like any other library. Why is it being treated differently?
nrc
assigned
brson
Dec 10, 2014
nrc
reviewed
Dec 11, 2014
| Stable builds are versioned and named the same as today's releases, | ||
| both with just a bare version number, e.g. '1.0.0'. They are | ||
| published at the beginning of each development cycle and once | ||
| published are never refreshed or overwritten. Provisions for stable |
This comment has been minimized.
This comment has been minimized.
nrc
Dec 11, 2014
Member
"never" seems very strong here - we should be able to patch if there is a critical security issue, for example
This comment has been minimized.
This comment has been minimized.
tshepang
Dec 12, 2014
Contributor
@nick29581 Rather the version be removed from crates.io than a different version be made to take the same name. In this case, the version with a critical security issue would be 1.0.1, and 1.0.0 would be unavailable so people don't use it.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
Yes this means that 1.0.0 will never change, not that we'll never release 1.0.1
nrc
reviewed
Dec 11, 2014
| unstable APIs for crates (read below for the impact of feature staging | ||
| on unstable APIs). | ||
| With staged features disabled, the Rust build itself is not possible, |
This comment has been minimized.
This comment has been minimized.
nrc
Dec 11, 2014
Member
What is the motivation here? Do we envisage building rustc with non-nightlies?
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
This is just a bootstrapping problem in the sense that if we build a compiler that rejects unstable features then it itself cannot build the compiler (rustc will always be using unstable features).
nrc
reviewed
Dec 11, 2014
| parameter `since`, whose value is equal to a *version of the | ||
| language* (where currently the language version is equal to the | ||
| compiler version), e.g. `#[stable(feature = "chicken_dinner", since | ||
| = "1.6")]`. |
This comment has been minimized.
This comment has been minimized.
nrc
Dec 11, 2014
Member
To clarify here, is the 'since' version tied to the feature or can different items with the same feature tag have different 'since' versions?
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
Features are accepted wholesale or broken up, so all stable attributes with the same feature name must have the same since attribute.
nrc
reviewed
Dec 11, 2014
| * The `deprecated` attribute *must*` be paired with a `stable` | ||
| attribute, enforcing that the progression of all features is from | ||
| 'unstable' to 'stable' to 'deprecated' and that the version in which | ||
| the feature was promoted to stable is recorded and maintained as |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
Yes, unstable features can be modified or deleted at any time (hence the unstable!)
nrc
reviewed
Dec 11, 2014
| it not possible in some cases to detect all features in use, which may | ||
| result in Cargo detecting a minumum version less than that required on | ||
| all platforms. For this and other reasons Cargo will allow the minimum | ||
| version to be specified manually. Second, rustc can not make any |
This comment has been minimized.
This comment has been minimized.
nrc
Dec 11, 2014
Member
How bad would it be to just always get the minimum version manually? The downside is that authors might be too conservative and just use the version they happen to use, rather than the minimum version.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
I suspect that having compiler assistance in doing so will be a great boon to authors as I highly doubt that we'll take great care to make sure all our libraries mention a version they're compatible with. Not only that but this helps automate the entire process and smooth out the publishing story rather than getting an error saying "you must specify a rustc version" when publishing.
nrc
reviewed
Dec 11, 2014
| language. | ||
|
|
||
| To calculate this information, Cargo will compile crates just before | ||
| publishing. In this process, the Rust compiler will record all used |
This comment has been minimized.
This comment has been minimized.
nrc
Dec 11, 2014
Member
We ought to be able to do better than compiling (although checking a crate compiles has other advantages). We could do a custom pass over the crate just checking for stability attributes and ignoring cfgs, thus solving the conditional compilation problem
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
We need to perform full resolution (e.g. method resolution) to determine all APIs used by a library, and this ends up amounting to basically a full compilation. It's a good smoke test regardless to compile before publishing!
Due to needing this analysis I don't think we can ignore cfg as if we enabled everything we'd probably get compilation errors due to multiple definitions of the same item in a library.
nrc
reviewed
Dec 11, 2014
| Each crate will have a "badge" indicating what version of the Rust | ||
| compiler is needed to compile it. The "badge" may indicate that the | ||
| nightly or beta channels must be used if the version required has not | ||
| yet been released (this happens when a crate is published on a |
This comment has been minimized.
This comment has been minimized.
nrc
Dec 11, 2014
Member
I think this is an over-simplification - a crate might rely on a feature which is gated for more than one version, so even though the minimum version is now on beta (say), the crate still needs nightly for access to the feature gated feature. This doesn't affect the UI, but means the implementation must track features not just versions for calculating the channel. (I guess the permanent nightly badge solves this, but if this is the only reason for having it, it seems overly restrictive).
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
Note that any crate which accesses features is a "permanent nightly" crate. Features change over time and there's no notion of stability or backwards compatibility with enabling a feature gate, so we cannot ever recommend a concrete version as none will known to be compatible.
alexcrichton
referenced this pull request
Dec 13, 2014
Closed
Proposal: Specify version of Rust platform, and lock for applications #1044
This comment has been minimized.
This comment has been minimized.
emk
commented
Dec 13, 2014
|
Thank you for looking into this! As a library author, I'm going to miss In fact, |
This comment has been minimized.
This comment has been minimized.
emk
commented
Dec 13, 2014
|
SemVer for Rust and As the maintainer of
I would love to be able apply SemVer rules to the "Rust platform" the same way I apply them to any other crate that I manage with Cargo. As for the idea of automatically detecting the appropriate compiler version to use with a given source tree, my reactions are:
To be fair, I can just modify |
huonw
reviewed
Dec 14, 2014
| merged, and like the 'nightly' channel each published build during a | ||
| single development cycle retains the same version number, but can be | ||
| uniquely identified by the commit number. Beta artifacts are likewise | ||
| simply named 'rust-beta'. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
brson
Dec 30, 2014
Author
Contributor
No. I intend beta and nightly artifacts to not include version numbers. It's mostly just so that old beta artifacts don't stick around forever - the beta artifacts are intended to be transient, unlike betas from a typical (non-channel-based) release process.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
brson
Dec 30, 2014
Author
Contributor
@huon I think maybe it will be better to have the version number in the beta artifacts. Makes it clearer what you are getting, but it does mean that 1.0.0-beta-*.tar.gz will get overwritten with updates during the release cycle. What do you prefer?
huonw
reviewed
Dec 14, 2014
| * The unused `#[frozen]` and `#[locked]` levels are removed. | ||
| * The `#[experimental]` level is removed in favor of simply | ||
| `#[unstable]`. | ||
| * Alter the syntax of the remaining `unstable`, `stable` and |
This comment has been minimized.
This comment has been minimized.
huonw
Dec 14, 2014
Member
What about stable things that aren't connected to any particular feature? (e.g. things that are stable now)
Also, what about unstable library that are just unstable because we want to iterate on the design (something along the lines of #[unstable(feature = "library design is hard")], but nicer, I guess?).
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
I would expect us to create a blanket "1.0" feature which represents the initial release and we'd just tag all stability attributes as being part of that category.
I also think that #[unstable] for "library design is hard" is fine because it legitimately is! We'd probably phrase it along the lines of "unsure whether this will be the final design" or something like that.
This comment has been minimized.
This comment has been minimized.
nodakai
commented
Dec 17, 2014
|
Which "channel" will you recommend to a newcomer? |
This comment has been minimized.
This comment has been minimized.
|
@nodakai stable |
quantheory
reviewed
Dec 18, 2014
| 1. The compiler will discover all `#![feature]` directives | ||
| enabled for the crate and calculate a list of all enabled features. | ||
| 2. While compiling, all unstable language features used will be | ||
| removed from this list. If a used feature is note enabled, then an |
This comment has been minimized.
This comment has been minimized.
quantheory
reviewed
Dec 18, 2014
| Cargo's own support for features (distinct from Rust features) to enable | ||
| this form of feature development in a first-class method through Cargo. | ||
| At this time, however, there are no concrete plans for this design and | ||
| it is unlikely to happen soon. |
This comment has been minimized.
This comment has been minimized.
quantheory
Dec 18, 2014
Contributor
This is rather cold comfort. The stability attributes:
- Are fairly simple/generic source code annotations.
- Have benefits that are widely applicable and hard to get by any other method (affecting rustdoc output in a pretty way, rustc warnings).
- Don't assume that a project's stabilization policies or processes remotely resemble those of the standard library.
- Don't assume that Cargo is being used for the build system/package manager in the first place.
So this is a useful thing that will be dropped, with a vague hope that something similar (but possibly less generic and more presumptuous) will be designed for Cargo in the hazy future. I'm wondering if it's really necessary to confine the stability attributes to the compiler and standard library (as opposed to adding this system in a way that doesn't affect the existing stability attributes, or at least unstable/stable/deprecated).
This comment has been minimized.
This comment has been minimized.
emk
Dec 18, 2014
Yes, the loss of #[unstable] for use by ordinary Rust libraries feels like the deliberate removal of a useful language feature. I don't recall any indications that #[unstable] was originally intended for use only by the standard library.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 18, 2014
Member
@quantheory it's not clear how the stability attributes can possibly interact with other libraries to us. The major purpose of this is to prevent access entirely to #[unstable] APIs, not to just warn-on-use. With this form of model, how would the compiler allow or disallow access to unstable APIs in arbitrary libraries? The compiler itself has very little knowledge of versioning, especially of libraries themselves, and almost all of the benefits of the stability attributes here are gained through libraries declaring semver-requirement dependencies on one another themselves.
To expand on the design for Cargo, I envision the ability to have unstable features in Cargo manifest (note I mean Cargo features, not stability-attribute features). Packages are then required to opt-in to these features, and packages published to crates.io will not have any experimental features. This is largely what I think external libraries would desired with respect to stability attributes because:
- Experimental features can be developed in the upstream source repository. Users of stable versions of a library do not have access to them.
- Applications can opt-in to using experimental features by depending on the repository.
- All features are tracked by name and there's a clear path to accepting features for libraries themselves (and a clear place to put the list of features).
@emk I'm curious on your thoughts of what I've said above. The stability attributes were never really tasked with being a general purpose mechanism for all libraries and would require significant redesign to work as-is. All of this infrastructure is very specific to the language version which does not apply to external libraries.
Also note that all libraries other than the standard library have a huge advantage which is that they are published through crates.io. Management of multiple versions of a library is super easy, as well as declaring dependencies.
All in all, we have personally been able to come up with a concrete use case where stability attributes provide guarantees for external libraries that Cargo does not already do so. With this in mind, we've architected the current iteration towards more favoring the compiler and language and planning for similar functionality through Cargo externally if necessary
This comment has been minimized.
This comment has been minimized.
quantheory
Dec 19, 2014
Contributor
The major purpose of this is to prevent access entirely to #[unstable] APIs, not to just warn-on-use. [... A]lmost all of the benefits of the stability attributes here are gained through libraries declaring semver-requirement dependencies on one another themselves.
Maybe a better way to put it is this: In my view, this is not extending the existing attributes. It's more like this proposal simply removes the existing attributes, and then reuses some of the names for a very different set of attributes that have only a little functionality in common with the old ones.
It would not be totally crazy, I think, for the old and new versions to coexist without having the same spelling. Of course, maybe it's not considered worthwhile to maintain the current attributes in this way, but I still would be happier if some way of annotating unstable/stable/deprecated remained for third-party libraries.
I envision the ability to have unstable features in Cargo manifest (note I mean Cargo features, not stability-attribute features).
I'm still a bit confused. For me, the point is that some projects may, for whatever reason, have a significant number of users developing against versions of their libraries with unstable features. Maybe the library is still on version 0.y.z, or maybe they just have popular nightly/alpha/beta builds. In this case, you want to (a) communicate which features are still considered unstable in documentation, and (b) give users an way to automatically check which unstable features they are using. This may even apply to developers preparing releases, who want to be sure that they haven't accidentally left in unstable features that they thought were already rejected and removed.
For stable versions, there are similar issues for items in the API that are deprecated (as you mention in the RFC already).
For these uses, I think it's best to be able to annotate the source code directly (especially because that's also where the rustdoc documentation is). Listing unstable features in the Cargo manifest is useful, but I think that it solves a different set of problems. (Unless I'm still totally misunderstanding your suggestion.)
[P]ackages published to crates.io will not have any experimental features.
Note that this means that package versions that have to have a mix of newly-stable and unstable features (e.g. 0.y.z packages trying to get early adopters to try things out) really have to live mostly outside the crates.io ecosystem, which means that they may not have so much of an advantage over the standard library.
This comment has been minimized.
This comment has been minimized.
alexcrichton
Dec 21, 2014
Member
For these uses, I think it's best to be able to annotate the source code directly (especially because that's also where the rustdoc documentation is). Listing unstable features in the Cargo manifest is useful, but I think that it solves a different set of problems. (Unless I'm still totally misunderstanding your suggestion.)
Concretely speaking, I'm thinking of:
# Cargo.toml
[features.new-api]
experimental = "true"// src/lib.rs
#[cfg(feature = "new-api")]
pub fn my_new_api() { /* ... */ }In this case you still annotate features in source code (via cfg attributes), and then the manifest allows Cargo to know what to compile and what's available for dependencies.
Note that this means that package versions that have to have a mix of newly-stable and unstable features (e.g. 0.y.z packages trying to get early adopters to try things out) really have to live mostly outside the crates.io ecosystem, which means that they may not have so much of an advantage over the standard library.
This largely seems ok to me as it's precisely the design of the standard library in a sense. Having to go out of your way a bit to get access to experimental features which can break rapidly seems not the end of the world to me!
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
emk
commented
Dec 19, 2014
|
@alexcrichton Thank you for your response! My apologies for being so stubborn about this issue, too.
I agree that a hard error My proposal is to have two versions of
Here's a use-case for for something like #[deriving(Show, Default)]
pub struct Hints<'a> {
/// A value from an HTTP Content-Language header. The value "fr,en"
/// will bias the decoder towards French and English.
pub content_language: Option<&'a str>,
/// The top-level domain associated with this text. The value "fr"
/// will bias the decoder towards French.
pub tld: Option<&'a str>,
/// The original encoding of the text, before it was converted to
/// UTF-8. See `Encoding` for legal values.
#[experimental]
pub encoding: Option<Encoding>,
/// An extra language hint.
pub language: Option<Lang>
}Here, I've finalized 3 out of 4 fields in a struct, but the Basically, I feel that Needless to say, everything I argue here goes equally for Anyway, thank you for patiently listening to this long argument in favor of library-level |
This comment has been minimized.
This comment has been minimized.
|
Thanks for your clear articulation of what you'd like to see as a library author. I definitely see where you're coming from -- I am very sympathetic to wanting stability attributes in the Cargo ecosystem. It's a feature we definitely want to provide at some point. But we don't necessarily want to just keep the old stability system alongside the release channel system for Rust -- that would give two very different meanings to stability attributes. We also want to gain some experience using release channels for Rust itself before moving forward with something for the libraries. In short, I think we're likely to provide these facilities for external libraries in some form in the future, but we want to take our time to get the design right. In the interim, once plugins are stabilized it should be possible to build something like our existing stability system externally. I hope you can understand where we're coming from here -- as with so many feature requests, we'd really like to offer it, but we need time before we can commit to a design, and there is a lot of other stuff in flight right now. |
This comment has been minimized.
This comment has been minimized.
emk
commented
Dec 19, 2014
|
Thank you for your kind response, @aturon! I'll try to figure out the design disconnect one last time, offer to prepare a PR, and then drop this issue. :-)
I think this is where the disconnect is happening. The
As a library author, I need:
I don't need fine-grained control over multiple unstable features, or release channels, or anything else like that. A really simple system with nothing but Now, given the realities of getting 1.0 out the door, I understand that it might be necessary to remove the simple versions of Anyway, I'd be happy to contribute code, if that's the primary thing needed. But if there's no consensus in favor of an ultra-simple Anyway, thank you to everybody for listening to this plea. And I'll leave this alone from here on, unless somebody asks for a PR or something. :-) |
brson
added some commits
Dec 30, 2014
This comment has been minimized.
This comment has been minimized.
|
I've pushed a new revision that does a few minor things:
|
This comment has been minimized.
This comment has been minimized.
Valloric
commented
Dec 31, 2014
I appreciate the recent changes made here, but the proposed system still seems like lots of unnecessary complexity that will end up shooting users in the foot. I've asked this before without receiving an answer, so I must ask again: the language itself is a versioned dependency much like any other library, so why is it being treated differently? Why aren't we asking the user to always explicitly state which version of the language their library requires? There should be no "shoot yourself in the foot" option where cargo guesses for you. I'm fine with cargo verifying that the version you stated as a minimum actually works (if you say stable but are using feature directives, cargo should complain) and even cargo recommending a version based on its analysis (while stating that the recommendation is a best-effort guess and shouldn't be taken as gospel), but it really should always be leaving the final decision to you. This is the simplest approach and the one that's least likely to lead to nasty surprises. |
This comment has been minimized.
This comment has been minimized.
The approach I had in mind wasn't that Cargo says "this will definitely work on Rust 1.3", but rather "this will definitely not work before Rust 1.3". The idea is that if people leave out the version number, at least we can give a useful error message to people using the library on versions of Rust we know for sure won't work. |
This comment has been minimized.
This comment has been minimized.
Valloric
commented
Dec 31, 2014
|
@wycats Thank you for the explanation. That's a lot more reasonable.
What I'm saying is don't make that an option. You must state the language version number when you upload a library to crates.io. No confusion possible. If you leave out the version number, cargo complains saying you must, and tells you it has detected a certain minimum version based on what you used in the code. Say, it detects 1.2.1 as a min version. You on the other hand know that that version has a bug in a std library that affects your code, and you pick 1.2.2 as the min language version. If you pick 1.2.0, cargo complains that the version you picked can't compile your code (based on its analysis; it should even tell you why). |
This comment has been minimized.
This comment has been minimized.
We could do this, but I'm not sure how this would be an improvement. Most of the time, people would just blindly copy in what Cargo tells you to use, so why not just have us insert it automatically? |
This comment has been minimized.
This comment has been minimized.
Valloric
commented
Dec 31, 2014
Because it forces you to think about it. By doing it automatically, you're teaching people to blindly trust the version cargo spits out. By not doing it automatically, you make it explicit that cargo is making an (educated) guess. If you're aiming for your library to be compatible with 1.1, but cargo tells you it detects 1.2 as a minimum, you know you messed something up and you know it before publishing the library. |
This comment has been minimized.
This comment has been minimized.
reem
commented
Jan 1, 2015
|
I agree completely with @emk and would be very sad if the complicated and very niche needs of the standard library for versioning ruined the system for the rest of us. The std library should just use another set of attributes which could optionally be exposed to library authors and there should remain a simple set of attributes for setting stability of library APIs. |
This comment has been minimized.
This comment has been minimized.
|
@reem To be clear, everybody wants the stability attribute system to be useable in the crates.io ecosystem. The problem is that the current system has an extremely coarse-grained "opt in" where you have to accept unstable APIs from any sources, rather than saying only that certain unstable APIs are OK with you. We'd like to change this before committing to the design. I'm curious whether you agree that this is a problem with the design. It may be that using a feature naming system in crates.io is the right way to go; or maybe an item-based opt-in. It's not clear yet. But we plan to look into this ASAP. Also, we discussed the possibility of letting the attributes be used but not yet linting against them, which would at least retain a way to signal stability without committing to the blanket opt-in. |
This comment has been minimized.
This comment has been minimized.
|
This RFC has had some pushback against removing the stability attributes for this RFC, but I believe that @brson has addressed many of these concerns by renaming the attributes to their less appealing counterparts (prefixed with Additionally, @Valloric has pointed out that the "Cargo version detection" mechanisms may be too ambitious, but with @wycats's clarification and @brson's update the wording around this has been toned down significantly. As @wycats points out, the precise implementation in Cargo can develop over time. As a result, we've decided to merge this RFC as-is. Thanks again for the discussion everyone! |
alexcrichton
referenced this pull request
Jan 2, 2015
Closed
Implement stability attribute overhaul #20445
This comment has been minimized.
This comment has been minimized.
|
Tracking issue: rust-lang/rust#20445 |
alexcrichton
merged commit ecb78f3
into
rust-lang:master
Jan 2, 2015
This comment has been minimized.
This comment has been minimized.
l0kod
commented
Jan 3, 2015
|
Maybe out of scope but rust-lang/rust#18815 should be considered too. |
SimonSapin
referenced this pull request
Jan 4, 2015
Closed
Implement `std::ascii::AsciiExt` and `std::ascii::OwnedAsciiExt` for `Ascii` #3
This comment has been minimized.
This comment has been minimized.
|
Though this was merged while I was on vacation, I spilled a lot of words before that and want to point out a couple of final things:
|
daira
reviewed
Jan 19, 2015
| of `#[staged_unstable(feature = "foo")]` APIs unless the current crate | ||
| declares `#![feature(foo)]`. This enables crates to declare what API | ||
| features of the standard library they rely on without opting in to all | ||
| unstable API features. |
This comment has been minimized.
This comment has been minimized.
daira
Jan 19, 2015
I like this a lot, I think I'll use it in my own language, Noether (not necessarily tied to the "train" release model).
daira
reviewed
Jan 19, 2015
| well recording the version in which the deprecation was performed with | ||
| the `since` parameter. | ||
|
|
||
| (Occassionally unstable APIs may be deprecated for the sake of easing |
This comment has been minimized.
This comment has been minimized.
daira
reviewed
Jan 19, 2015
| will generate an error in this case unconditionally. | ||
|
|
||
| These steps ensure that the `#[feature]` attribute is used exhaustively | ||
| and will check unstable language and library features. |
This comment has been minimized.
This comment has been minimized.
daira
Jan 19, 2015
I may be reading this wrong, but doesn't it mean that when a feature becomes stable, code that used it will have to be changed to remove the #[feature] attribute? What's the motivation for that?
brson commentedDec 8, 2014
This RFC describes changes to the Rust release process, primarily the division of Rust's time-based releases into 'release channels', following the 'release train' model used by e.g. Firefox and Chrome; as well as 'feature staging', which enables the continued development of experimental language features and libraries APIs while providing strong stability guarantees in stable releases.
This revision includes a significant simplification by merging stability attributes with feature gates, which further enables some additional useful features within Cargo related to version detection. One big implication of this change is that stability attributes are no longer suitable for use outside of std (if such a feature is desirable it is intended to be solved by Cargo).