mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
16 lines
247 B
Rust
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() {
|
|
}
|