about summary refs log tree commit diff
path: root/tests/ui/dyn-compatibility/associated-consts.rs
blob: 69fff81b281461572f1fc6375ecf611a66fa6ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Check that we correctly prevent users from making trait objects
// from traits with associated consts.

trait Bar {
    const X: usize;
}

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

fn main() {
}