Add test for issue-75707
This commit is contained in:
parent
fc3a5dc6b4
commit
23092c7491
17
src/test/ui/unsized/issue-75707.rs
Normal file
17
src/test/ui/unsized/issue-75707.rs
Normal file
@ -0,0 +1,17 @@
|
||||
pub trait Callback {
|
||||
fn cb();
|
||||
}
|
||||
|
||||
pub trait Processing {
|
||||
type Call: Callback;
|
||||
}
|
||||
|
||||
fn f<P: Processing + ?Sized>() {
|
||||
P::Call::cb();
|
||||
}
|
||||
|
||||
fn main() {
|
||||
struct MyCall;
|
||||
f::<dyn Processing<Call = MyCall>>();
|
||||
//~^ ERROR: the trait bound `MyCall: Callback` is not satisfied
|
||||
}
|
12
src/test/ui/unsized/issue-75707.stderr
Normal file
12
src/test/ui/unsized/issue-75707.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0277]: the trait bound `MyCall: Callback` is not satisfied
|
||||
--> $DIR/issue-75707.rs:15:5
|
||||
|
|
||||
LL | fn f<P: Processing + ?Sized>() {
|
||||
| ---------- required by this bound in `f`
|
||||
...
|
||||
LL | f::<dyn Processing<Call = MyCall>>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Callback` is not implemented for `MyCall`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
Loading…
x
Reference in New Issue
Block a user