// Issue 8142: Test that Drop impls cannot be specialized beyond the // predicates attached to the type definition itself. trait Bound { fn foo(&self) {} } struct K<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8, } struct L<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8, } struct M<'m> { x: &'m i8, } struct N<'n> { x: &'n i8, } struct O { x: *const To, } struct P { x: *const Tp, } struct Q { x: *const Tq, } struct R { x: *const Tr, } struct S { x: *const Ts, } struct T<'t, Ts: 't> { x: &'t Ts, } struct U; struct V { x: *const Tva, y: *const Tvb, } struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8, } struct X; struct Y; enum Enum { Variant(T), } struct TupleStruct(T); union Union { f: T, } impl<'al, 'adds_bnd: 'al> Drop for K<'al, 'adds_bnd> { //~^ ERROR `Drop` impl requires `'adds_bnd: 'al` fn drop(&mut self) {} } impl<'al, 'adds_bnd> Drop for L<'al, 'adds_bnd> //~^ ERROR `Drop` impl requires `'adds_bnd: 'al` where 'adds_bnd: 'al, { fn drop(&mut self) {} } impl<'ml> Drop for M<'ml> { fn drop(&mut self) {} } impl Drop for N<'static> { //~^ ERROR `Drop` impls cannot be specialized fn drop(&mut self) {} } impl Drop for O { fn drop(&mut self) {} } impl Drop for P { //~^ ERROR `Drop` impls cannot be specialized fn drop(&mut self) {} } impl Drop for Q { //~^ ERROR `Drop` impl requires `AddsBnd: Bound` fn drop(&mut self) {} } impl<'rbnd, AddsRBnd: 'rbnd> Drop for R { fn drop(&mut self) {} } impl Drop for S { fn drop(&mut self) {} } impl<'t, Bt: 't> Drop for T<'t, Bt> { fn drop(&mut self) {} } impl Drop for U { fn drop(&mut self) {} } impl Drop for V { //~^ ERROR `Drop` impls cannot be specialized fn drop(&mut self) {} } impl<'lw> Drop for W<'lw, 'lw> { //~^ ERROR `Drop` impls cannot be specialized fn drop(&mut self) {} } impl Drop for X<3> { //~^ ERROR `Drop` impls cannot be specialized fn drop(&mut self) {} } impl Drop for Y { //~^ ERROR `Drop` impls cannot be specialized fn drop(&mut self) {} } impl Drop for Enum { //~^ ERROR `Drop` impl requires `AddsBnd: Bound` fn drop(&mut self) {} } impl Drop for TupleStruct { //~^ ERROR `Drop` impl requires `AddsBnd: Bound` fn drop(&mut self) {} } impl Drop for Union { //~^ ERROR `Drop` impl requires `AddsBnd: Bound` fn drop(&mut self) {} } pub fn main() {}