about summary refs log tree commit diff
path: root/tests/ui/self/dispatch-from-dyn-layout.rs
blob: 468dc89a73e61d55e549d3d4842c4e4c52fc0428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ check-pass
// Regression test for #57276.

// Make sure that object safety checking doesn't freak out when
// we have impossible-to-satisfy `DispatchFromDyn` predicates.

#![feature(arbitrary_self_types, dispatch_from_dyn)]

use std::ops::{Deref, DispatchFromDyn};

trait Trait<T: Deref<Target = Self> + DispatchFromDyn<T>> {
    fn foo(self: T) -> dyn Trait<T>;
}

fn main() {}