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

ices/69487-3.rs: fixed with errors #1212

Merged
merged 1 commit into from
Apr 12, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#69487

fn main() {
    [9; || [9; []]];
}
=== stdout ===
=== stderr ===
error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/69487-3.rs:2:16
  |
2 |     [9; || [9; []]];
  |                ^^ expected `usize`, found array of 0 elements
  |
  = note: expected type `usize`
            found array `[_; 0]`

error[E0080]: it is undefined behavior to use this value
 --> /home/runner/work/glacier/glacier/ices/69487-3.rs:2:9
  |
2 |     [9; || [9; []]];
  |         ^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
  |
  = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
  = note: the raw bytes of the constant (size: 8, align: 8) {
              __ __ __ __ __ __ __ __                         │ ░░░░░░░░
          }

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
error[E0308]: mismatched types
 --> /home/runner/work/glacier/glacier/ices/69487-3.rs:2:16
  |
2 |     [9; || [9; []]];
  |                ^^ expected `usize`, found array of 0 elements
  |
  = note: expected type `usize`
            found array `[_; 0]`

error[E0080]: it is undefined behavior to use this value
 --> /home/runner/work/glacier/glacier/ices/69487-3.rs:2:9
  |
2 |     [9; || [9; []]];
  |         ^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
  |
  = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
  = note: the raw bytes of the constant (size: 8, align: 8) {
              __ __ __ __ __ __ __ __                         │ ░░░░░░░░
          }

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0080, E0308.
For more information about an error, try `rustc --explain E0080`.
==============
@Alexendoo Alexendoo merged commit a697d1f into master Apr 12, 2022
@Alexendoo Alexendoo deleted the autofix/ices/69487-3.rs branch April 12, 2022 21:11
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