I tried this code :
#![feature(type_alias_impl_trait)]
trait Base {}
impl Base for () {}
trait Link {}
type X
where
X: Link,
= impl Base;
impl<T> Link for X {}
fn main() {
let _: X = ();
}
I expected to see this happen: The compiler should report an error.
Instead, this happened: The compiler hangs indefinitely (infinite loop).
Meta
rustc --version --verbose:
rustc 1.91.0-nightly (f34ba774c 2025-08-03)
binary: rustc
commit-hash: f34ba774c78ea32b7c40598b8ad23e75cdac42a6
commit-date: 2025-08-03
host: x86_64-pc-windows-msvc
release: 1.91.0-nightly
LLVM version: 20.1.8
Backtrace
error[E0282]: type annotations needed
--> example2.rs:8:1
|
8 | type X
| ^^^^^^ cannot infer type for type parameter `T`
then the process hangs
I tried this code :
I expected to see this happen: The compiler should report an error.
Instead, this happened: The compiler hangs indefinitely (infinite loop).
Meta
rustc --version --verbose:Backtrace
then the process hangs