about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/unsized/issue-75707.rs17
-rw-r--r--src/test/ui/unsized/issue-75707.stderr12
2 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/unsized/issue-75707.rs b/src/test/ui/unsized/issue-75707.rs
new file mode 100644
index 00000000000..9f04cdbb922
--- /dev/null
+++ b/src/test/ui/unsized/issue-75707.rs
@@ -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
+}
diff --git a/src/test/ui/unsized/issue-75707.stderr b/src/test/ui/unsized/issue-75707.stderr
new file mode 100644
index 00000000000..6e557a25f95
--- /dev/null
+++ b/src/test/ui/unsized/issue-75707.stderr
@@ -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`.