about summary refs log tree commit diff
path: root/tests/ui/impl-trait/issue-100075.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/issue-100075.rs')
-rw-r--r--tests/ui/impl-trait/issue-100075.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/issue-100075.rs b/tests/ui/impl-trait/issue-100075.rs
new file mode 100644
index 00000000000..ea30abb4855
--- /dev/null
+++ b/tests/ui/impl-trait/issue-100075.rs
@@ -0,0 +1,21 @@
+trait Marker {}
+impl<T> Marker for T {}
+
+fn maybe<T>(
+    _t: T,
+) -> Option<
+    //removing the line below makes it compile
+    &'static T,
+> {
+    None
+}
+
+fn _g<T>(t: &'static T) -> &'static impl Marker {
+    //~^ ERROR cannot resolve opaque type
+    if let Some(t) = maybe(t) {
+        return _g(t);
+    }
+    todo!()
+}
+
+fn main() {}