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

ices/80371.rs: fixed with errors #629

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#80371

pub struct Header<'a> {
    pub value: &'a [u8],
}

pub fn test() {
    let headers = [Header{value: &[]}; 128];
}

fn main() {}
=== stdout ===
=== stderr ===
warning: unused variable: `headers`
 --> /home/runner/work/glacier/glacier/ices/80371.rs:6:9
  |
6 |     let headers = [Header{value: &[]}; 128];
  |         ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_headers`
  |
  = note: `#[warn(unused_variables)]` on by default

error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/80371.rs:6:19
  |
6 |     let headers = [Header{value: &[]}; 128];
  |                   ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Header<'_>`
  |
  = note: the `Copy` trait is required because the repeated element will be copied

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: unused variable: `headers`
 --> /home/runner/work/glacier/glacier/ices/80371.rs:6:9
  |
6 |     let headers = [Header{value: &[]}; 128];
  |         ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_headers`
  |
  = note: `#[warn(unused_variables)]` on by default

error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/80371.rs:6:19
  |
6 |     let headers = [Header{value: &[]}; 128];
  |                   ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Header<'_>`
  |
  = note: the `Copy` trait is required because the repeated element will be copied

error: aborting due to previous error; 1 warning emitted

For more information about this 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 0660811 into master Feb 2, 2021
@JohnTitor JohnTitor deleted the autofix/ices/80371.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