about summary refs log tree commit diff
path: root/tests/ui/traits/trait-bound-mismatch-14853.rs
blob: 3f2a1408a1360a267be6dccfcf9f7d764ba1cd4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! Regression test for https://github.com/rust-lang/rust/issues/14853

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));
}