summaryrefslogtreecommitdiffstats
path: root/tests/ui/dyn-star/param-env-region-infer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/dyn-star/param-env-region-infer.rs')
-rw-r--r--tests/ui/dyn-star/param-env-region-infer.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/dyn-star/param-env-region-infer.rs b/tests/ui/dyn-star/param-env-region-infer.rs
new file mode 100644
index 000000000..537473abc
--- /dev/null
+++ b/tests/ui/dyn-star/param-env-region-infer.rs
@@ -0,0 +1,22 @@
+// revisions: current next
+// Need `-Zdeduplicate-diagnostics=yes` because the number of cycle errors
+// emitted is for some horrible reason platform-specific.
+//[next] compile-flags: -Ztrait-solver=next -Zdeduplicate-diagnostics=yes
+// incremental
+
+// checks that we don't ICE if there are region inference variables in the environment
+// when computing `PointerLike` builtin candidates.
+
+#![feature(dyn_star, pointer_like_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+use std::marker::PointerLike;
+
+fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
+ //[next]~^ ERROR cycle detected when computing
+ t as _
+ //[current]~^ ERROR type annotations needed
+}
+
+fn main() {}