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

ices/80767.rs: fixed with errors #630

Merged
merged 1 commit into from
Feb 2, 2021
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 2, 2021

Issue: rust-lang/rust#80767

type G<'a> = [(O, &'a [u8]); 64];
enum O {
    O1,
}
fn f(_p: [G; 4]) {}

fn main() {
    let p: [G; 4];
    let _g: G = [(O::O1, &[]); 64];
    f(p);
}
=== stdout ===
=== stderr ===
error[E0277]: the trait bound `(O, &[u8]): Copy` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/80767.rs:9:17
  |
9 |     let _g: G = [(O::O1, &[]); 64];
  |                 ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `(O, &[u8])`
  |
  = note: the `Copy` trait is required because the repeated element will be copied

error[E0381]: use of possibly-uninitialized variable: `p`
  --> /home/runner/work/glacier/glacier/ices/80767.rs:10:7
   |
10 |     f(p);
   |       ^ use of possibly-uninitialized `p`

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
error[E0277]: the trait bound `(O, &[u8]): Copy` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/80767.rs:9:17
  |
9 |     let _g: G = [(O::O1, &[]); 64];
  |                 ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `(O, &[u8])`
  |
  = note: the `Copy` trait is required because the repeated element will be copied

error[E0381]: use of possibly-uninitialized variable: `p`
  --> /home/runner/work/glacier/glacier/ices/80767.rs:10:7
   |
10 |     f(p);
   |       ^ use of possibly-uninitialized `p`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0381.
For more information about an error, try `rustc --explain E0277`.
==============
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JohnTitor JohnTitor merged commit 1ace922 into master Feb 2, 2021
@JohnTitor JohnTitor deleted the autofix/ices/80767.rs branch February 2, 2021 12:50
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