1
Fork 0
This commit is contained in:
lcnr 2022-02-07 16:35:28 +01:00
parent c965d0eaf2
commit af9e30a326

View file

@ -1,7 +1,5 @@
// A test exploiting the bug behind #25860 except with // A test exploiting the bug behind #25860 except with
// implied trait bounds which currently don't exist, // implied trait bounds which currently don't exist without `-Zchalk`.
//
// please ping @lcnr if your changes end up causing `badboi` to compile.
use std::marker::PhantomData; use std::marker::PhantomData;
struct Foo<'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>) struct Foo<'a, 'b, T>(PhantomData<(&'a (), &'b (), T)>)
where where
@ -26,6 +24,8 @@ impl<'long: 'short, 'short, T> Convert<'long, 'short> for T {
// `T: Convert<'in_, 'out>` is not implemented // `T: Convert<'in_, 'out>` is not implemented
// //
// help: needed by `Foo<'in_, 'out, T>` // help: needed by `Foo<'in_, 'out, T>`
//
// Please ping @lcnr if your changes end up causing `badboi` to compile.
fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ T) -> &'out T { fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ T) -> &'out T {
//~^ ERROR lifetime mismatch //~^ ERROR lifetime mismatch
sadness.cast() sadness.cast()