summaryrefslogtreecommitdiffstats
path: root/tests/ui/implied-bounds/ice-unbound-region-vars.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/implied-bounds/ice-unbound-region-vars.rs')
-rw-r--r--tests/ui/implied-bounds/ice-unbound-region-vars.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/implied-bounds/ice-unbound-region-vars.rs b/tests/ui/implied-bounds/ice-unbound-region-vars.rs
new file mode 100644
index 000000000..9e1e3feae
--- /dev/null
+++ b/tests/ui/implied-bounds/ice-unbound-region-vars.rs
@@ -0,0 +1,24 @@
+// Because of #109628, we can have unbounded region vars in implied bounds.
+// Make sure we don't ICE in this case!
+//
+// check-pass
+
+pub trait MapAccess {
+ type Error;
+ fn next_key_seed(&mut self) -> Option<Self::Error>;
+}
+
+struct Access<'a> {
+ _marker: std::marker::PhantomData<&'a ()>,
+}
+
+// implied_bounds(Option<Self::Error>) = ['?1: 'a, ]
+// where '?1 is a fresh region var.
+impl<'a, 'b: 'a> MapAccess for Access<'a> {
+ type Error = ();
+ fn next_key_seed(&mut self) -> Option<Self::Error> {
+ unimplemented!()
+ }
+}
+
+fn main() {}