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

ices/81899.rs: fixed with errors #899

Merged
merged 1 commit into from
Aug 15, 2021
Merged

ices/81899.rs: fixed with errors #899

merged 1 commit into from
Aug 15, 2021

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#81899

const _CONST: &[u8] = &f(&[], |_| {});

const fn f<F>(_: &[u8], _: F) -> &[u8]
where
    F: FnMut(&u8),
{
    panic!()
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0277]: expected a `FnMut<(&u8,)>` closure, found `[closure@/home/runner/work/glacier/glacier/ices/81899.rs:1:31: 1:37]`
 --> /home/runner/work/glacier/glacier/ices/81899.rs:1:24
  |
1 | const _CONST: &[u8] = &f(&[], |_| {});
  |                        ^ expected an `FnMut<(&u8,)>` closure, found `[closure@/home/runner/work/glacier/glacier/ices/81899.rs:1:31: 1:37]`
2 | 
3 | const fn f<F>(_: &[u8], _: F) -> &[u8]
  |          - required by a bound in this
4 | where
5 |     F: FnMut(&u8),
  |        ---------- required by this bound in `f`
  |
  = help: the trait `for<'r> FnMut<(&'r u8,)>` is not implemented for `[closure@/home/runner/work/glacier/glacier/ices/81899.rs:1:31: 1:37]`

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error[E0277]: expected a `FnMut<(&u8,)>` closure, found `[closure@/home/runner/work/glacier/glacier/ices/81899.rs:1:31: 1:37]`
 --> /home/runner/work/glacier/glacier/ices/81899.rs:1:24
  |
1 | const _CONST: &[u8] = &f(&[], |_| {});
  |                        ^ expected an `FnMut<(&u8,)>` closure, found `[closure@/home/runner/work/glacier/glacier/ices/81899.rs:1:31: 1:37]`
2 | 
3 | const fn f<F>(_: &[u8], _: F) -> &[u8]
  |          - required by a bound in this
4 | where
5 |     F: FnMut(&u8),
  |        ---------- required by this bound in `f`
  |
  = help: the trait `for<'r> FnMut<(&'r u8,)>` is not implemented for `[closure@/home/runner/work/glacier/glacier/ices/81899.rs:1:31: 1:37]`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
==============
@JohnTitor
Copy link
Member

Left a comment to the PR.

@JohnTitor JohnTitor merged commit 2092d10 into master Aug 15, 2021
@JohnTitor JohnTitor deleted the autofix/ices/81899.rs branch August 15, 2021 21:48
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