mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
21 lines
348 B
Rust
21 lines
348 B
Rust
use std::fmt::Debug;
|
|
|
|
trait Str {}
|
|
|
|
trait Something: Sized {
|
|
fn yay<T: Debug>(_: Option<Self>, thing: &[T]);
|
|
}
|
|
|
|
struct X { data: u32 }
|
|
|
|
impl Something for X {
|
|
fn yay<T: Str>(_:Option<X>, thing: &[T]) {
|
|
//~^ ERROR E0276
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let arr = &["one", "two", "three"];
|
|
println!("{:?}", Something::yay(None::<X>, arr));
|
|
}
|