-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Existential type captures lifetime that doesn't appear in bounds even though it does appear #57188
Labels
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
A-trait-system
Area: Trait system
F-type_alias_impl_trait
`#[feature(type_alias_impl_trait)]`
requires-nightly
This issue requires a nightly compiler in some way.
Comments
Centril
added
A-trait-system
Area: Trait system
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
labels
Dec 29, 2018
cc @alexreg |
As a workaround, moving the existential type out and referencing it directly in the return type compiles fine: #![feature(existential_type)]
struct Baz<'a> {
source: &'a str,
}
trait Foo<'a> {
type T: Iterator<Item = Baz<'a>> + 'a;
fn foo(source: &'a str) -> Self::T;
}
existential type BarFooT<'a>: Iterator<Item = Baz<'a>> + 'a;
struct Bar;
impl<'a> Foo<'a> for Bar {
type T = BarFooT<'a>;
fn foo(source: &'a str) -> BarFooT<'a> { // Note: *not* Self::T
std::iter::once(Baz { source })
}
} |
@alexreg What is the current status of that work? Do you have a link to that? |
Centril
added
F-type_alias_impl_trait
`#[feature(type_alias_impl_trait)]`
requires-nightly
This issue requires a nightly compiler in some way.
labels
Jul 28, 2019
RalfJung
added a commit
to RalfJung/rust
that referenced
this issue
Jun 11, 2020
…=nikomatsakis Clean up type alias impl trait implementation - Removes special case for top-level impl trait - Removes associated opaque types - Forbid lifetime elision in let position impl trait. This is consistent with the behavior for inferred types. - Handle lifetimes in type alias impl trait more uniformly with other parameters cc rust-lang#69323 cc rust-lang#63063 Closes rust-lang#57188 Closes rust-lang#62988 Closes rust-lang#69136
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Jun 23, 2020
…ikomatsakis Clean up type alias impl trait implementation - Removes special case for top-level impl trait - Removes associated opaque types - Forbid lifetime elision in let position impl trait. This is consistent with the behavior for inferred types. - Handle lifetimes in type alias impl trait more uniformly with other parameters cc rust-lang#69323 cc rust-lang#63063 Closes rust-lang#57188 Closes rust-lang#62988 Closes rust-lang#69136 Closes rust-lang#73061
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
A-trait-system
Area: Trait system
F-type_alias_impl_trait
`#[feature(type_alias_impl_trait)]`
requires-nightly
This issue requires a nightly compiler in some way.
(Playground)
Errors:
May be related to #42940, but I'm not entirely sure.
The text was updated successfully, but these errors were encountered: