Stall from overflow caused by for<'a> F: FnOnce(Self::Gat<'a>) · Issue #87758 · rust-lang/rust (original) (raw)

I tried this code:

#![feature(generic_associated_types)]

pub struct Structure { f: F, }

pub trait Trait { type Gat<'a>; }

impl Trait for Structure where for<'a> F: FnOnce(Self::Gat<'a>), { type Gat<'a> = String; }

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=fbd726c1f1bd90e514358a91016581ec

Given that
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f889ed7bfeffb6a6f3179bf6d94f438c
causes an overflow evaluating the requirement Structure<F>: Trait I would expect the problem code to give a similar message.

Instead, rustc stalls indefinitely.

Meta

rustc --version --verbose:

rustc 1.56.0-nightly (a6ece5615 2021-08-03)

Backtrace

No backtrace produced due to stall.