//@ run-pass #![allow(dead_code)] #![allow(unused_variables)] // Test that when there is a conditional (but blanket) impl and a // where clause, we don't get confused in trait resolution. // // Issue #18453. //@ pretty-expanded FIXME #23616 use std::rc::Rc; pub trait Foo { fn foo(&mut self, msg: M); } pub trait Bar { fn dummy(&self) -> M; } impl> Foo for F { fn foo(&mut self, msg: M) { } } pub struct Both { inner: Rc<(M, F)>, } impl> Clone for Both { fn clone(&self) -> Both { Both { inner: self.inner.clone() } } } fn repro1>(_both: Both) { } fn repro2>(msg: M, foo: F) { let both = Both { inner: Rc::new((msg, foo)) }; repro1(both.clone()); // <--- This clone causes problem } pub fn main() { }