-
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 RFC 2515, "Permit impl Trait in type aliases" #63063
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…varkor Update `impl Trait` gate issues cc rust-lang#63065 cc rust-lang#63063 r? @varkor cc @alexreg
This comment has been minimized.
This comment has been minimized.
Change opaque type syntax from `existential type` to type alias `impl Trait` This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature. The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC. This makes partial progress towards implementing #63063. r? @Centril
This comment has been minimized.
This comment has been minimized.
In #63092, landed on 2019-07-28, written by @Centril and reviewed by @varkor, the tracking issue for In #63096, landed on 2019-07-29, written by @Centril and reviewed by @varkor, 3 ICEs were closed with reproducer tests added. In #63158, landed on 2019-07-31, written by @JohnTitor and reviewed by @Centril, 1 ICE was closed with a reproducer test added. In #63180, landed on 2019-08-03, written by @varkor and reviewed by @Centril, the syntax was changed to In rust-lang/rustc-dev-guide#402, landed on 2019-08-29, written by @varkor and reviewed by @mark-i-m, @Arnavion, and @spastorino, the rustc guide description was updated. |
This would be better with rust-lang/rust#63063
FYI for now I make use of As such, to summarise, a lot of ergonomic problems. In contrast, while syncing back with the The feature and RFC tracked in this issue works beautifully. It has none of the ergonomic pitfalls, requires no breaking changes in existing future code, in general plays very nice with Rust and the way it handles async code through futures. It just works. And thus dynamic dispatch is also possible, given we work with non async fn code here. I discover this nightly feature late, but I feel that this feature (impl Trait as associated types in traits) should have been the feature being stabilised in the async story over others. As it really plays well with existing code and just works. Love it. To the future and beyond! |
Adding to @GlenDC's point - given that we already have AFIT, at the end of the day, AFIT anyway desugars to some form of |
How far is this feature from stabilization? I'd love to see I'm asking because I don't see any major blockers in the task list, and want to ping so people don't forget about this feature :) |
For people wondering, I asked on Zulip, and I was was told there are quite a few design blockers to be done. So no, it's not yet ready. Related issues: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AF-type_alias_impl_trait++label%3AT-lang |
Thanks for the updates. And honestly no rush, it takes as long as you need. I can wait. That said, take your time, thanks for everything and take care. |
Edit: I moved this question to the internals forum: |
That's not true, (Discussing this in detail is off-topic here, I just felt it was important to point out this (common) misconception. :) Zulip or https://users.rust-lang.org/ would be a better place to discuss this.) |
Ok, I removed that part. |
$ cargo build Downloaded as5600 v0.6.0 Downloaded 1 crate (14.1 KB) in 0.85s Compiling autocfg v1.1.0 Compiling num-derive v0.4.2 Compiling nb v0.1.3 Compiling embedded-hal v0.2.7 Compiling num-traits v0.2.18 Compiling as5600 v0.6.0 Compiling embassy-avr-as5600-encoder v0.1.0 (/home/rvalls/dev/personal/embassy-avr-as5600-encoder) error[E0658]: `impl Trait` in associated types is unstable --> src/main.rs:8:1 | 8 | #[embassy_executor::main] | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #63063 <rust-lang/rust#63063> for more information = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable = note: this compiler was built on 2024-03-23; consider upgrading it if it is out of date = note: this error originates in the attribute macro `::embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info) For more information about this error, try `rustc --explain E0658`. error: could not compile `embassy-avr-as5600-encoder` (bin "embassy-avr-as5600-encoder") due to 1 previous error
The move from unstable dependencies pulled directly from Github to the crates.io version required several changes: - Update of other dependencies to match the expectations of the crates .io versions. - Use `impl_trait_in_assoc_type` instead of `type_alias_impl_trait` feature. See rust-lang/rust#63063 - Remove unstable features of dependencies.
The move from unstable dependencies pulled directly from Github to the crates.io version required several changes: - Update of other dependencies to match the expectations of the crates .io versions. - Use `impl_trait_in_assoc_type` instead of `type_alias_impl_trait` feature. See rust-lang/rust#63063 - Remove unstable features of dependencies.
This is a tracking issue for the RFC "Permit impl Trait in type aliases" (rust-lang/rfcs#2515) which is implemented under the following
#![feature(..)]
gates:type_alias_impl_trait
impl_trait_in_assoc_type
: Split out a separate feature gate for impl trait in associated types #110237About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Unresolved questions
Exactly what should count as "defining uses" for opaque types?
can we come up with consistent rules when cross-usage type inference can happen?
Default::default()
to produce a value of. We combine all return sites though and compute a shared type across them, so we'll figure out aVec<&'static str>
impl Foo
can be used for associated types that expect a type that implementsBar
, even ifFoo
andBar
are entirely unrelated. The hidden type must satisfy both. See https://github.com/rust-lang/rust/pull/99860/files for examples.impl traits in consts through const fns are allowed but shouldn't be: impl traits in consts through const fns are allowed but shouldn't #87277
The text was updated successfully, but these errors were encountered: