summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/assoc-const-as-fn.rs
blob: 4b4595dd5e6a5e70fce2e754b5532f44f50eb8a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
unsafe fn pointer(v: usize, w: u32) {}

pub trait UniformScalar {}
impl UniformScalar for u32 {}

pub trait GlUniformScalar: UniformScalar {
    const FACTORY: unsafe fn(usize, Self) -> ();
}
impl GlUniformScalar for u32 {
    const FACTORY: unsafe fn(usize, Self) -> () = pointer;
}

pub fn foo<T: UniformScalar>(value: T) {
    <T as GlUniformScalar>::FACTORY(1, value);
    //~^ ERROR the trait bound `T: GlUniformScalar` is not satisfied
}

fn main() {}