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