2025-05-12 14:22:48 +00:00
|
|
|
// Test that we don't ICE when computing the drop types for
|
|
|
|
|
|
2025-03-24 07:09:18 +00:00
|
|
|
//@ ignore-compare-mode-polonius (explicit revisions)
|
|
|
|
|
//@ revisions: nll polonius
|
|
|
|
|
//@ [polonius] compile-flags: -Zpolonius=next
|
|
|
|
|
|
2025-05-12 14:22:48 +00:00
|
|
|
trait Decode<'a> {
|
|
|
|
|
type Decoder;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
trait NonImplementedTrait {
|
|
|
|
|
type Assoc;
|
|
|
|
|
}
|
|
|
|
|
struct NonImplementedStruct;
|
|
|
|
|
|
|
|
|
|
pub struct ADecoder<'a> {
|
|
|
|
|
b: <B as Decode<'a>>::Decoder,
|
|
|
|
|
}
|
|
|
|
|
fn make_a_decoder<'a>() -> ADecoder<'a> {
|
|
|
|
|
//~^ ERROR the trait bound
|
2025-03-24 07:09:18 +00:00
|
|
|
//[nll]~| ERROR the trait bound
|
2025-05-12 14:22:48 +00:00
|
|
|
panic!()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct B;
|
|
|
|
|
impl<'a> Decode<'a> for B {
|
|
|
|
|
type Decoder = BDecoder;
|
|
|
|
|
//~^ ERROR the trait bound
|
|
|
|
|
}
|
|
|
|
|
pub struct BDecoder {
|
|
|
|
|
non_implemented: <NonImplementedStruct as NonImplementedTrait>::Assoc,
|
|
|
|
|
//~^ ERROR the trait bound
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|