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

ices/91603.rs: fixed with errors #1102

Merged
merged 1 commit into from
Jan 31, 2022
Merged

ices/91603.rs: fixed with errors #1102

merged 1 commit into from
Jan 31, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#91603

pub trait WorldQuery {
    type Fetch: for<'world> Fetch<'world>;
}

fn main() {}

pub trait Fetch<'world> {
    type Item;
}

pub type QueryItem<'w, Q> = <<Q as WorldQuery>::Fetch as Fetch<'w>>::Item;

fn first_child() -> impl FnOnce(&u32) -> QueryItem<u32> {}
=== stdout ===
=== stderr ===
error[E0277]: expected a `FnOnce<(&u32,)>` closure, found `()`
  --> /home/runner/work/glacier/glacier/ices/91603.rs:13:21
   |
13 | fn first_child() -> impl FnOnce(&u32) -> QueryItem<u32> {}
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&u32,)>` closure, found `()`
   |
   = help: the trait `for<'r> FnOnce<(&'r u32,)>` is not implemented for `()`

error[E0277]: the trait bound `u32: WorldQuery` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/91603.rs:13:21
   |
13 | fn first_child() -> impl FnOnce(&u32) -> QueryItem<u32> {}
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `WorldQuery` is not implemented for `u32`

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
error[E0277]: expected a `FnOnce<(&u32,)>` closure, found `()`
  --> /home/runner/work/glacier/glacier/ices/91603.rs:13:21
   |
13 | fn first_child() -> impl FnOnce(&u32) -> QueryItem<u32> {}
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&u32,)>` closure, found `()`
   |
   = help: the trait `for<'r> FnOnce<(&'r u32,)>` is not implemented for `()`

error[E0277]: the trait bound `u32: WorldQuery` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/91603.rs:13:21
   |
13 | fn first_child() -> impl FnOnce(&u32) -> QueryItem<u32> {}
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `WorldQuery` is not implemented for `u32`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo merged commit fce78de into master Jan 31, 2022
@Alexendoo Alexendoo deleted the autofix/ices/91603.rs branch January 31, 2022 13:24
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