rust/tests/ui/dyn-compatibility/associated-consts.rs
2025-02-24 18:48:40 +00:00

16 lines
247 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
//~^ ERROR E0038
}
fn main() {
}