trait Whee { fn woo<'a>(&self, a: &'a u32, b: &'a u32) -> (&'a u32, T) { (a, loop {}) } } impl Whee for bool { fn woo<'a>(&self, a: &'a u32, b: &'a u32) -> (&'a u32, u32) { if *self { (a, 5) } else { (b, 4) } } } impl Whee for u8 { fn woo<'a>(&self, a: &'a u32, b: &'a u32) -> (&'a u32, u32) { borrow_mutably::(); if *self == 0 { (a, 5) } else { (b, 4) } } } fn main() { let bar = &4u8 as &dyn Whee; let foo = &true as &dyn Whee; foo.woo(&2, &3); borrow_mutably::(); } fn borrow_mutably() { fn __autoken_borrow_mutably() {} __autoken_borrow_mutably::(); } fn borrow_immutably() { fn __autoken_borrow_immutably() {} __autoken_borrow_immutably::(); } fn unborrow_mutably() { fn __autoken_unborrow_mutably() {} __autoken_unborrow_mutably::(); } fn unborrow_immutably() { fn __autoken_unborrow_immutably() {} __autoken_unborrow_immutably::(); }