about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-02 13:07:13 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-08 15:08:06 +0000
commitdc97b1eb587fe2db207bfe8c2e914034ab9b9306 (patch)
tree368577450fda42d73eb32d308388fec3a3a594a6 /tests
parentc8dfb594061d129e3c7cef7cf4b15ab3c0ab5931 (diff)
downloadrust-dc97b1eb587fe2db207bfe8c2e914034ab9b9306.tar.gz
rust-dc97b1eb587fe2db207bfe8c2e914034ab9b9306.zip
Ensure the canonical_param_env_cache does not contain inconsistent information about the defining anchor
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/impl-trait/different_where_bounds.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/different_where_bounds.rs b/tests/ui/impl-trait/different_where_bounds.rs
new file mode 100644
index 00000000000..87ae6db2822
--- /dev/null
+++ b/tests/ui/impl-trait/different_where_bounds.rs
@@ -0,0 +1,27 @@
+//! This test checks that the param env canonicalization cache
+//! does not end up with inconsistent values.
+
+//@ check-pass
+
+pub fn poison1() -> impl Sized
+where
+    (): 'static,
+{
+}
+pub fn poison2() -> impl Sized
+where
+    (): 'static,
+{
+    define_by_query((poison2, ()));
+}
+pub fn poison3() -> impl Sized
+where
+    (): 'static,
+{
+}
+
+trait Query {}
+impl<Out, F: Fn() -> Out> Query for (F, Out) {}
+fn define_by_query(_: impl Query) {}
+
+fn main() {}