Skip to content

Commit 23092c7

Browse files
committed
Add test for issue-75707
1 parent fc3a5dc commit 23092c7

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/test/ui/unsized/issue-75707.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pub trait Callback {
2+
fn cb();
3+
}
4+
5+
pub trait Processing {
6+
type Call: Callback;
7+
}
8+
9+
fn f<P: Processing + ?Sized>() {
10+
P::Call::cb();
11+
}
12+
13+
fn main() {
14+
struct MyCall;
15+
f::<dyn Processing<Call = MyCall>>();
16+
//~^ ERROR: the trait bound `MyCall: Callback` is not satisfied
17+
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0277]: the trait bound `MyCall: Callback` is not satisfied
2+
--> $DIR/issue-75707.rs:15:5
3+
|
4+
LL | fn f<P: Processing + ?Sized>() {
5+
| ---------- required by this bound in `f`
6+
...
7+
LL | f::<dyn Processing<Call = MyCall>>();
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Callback` is not implemented for `MyCall`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)