summaryrefslogtreecommitdiffstats
path: root/tests/ui/unboxed-closures/issue-18661.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/unboxed-closures/issue-18661.rs')
-rw-r--r--tests/ui/unboxed-closures/issue-18661.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/unboxed-closures/issue-18661.rs b/tests/ui/unboxed-closures/issue-18661.rs
new file mode 100644
index 000000000..e24272432
--- /dev/null
+++ b/tests/ui/unboxed-closures/issue-18661.rs
@@ -0,0 +1,19 @@
+// run-pass
+// Test that param substitutions from the correct environment are
+// used when codegenning unboxed closure calls.
+
+// pretty-expanded FIXME #23616
+
+pub fn inside<F: Fn()>(c: F) {
+ c();
+}
+
+// Use different number of type parameters and closure type to trigger
+// an obvious ICE when param environments are mixed up
+pub fn outside<A,B>() {
+ inside(|| {});
+}
+
+fn main() {
+ outside::<(),()>();
+}