2021-12-21 13:23:59 +08:00
|
|
|
// Regression test for #92111.
|
|
|
|
//
|
|
|
|
// The issue was that we normalize trait bounds before caching
|
2021-12-22 00:25:50 +08:00
|
|
|
// results of selection. Checking that `impl Tr for S` requires
|
2021-12-21 13:23:59 +08:00
|
|
|
// checking `S: !Drop` because it cannot overlap with the blanket
|
|
|
|
// impl. Then we save the (unsatisfied) result from checking `S: Drop`.
|
|
|
|
// Then the call to `a` checks whether `S: ~const Drop` but we normalize
|
|
|
|
// it to `S: Drop` which the cache claims to be unsatisfied.
|
|
|
|
//
|
|
|
|
// check-pass
|
|
|
|
|
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
|
|
|
pub trait Tr {}
|
|
|
|
|
|
|
|
#[allow(drop_bounds)]
|
|
|
|
impl<T: Drop> Tr for T {}
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct S(i32);
|
|
|
|
|
|
|
|
impl Tr for S {}
|
|
|
|
|
|
|
|
const fn a<T: ~const Drop>(t: T) {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
a(S(0));
|
|
|
|
}
|