// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // 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() { }