about summary refs log tree commit diff
path: root/tests/ui/dyn-compatibility/sized-2.rs
blob: c99dcce46b2c168e1931b9aa9244e684d5125d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Check that we correctly prevent users from making trait objects
// from traits where `Self : Sized`.

trait Bar
    where Self : Sized
{
    fn bar<T>(&self, t: T);
}

fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
    //~^ ERROR E0038
    t
}

fn main() {
}