![]() I’m not saying this to preserve some special shiny parts of the language I made / liked much of that was either gone or set in stone by 1.0 anyways. I know (and very much respect) that you’re making strong promises in terms of forever-supporting older editions, and “nobody has to use the new stuff”, but I still think there’s value to the great majority of people who will see code out of context without tracking editions in their heads, to keeping the inter-edition delta as small as possible, slowing velocity to changes that are really necessary, keeping the language as close to a single dialect as possible. The other bits … I dunno, seem like many are cases of “it worked before”. Impl Trait, SIMD and slice patterns seem worthwhile (the latter two have been on the books forever). It pains me to say, but like many still casually watching / not directly participating, I too feel like things are continuing to churn in the language a bit … beyond reason. Similarly in the “Lifetime elision in impl” page: // we can refer to 'arg, rather than conflicting with 'a Which is it? In other words, is this valid? fn two_args(foo: &Foo, bar: &'somethingelse Bar) -> &'somethingelse Baz The example suggests that the lifetime is named after the value-parameter, but the prose suggests it is not. In other words, you can drop the explicit lifetime parameter declaration, and instead simply start using a new lifetime name to connect lifetimes together. ![]() In Rust 2018, you'd write: fn two_args(foo: &Foo, bar: &'bar Bar) -> &'bar Baz Is for example extern crate proc_macro also not needed anymore, and use proc_macro::TokenStream sufficient for that crate to be linked? If I remember correctly, -extern is not used for crates that are in the sysroot. If you're not using Cargo, you already had to pass -extern flags to give rustc the location of external crates, so you'd just keep doing what you were doing there as well. Now, to add a new crate to your project, you can add it to your Cargo.toml, and then there is no step two. You no longer need to write extern crate to import a crate into your project. Other features, which are “only” considered part of Rust 2018 because they affect idioms and are somewhat recent, but are in fact available to 2015-edition-crates, assuming a recent enough compiler.Features that actually require the edition = "2018" opt-in in Cargo.toml, for example because they involve a breaking change such a keyword that was previously a valid identifier.In the guide, I think the Feature Status page is missing a separation between: Elision of lifetime relationships in struct definitionsĮxpect to see follow-up announcements when these features are ready for alpha testing.Unfortunately, this preview release doesn’t include a few features planned for Rust 2018. ![]() A dedicated channel for discussion has been created on IRC ( ), #rust-edition. If you have feedback about the edition in general, please open a thread on with the category set to Edition 2018 Feedback. The guide also contains a list of features currently part of the preview, with links to their tracking issues where you can leave feedback. There are directions for migrating crates to the edition. ![]() We expect this experience to improve over time. Some code will fail to migrate via rustfix today - in particular, rustfix generally does not work well with macro-generated code. The current Edition Preview is at alpha quality: it’s quite rough around the edges, but sufficiently feature-complete to get a feel for coding in the new edition. Of course, we’re also keen to hear about your experience with newly stabilized features, including impl Trait, dyn Trait, slice patterns, and more. While some major features intended for Rust 2018 have already stabilized, there are a number of remaining features that we’re particularly eager for feedback on: If you’re already on the nightly channel, it’s likely that there’s no need to update the compiler.Īs part of this preview, we have produced a first draft of the Edition Guide, which walks through the mechanics of editions, how to migrate your code, and all of the new features planned for Rust 2018. To get nightly, run rustup install nightly. The preview presents a great opportunity for those of you using the stable channel to switch to nightly and try out how it feels to code in the new edition, both to help us fix bugs and to provide feedback – positive and negative – on features. Today we have reached an important milestone: we are announcing that we have an alpha-quality preview of the 2018 edition ready for testing and feedback. The Rust teams having been working hard to implement features of the 2018 edition.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |