Closed
Description
I tried this code:
#![feature(trait_alias)]
#![feature(impl_trait_in_assoc_type)]
trait Foo {
type Bar: Baz<Self, Self>;
fn bar(&self) -> Self::Bar;
}
struct X;
impl Foo for X {
type Bar = impl Baz<Self, Self>;
fn bar(&self) -> Self::Bar {
|x| x
}
}
trait Baz<A: ?Sized, B: ?Sized> = Baz(&A) -> &B;
fn main() {}
It mutates from the following file, but the following code will not cause a hang.
#![feature(trait_alias)]
#![feature(impl_trait_in_assoc_type)]
trait Foo {
type Bar: Baz<Self, Self>;
fn bar(&self) -> Self::Bar;
}
struct X;
impl Foo for X {
type Bar = impl Baz<Self, Self>;
fn bar(&self) -> Self::Bar {
|x| x
}
}
trait Baz<A: ?Sized, B: ?Sized> = Fn(&A) -> &B;
fn main() {}
Also, I used impl_trait_in_assoc_type and Baz as search keywords but didn’t find any related issues with open.
Meta
rustc --version --verbose
:
rustc 1.85.0-nightly (acabb5248 2024-12-04)
binary: rustc
commit-hash: acabb5248231987ae1f0c215208d1005a5db402d
commit-date: 2024-12-04
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.5
Backtrace
<backtrace>
Metadata
Metadata
Assignees
Labels
Category: This is a bug.`#![feature(trait_alias)]`Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.