rust/tests/ui/suggestions/assoc-const-as-fn.rs
2023-01-11 09:32:08 +00:00

19 lines
458 B
Rust

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() {}