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

ices/74918.rs: fixed with errors #456

Merged
merged 1 commit into from
Aug 12, 2020
Merged

ices/74918.rs: fixed with errors #456

merged 1 commit into from
Aug 12, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#74918

struct ChunkingIterator<T, S: 'static + Iterator<Item = T>> {
    source: S,
}

impl<T, S: Iterator<Item = T>> Iterator for ChunkingIterator<T, S> {
    type Item = IteratorChunk<T, S>;

    fn next(&mut self) -> Option<IteratorChunk<T, S>> {
        todo!()
    }
}

struct IteratorChunk<'a, T, S: Iterator<Item = T>> {
    source: &'a mut S,
}

impl<T, S: Iterator<Item = T>> Iterator for IteratorChunk<'_, T, S> {
    type Item = T;

    fn next(&mut self) -> Option<T> {
        todo!()
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0106]: missing lifetime specifier
 --> /home/runner/work/glacier/glacier/ices/74918.rs:6:31
  |
6 |     type Item = IteratorChunk<T, S>;
  |                               ^ expected named lifetime parameter
  |
help: consider introducing a named lifetime parameter
  |
6 |     type Item<'a> = IteratorChunk<<'a>T, S>;
  |              ^^^^                 ^^^^

error: `impl` item signature doesn't match `trait` item signature
   --> /home/runner/work/glacier/glacier/ices/74918.rs:8:5
    |
8   |     fn next(&mut self) -> Option<IteratorChunk<T, S>> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'_, T, S>>`
    |
    = note: expected `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'static, _, _>>`
               found `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'_, _, _>>`
    = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
    = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
error[E0106]: missing lifetime specifier
 --> /home/runner/work/glacier/glacier/ices/74918.rs:6:31
  |
6 |     type Item = IteratorChunk<T, S>;
  |                               ^ expected named lifetime parameter
  |
help: consider introducing a named lifetime parameter
  |
6 |     type Item<'a> = IteratorChunk<<'a>T, S>;
  |              ^^^^                 ^^^^

error: `impl` item signature doesn't match `trait` item signature
   --> /home/runner/work/glacier/glacier/ices/74918.rs:8:5
    |
8   |     fn next(&mut self) -> Option<IteratorChunk<T, S>> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'_, T, S>>`
    |
    = note: expected `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'static, _, _>>`
               found `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'_, _, _>>`
    = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait`
    = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0106`.
==============
@Alexendoo Alexendoo merged commit cd8671b into master Aug 12, 2020
@Alexendoo Alexendoo deleted the autofix/ices/74918.rs branch August 12, 2020 12:46
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