Skip to content

Commit 85511d2

Browse files
committed
add auto traits regression test
1 parent e68b9ed commit 85511d2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// check-pass
2+
use std::rc::Rc;
3+
4+
trait A {
5+
fn foo(&self) {}
6+
}
7+
8+
impl<T: Send> A for T {}
9+
10+
fn test<T: A>(rc: &Rc<T>) {
11+
rc.foo()
12+
// `Rc: Send` must not be evaluated as ambiguous
13+
// for this to compile, as we are otherwise
14+
// not allowed to use auto deref here to use
15+
// the `T: A` implementation.
16+
}
17+
18+
fn main() {}

0 commit comments

Comments
 (0)