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

ices/100818.rs: fixed with errors #1603

Merged
merged 1 commit into from
Jun 24, 2023
Merged

ices/100818.rs: fixed with errors #1603

merged 1 commit into from
Jun 24, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#100818

#![feature(type_alias_impl_trait)]
use std::future::Future;

fn main() {
    type SomeFuture<'t> = impl 't + Future<Output = ()>;
    type SomeClosure = impl for<'t> FnOnce(&'t str) -> SomeFuture<'t>;
    fn coerce_closure(f: SomeClosure) {}
    coerce_closure(|x: &str| async move {});
}
=== stdout ===
=== stderr ===
warning: unused variable: `x`
 --> /home/runner/work/glacier/glacier/ices/100818.rs:8:21
  |
8 |     coerce_closure(|x: &str| async move {});
  |                     ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

error[E0792]: expected generic lifetime parameter, found `'t`
 --> /home/runner/work/glacier/glacier/ices/100818.rs:8:5
  |
5 |     type SomeFuture<'t> = impl 't + Future<Output = ()>;
  |                     -- this generic parameter must be used with a generic lifetime parameter
...
8 |     coerce_closure(|x: &str| async move {});
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: unused variable: `x`
 --> /home/runner/work/glacier/glacier/ices/100818.rs:8:21
  |
8 |     coerce_closure(|x: &str| async move {});
  |                     ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

error[E0792]: expected generic lifetime parameter, found `'t`
 --> /home/runner/work/glacier/glacier/ices/100818.rs:8:5
  |
5 |     type SomeFuture<'t> = impl 't + Future<Output = ()>;
  |                     -- this generic parameter must be used with a generic lifetime parameter
...
8 |     coerce_closure(|x: &str| async move {});
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0792`.
==============
@JohnTitor JohnTitor merged commit eb3e447 into master Jun 24, 2023
@JohnTitor JohnTitor deleted the autofix/ices/100818.rs branch June 24, 2023 05:24
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants