]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/multidispatch-conditional-impl-not-considered.rs
Rollup merge of #99742 - sigaloid:master, r=thomcc
[rust.git] / src / test / ui / traits / multidispatch-conditional-impl-not-considered.rs
1 // run-pass
2 // Test that we correctly ignore the blanket impl
3 // because (in this case) `T` does not impl `Clone`.
4 //
5 // Issue #17594.
6
7 use std::cell::RefCell;
8
9 trait Foo {
10     fn foo(&self) {}
11 }
12
13 impl<T> Foo for T where T: Clone {}
14
15 struct Bar;
16
17 impl Bar {
18     fn foo(&self) {}
19 }
20
21 fn main() {
22     let b = RefCell::new(Bar);
23     b.borrow().foo();
24 }