Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

ices/100075.rs: fixed with errors #1406

Merged
merged 1 commit into from
Aug 31, 2022
Merged

ices/100075.rs: fixed with errors #1406

merged 1 commit into from
Aug 31, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#100075

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 {
    if let Some(t) = maybe(t) {
        return _g(t);
    }
    todo!()
}

pub fn main() {}
=== stdout ===
=== stderr ===
error[E0720]: cannot resolve opaque type
  --> /home/runner/work/glacier/glacier/ices/100075.rs:12:37
   |
12 | fn _g<T>(t: &'static T) -> &'static impl Marker {
   |                                     ^^^^^^^^^^^ recursive opaque type
13 |     if let Some(t) = maybe(t) {
14 |         return _g(t);
   |                ----- returning here with type `&impl Marker`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0720`.
==============

=== stdout ===
=== stderr ===
error[E0720]: cannot resolve opaque type
  --> /home/runner/work/glacier/glacier/ices/100075.rs:12:37
   |
12 | fn _g<T>(t: &'static T) -> &'static impl Marker {
   |                                     ^^^^^^^^^^^ recursive opaque type
13 |     if let Some(t) = maybe(t) {
14 |         return _g(t);
   |                ----- returning here with type `&impl Marker`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0720`.
==============
@JohnTitor JohnTitor merged commit 8a05722 into master Aug 31, 2022
@JohnTitor JohnTitor deleted the autofix/ices/100075.rs branch August 31, 2022 10:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants