2024-08-11 11:28:15 -05:00
|
|
|
//@ revisions: current next
|
|
|
|
//@ ignore-compare-mode-next-solver (explicit revisions)
|
|
|
|
//@[next] compile-flags: -Znext-solver
|
2024-07-04 10:53:37 -05:00
|
|
|
//@ check-fail
|
|
|
|
//
|
|
|
|
// Make sure we can't trick the compiler by using a projection.
|
|
|
|
|
|
|
|
trait Cat<'a> {}
|
|
|
|
impl Cat<'_> for () {}
|
|
|
|
|
|
|
|
trait Id {
|
|
|
|
type Id: ?Sized;
|
|
|
|
}
|
|
|
|
impl<T: ?Sized> Id for T {
|
|
|
|
type Id = T;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S<T: ?Sized> {
|
|
|
|
tail: <T as Id>::Id,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn m<'a>() {
|
|
|
|
let unsend: *const dyn Cat<'a> = &();
|
|
|
|
let _send = unsend as *const S<dyn Cat<'static>>;
|
|
|
|
//~^ error: lifetime may not live long enough
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
m();
|
|
|
|
}
|