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

ices/77329.rs: fixed with errors #518

Merged
merged 1 commit into from
Oct 26, 2020
Merged

ices/77329.rs: fixed with errors #518

merged 1 commit into from
Oct 26, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#77329

fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
    std::iter::empty()
}
=== stdout ===
=== stderr ===
warning: unnecessary braces around const expression
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:42
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
  |                                          ^^^^^^^^^^^^^^^^^^^ help: remove these braces
  |
  = note: `#[warn(unused_braces)]` on by default

error[E0601]: `main` function not found in crate `77329`
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:1
  |
1 | / fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
2 | |     std::iter::empty()
3 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/77329.rs`

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:45
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
  |                                             ^ doesn't have a size known at compile-time
  |
  = help: the trait `Sized` is not implemented for `[u8]`
  = help: unsized locals are gated as an unstable feature
help: function arguments must have a statically known size, borrowed types always have a known size
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: &[u8]| { x } }]> {
  |                                                ^

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:54
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
  |                                                      ^ doesn't have a size known at compile-time
  |
  = help: the trait `Sized` is not implemented for `[u8]`
  = note: the return type of a function must have a statically known size

error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:44
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
  |                                            ^^^^^^^^^^^^^^^ expected `usize`, found closure
  |
  = note: expected type `usize`
          found closure `[closure@/home/runner/work/glacier/glacier/ices/77329.rs:1:44: 1:59]`

error: aborting due to 4 previous errors; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: unnecessary braces around const expression
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:42
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
  |                                          ^^^^^^^^^^^^^^^^^^^ help: remove these braces
  |
  = note: `#[warn(unused_braces)]` on by default

error[E0601]: `main` function not found in crate `77329`
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:1
  |
1 | / fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
2 | |     std::iter::empty()
3 | | }
  | |_^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/77329.rs`

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:45
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
  |                                             ^ doesn't have a size known at compile-time
  |
  = help: the trait `Sized` is not implemented for `[u8]`
  = help: unsized locals are gated as an unstable feature
help: function arguments must have a statically known size, borrowed types always have a known size
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: &[u8]| { x } }]> {
  |                                                ^

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:54
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
  |                                                      ^ doesn't have a size known at compile-time
  |
  = help: the trait `Sized` is not implemented for `[u8]`
  = note: the return type of a function must have a statically known size

error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/77329.rs:1:44
  |
1 | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| { x } }]> {
  |                                            ^^^^^^^^^^^^^^^ expected `usize`, found closure
  |
  = note: expected type `usize`
          found closure `[closure@/home/runner/work/glacier/glacier/ices/77329.rs:1:44: 1:59]`

error: aborting due to 4 previous errors; 1 warning emitted

Some errors have detailed explanations: E0277, E0308, E0601.
For more information about an error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo merged commit 9897b41 into master Oct 26, 2020
@Alexendoo Alexendoo deleted the autofix/ices/77329.rs branch October 26, 2020 12: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.

2 participants