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

ices/83919.rs: fixed with errors #1195

Closed
wants to merge 1 commit into from
Closed

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#83919

#![feature(type_alias_impl_trait)]

use std::future::Future;

trait Foo {
    type T;
    type Fut2: Future<Output=Self::T>; // ICE gets triggered with traits other than Future here
    type Fut: Future<Output=Self::Fut2>;
    fn get_fut(&self) -> Self::Fut;
}

struct Implementor;

impl Foo for Implementor {
    type T = u64;
    type Fut2 = impl Future<Output=u64>;
    type Fut = impl Future<Output=Self::Fut2>;

    fn get_fut(&self) -> Self::Fut {
        async move {
            42
            // 42 does not impl Future and rustc does actually point out the error, but rustc also panics.
            // Putting a valid Future here works fine.
        }
    }
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `83919`
  --> /home/runner/work/glacier/glacier/ices/83919.rs:26:2
   |
26 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/83919.rs`

error[E0277]: `{integer}` is not a future
  --> /home/runner/work/glacier/glacier/ices/83919.rs:20:9
   |
20 | /         async move {
21 | |             42
22 | |             // 42 does not impl Future and rustc does actually point out the error, but rustc also panics.
23 | |             // Putting a valid Future here works fine.
24 | |         }
   | |_________^ `{integer}` is not a future
   |
   = help: the trait `Future` is not implemented for `{integer}`
   = note: {integer} must be a future or must implement `IntoFuture` to be awaited

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0601.
For more information about an error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `83919`
  --> /home/runner/work/glacier/glacier/ices/83919.rs:26:2
   |
26 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/83919.rs`

error[E0277]: `{integer}` is not a future
  --> /home/runner/work/glacier/glacier/ices/83919.rs:20:9
   |
20 | /         async move {
21 | |             42
22 | |             // 42 does not impl Future and rustc does actually point out the error, but rustc also panics.
23 | |             // Putting a valid Future here works fine.
24 | |         }
   | |_________^ `{integer}` is not a future
   |
   = help: the trait `Future` is not implemented for `{integer}`
   = note: {integer} must be a future or must implement `IntoFuture` to be awaited

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0601.
For more information about an error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo closed this in 1714f42 Mar 31, 2022
@Alexendoo Alexendoo deleted the autofix/ices/83919.rs branch March 31, 2022 21:53
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.

1 participant