about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-06-19 19:30:44 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-06-19 19:30:44 +0000
commitd169ee3457b284150fabc04a84ea1d873595b5cc (patch)
tree47bfcc3785cb66b40990578f1d63c24fe79e23c4 /example
parent43064b005d06c5db9426a6d479e9f9124122b483 (diff)
downloadrust-d169ee3457b284150fabc04a84ea1d873595b5cc.tar.gz
rust-d169ee3457b284150fabc04a84ea1d873595b5cc.zip
Recurse into function signatures in assert_assignable
Fixes #1311
Diffstat (limited to 'example')
-rw-r--r--example/issue-59326.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/example/issue-59326.rs b/example/issue-59326.rs
new file mode 100644
index 00000000000..70b7c94e15c
--- /dev/null
+++ b/example/issue-59326.rs
@@ -0,0 +1,27 @@
+// Based on https://github.com/rust-lang/rust/blob/689511047a75a30825e367d4fd45c74604d0b15e/tests/ui/issues/issue-59326.rs#L1
+// check-pass
+trait Service {
+    type S;
+}
+
+trait Framing {
+    type F;
+}
+
+impl Framing for () {
+    type F = ();
+}
+
+trait HttpService<F: Framing>: Service<S = F::F> {}
+
+type BoxService = Box<dyn HttpService<(), S = ()>>;
+
+fn build_server<F: FnOnce() -> BoxService>(_: F) {}
+
+fn make_server<F: Framing>() -> Box<dyn HttpService<F, S = F::F>> {
+    unimplemented!()
+}
+
+fn main() {
+    build_server(|| make_server())
+}