rust/src/test/ui/object-safety/object-safety-associated-consts.rs
2019-05-29 00:57:31 -04:00

16 lines
227 B
Rust

// 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() {
}