// Regression test for #132882. use std::ops::Add; pub trait Numoid: Sized where &'missing Self: Add, //~^ ERROR use of undeclared lifetime name `'missing` { } // Proving `N: Numoid`'s well-formedness causes us to have to prove `&'missing N: Add`. // Since `'missing` is a region error, that will lead to us consider the predicate to hold, // since it references errors. Since the freshener turns error regions into fresh regions, // this means that subsequent lookups of `&'?0 N: Add` will also hit this cache entry // even if candidate assembly can't assemble anything for `&'?0 N: Add` anyways. This // led to an ICE. pub fn compute(a: N) { let _ = &a + a; //~^ ERROR cannot add `N` to `&N` } fn main() {}