Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Foo {
- const U: usize;
- }
- trait Bar {
- const V: usize;
- }
- impl<T: Foo> Bar for T {
- const V: usize = 5 - T::U;
- }
- impl Foo for u32 {
- const U: usize = 6;
- }
- fn main() {
- // uncomment for error
- //let x = <u32 as Bar>::V;
- //println!("{}", x);
- }
Add Comment
Please, Sign In to add comment