-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustc has a stack overflow when using impl Trait
of a trait with a generic parameter with a default type of Self
#49376
Comments
I guess this should be erroring with E0393 or E0666 (nested impl trait is not allowed). |
Continues crashing in 1.26 stable. |
impl Trait
impl Trait
of a trait with a generic parameter with a default type of Self
This does not crash: struct Bar {}
trait Foo<T = i32> {}
impl Foo for Bar {}
fn foo() -> impl Foo {
Bar {}
}
fn main() {} |
Particularly unfortunate because of
I was thinking that this shouldn't be allowed because it's like nested impl Trait, but I can take this myself but someone looking for mentorship or who is just faster is welcome. |
A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta. There was a check for this which wasn't catching all cases, it was made more robust. Fixes rust-lang#49376 Fixes rust-lang#50626 r? @petrochenkov
…r=petrochenkov Fix self referential impl Trait substitutions A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta. There was a check for this which wasn't catching all cases, it was made more robust. Fixes #49376 Fixes #50626 r? @petrochenkov
A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta. There was a check for this which wasn't catching all cases, it was made more robust. Fixes rust-lang#49376 Fixes rust-lang#50626 r? @petrochenkov
A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta. There was a check for this which wasn't catching all cases, it was made more robust. Fixes rust-lang#49376 Fixes rust-lang#50626 r? @petrochenkov
A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta. There was a check for this which wasn't catching all cases, it was made more robust. Fixes rust-lang#49376 Fixes rust-lang#50626 r? @petrochenkov
https://play.rust-lang.org/?gist=a827cb4bc9dd29324227e3ac676dd47a&version=nightly
The text was updated successfully, but these errors were encountered: