Skip to content

next-solver hang: infinite recursion during hidden type inference for TAIT + unconstrained region #151806

Description

@trait-Cong

I tried this code:(auto-reduced)

#![feature(type_alias_impl_trait)]
trait UnwrapItemsExt {
    type Iter;
}
trait MyTrait<'a> {}
impl<'a> MyTrait<'a> for <() as UnwrapItemsExt>::Iter {}
impl<'a, I> UnwrapItemsExt for I {
    type Iter = impl MyTrait<'a>;
    fn unwrap_items() -> Self::Iter {
    }
}
fn main(){}
Release channel Result
Current Stable error
Current Nightly (default solver) error
Current Nightly (+ -Znext-solver=globally) Hang

Meta

rustc --version --verbose:

rustc 1.95.0-nightly (e96bb7e44 2026-01-27)
binary: rustc
commit-hash: e96bb7e44fbcc23c1e6009e8d0ee8ab208668fb4
commit-date: 2026-01-27
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 21.1.8
Backtrace

error[E0407]: method `unwrap_items` is not a member of trait `UnwrapItemsExt`
  --> bug.rs:9:5
   |
 9 | /     fn unwrap_items() -> Self::Iter {
10 | |     }
   | |_____^ not a member of trait `UnwrapItemsExt`

error[E0658]: `impl Trait` in associated types is unstable
 --> bug.rs:8:17
  |
8 |     type Iter = impl MyTrait<'a>;
  |                 ^^^^^^^^^^^^^^^^
  |
  = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
  = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
  = note: this compiler was built on 2026-01-27; consider upgrading it if it is out of date

error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
 --> bug.rs:7:6
  |
7 | impl<'a, I> UnwrapItemsExt for I {
  |      ^^ unconstrained lifetime parameter

hang.

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 29, 2026
  2. changed the title [-]Hang: Infinite recursion during hidden type inference for TAIT[/-] [+]next-solver hang: infinite recursion during hidden type inference for TAIT[/+] on Jan 29, 2026
  3. added
    I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
    WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)
    on Jan 29, 2026
  4. changed the title [-]next-solver hang: infinite recursion during hidden type inference for TAIT[/-] [+]next-solver hang: infinite recursion during hidden type inference for TAIT + unconstrained infer var[/+] on Oct 8, 2026
  5. changed the title [-]next-solver hang: infinite recursion during hidden type inference for TAIT + unconstrained infer var[/-] [+]next-solver hang: infinite recursion during hidden type inference for TAIT + unconstrained region[/+] on Oct 8, 2026
  6. lcnr commented on Oct 8, 2026

    @lcnr
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]`I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions