-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking Issue for the 2024 prelude #121042
Comments
@rust-lang/project-edition-2024 not sure how and where you want to track this in addition to the issue, but I created the issue to have something to link to. |
Thanks @Nilstrieb. We are doing our tracking in https://hackmd.io/@klAMrLz3QN-4luTZek9cWA/H175lzyea, and I have added that to the list. Do you know what migration concerns there are with this change? What breakage will it cause, and what is the plan to add a migration lint for that? |
When |
Basically the breaking is that the following two programs will now error with a method ambiguity error: trait Uwu {
fn poll(&self) {
println!("uwu");
}
}
impl<T> Uwu for T {}
fn main() {
core::pin::pin!(async {}).poll();
} trait Uwu {
fn into_future(self) where Self: Sized {
println!("uwu");
}
}
impl<T> Uwu for T {}
fn main() {
async {}.into_future();
} |
|
Ah, I was searching for quite a bit but didn't find it. Then it should be pretty easy to extend the lint pass to also lint for a rust_2024_prelude_collisions. |
We talked through the edition items in the lang call today, and one thing on the list was "Removing Rustc*codable from the prelude" (cc @jhpratt). Let's perhaps track that here also. |
I have not gotten to implement the lint yet, but I expect it to be quite simple. If anyone wants to implement, feel free to |
I intend on getting to it at some point. I'll claim whenever I start concrete work on it. Until that point, anyone should feel free to do it themself. |
I am beginning work on the lint for |
I finally got around to implementing the migration lint for future in #125889. |
As I just said on Zulip, I don't have a ton of time in the near future. If someone else would like to take over my side of the edition lint, please do so! |
… r=compiler-errors Add migration lint for 2024 prelude additions This adds the migration lint for the newly ambiguous methods `poll` and `into_future`. When these methods are used on types implementing the respective traits, it will be ambiguous in the future, which can lead to hard errors or behavior changes depending on the exact circumstances. tracked by rust-lang#121042 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> r? compiler-errors as the method prober
Rollup merge of rust-lang#125889 - Nilstrieb:migrate-into-the-future, r=compiler-errors Add migration lint for 2024 prelude additions This adds the migration lint for the newly ambiguous methods `poll` and `into_future`. When these methods are used on types implementing the respective traits, it will be ambiguous in the future, which can lead to hard errors or behavior changes depending on the exact circumstances. tracked by rust-lang#121042 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> r? compiler-errors as the method prober
@rustbot labels +S-tracking-ready-for-edition Upon review, with recent work having been merged, this item is now ready for Rust 2024. Thanks to @Noratrieb and @jhpratt for pushing this work forward, thanks to @ehuss for documentation, and thanks to the various reviewers who helped to get this work landed. |
Feature gate:
#![feature(prelude_2024)]
This is a tracking issue for the 2024 prelude.
Public API
The 2024 prelude contains the following items in addition to all items in the 2024 prelude:
core::future::{Future, IntoFuture}
: RFC 3509 RFC: IncludeFuture
andIntoFuture
in the 2024 prelude rfcs#3509And removes
RustcEncodable
, andRustcDecodable
:Encodable
,Decodable
,RustcEncodable
andRustcDecodable
are stable #62048Steps
Future
,IntoFuture
).Future
andIntoFuture
to the 2024 prelude #121041RustcEncodeable
,RustcDecodable
).RustcEncodable
&RustcDecodable
, remove from prelude in next edition #116016Related
rustc-serialize
with#![allow(soft_unstable)]
#123156Implementation History
RustcEncodable
&RustcDecodable
, remove from prelude in next edition #116016Future
andIntoFuture
to the 2024 prelude #121041Unresolved Questions
cc @jhpratt @Nilstrieb @yoshuawuyts
The text was updated successfully, but these errors were encountered: