about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs b/tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs
new file mode 100644
index 00000000000..08dcd7d80b3
--- /dev/null
+++ b/tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs
@@ -0,0 +1,16 @@
+//@ check-pass
+
+#![feature(const_trait_impl)]
+
+#[const_trait]
+trait Foo {}
+
+impl<T> const Foo for (T,) where T: ~const Foo {}
+
+const fn needs_const_foo(_: impl ~const Foo + Copy) {}
+
+const fn test<T: ~const Foo + Copy>(t: T) {
+    needs_const_foo((t,));
+}
+
+fn main() {}