Files
rust/tests/ui/impl-trait/member-constraints/incomplete-constraint.rs
lcnr ac862c0ffb fix typos
Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
2025-08-08 13:49:27 +02:00

22 lines
746 B
Rust

//@ check-pass
// FIXME(-Znext-solver): enable this test
// These functions currently do not normalize the opaque type but will do
// so in the future. At this point we've got a new use of the opaque with fully
// universal arguments but for which lifetimes in the hidden type are unconstrained.
//
// Applying the member constraints would then incompletely infer `'unconstrained` to `'static`.
fn new_defining_use<F: FnOnce(T) -> R, T, R>(_: F) {}
fn rpit1<'a, 'b: 'b>(x: &'b ()) -> impl Sized + use<'a, 'b> {
new_defining_use(rpit1::<'a, 'b>);
x
}
struct Inv<'a, 'b>(*mut (&'a (), &'b ()));
fn rpit2<'a>(_: ()) -> impl Sized + use<'a> {
new_defining_use(rpit2::<'a>);
Inv::<'a, 'static>(std::ptr::null_mut())
}
fn main() {}