1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Test that when there is a conditional (but blanket) impl and a
12 // where clause, we don't get confused in trait resolution.
16 // pretty-expanded FIXME #23616
21 fn foo(&mut self, msg: M);
28 impl<M, F: Bar<M>> Foo<M> for F {
29 fn foo(&mut self, msg: M) {
33 pub struct Both<M, F> {
37 impl<M, F: Foo<M>> Clone for Both<M, F> {
38 fn clone(&self) -> Both<M, F> {
39 Both { inner: self.inner.clone() }
43 fn repro1<M, F: Foo<M>>(_both: Both<M, F>) {
46 fn repro2<M, F: Foo<M>>(msg: M, foo: F) {
47 let both = Both { inner: Rc::new((msg, foo)) };
48 repro1(both.clone()); // <--- This clone causes problem