mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
14 lines
226 B
Rust
14 lines
226 B
Rust
trait Test {}
|
|
impl Test for &[u8] {}
|
|
|
|
fn needs_test<T: Test>() -> T {
|
|
panic!()
|
|
}
|
|
|
|
fn main() {
|
|
needs_test::<[u8; 1]>();
|
|
//~^ ERROR the trait bound
|
|
let x: [u8; 1] = needs_test();
|
|
//~^ ERROR the trait bound
|
|
}
|