//@ run-pass // rpass test for reservation impls. Not 100% required because `From` uses them, // but still. //@ revisions: old next //@[next] compile-flags: -Znext-solver #![feature(rustc_attrs)] use std::mem; trait MyTrait { fn foo(&self, s: S) -> usize; } #[rustc_reservation_impl = "foo"] impl MyTrait for T { fn foo(&self, _x: u64) -> usize { 0 } } // reservation impls don't create coherence conflicts, even with // non-chain overlap. impl MyTrait for u32 { fn foo(&self, _x: S) -> usize { mem::size_of::() } } fn main() { // ...and the non-reservation impl gets picked.XS assert_eq!(0u32.foo(0u64), mem::size_of::()); }