summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/dyn-trait-elided-two-inputs-param.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/dyn-trait-elided-two-inputs-param.rs')
-rw-r--r--tests/ui/impl-trait/dyn-trait-elided-two-inputs-param.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/dyn-trait-elided-two-inputs-param.rs b/tests/ui/impl-trait/dyn-trait-elided-two-inputs-param.rs
new file mode 100644
index 000000000..e8da52aad
--- /dev/null
+++ b/tests/ui/impl-trait/dyn-trait-elided-two-inputs-param.rs
@@ -0,0 +1,11 @@
+// Test that we don't get an error with `dyn Object` in an impl Trait
+// when there are multiple inputs. The `dyn Object` should default to `+
+// 'static`. This used to erroneously generate an error (cc #62517).
+//
+// check-pass
+
+trait Alpha<Item: ?Sized> {}
+trait Object {}
+impl<T> Alpha<dyn Object> for T {}
+fn alpha(x: &str, y: &str) -> impl Alpha<dyn Object> { () }
+fn main() { }