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

ices/109141.rs: fixed with errors #1593

Merged
merged 1 commit into from
Jun 4, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#109141

#![feature(generic_const_exprs)]

impl EntriesBuffer {
    fn a(&self) -> impl Iterator {
        self.0.iter_mut()
    }
}

struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>);

fn main() {}
=== stdout ===
=== stderr ===
error[E0425]: cannot find value `HashesEntryLEN` in this scope
 --> /home/runner/work/glacier/glacier/ices/109141.rs:9:32
  |
9 | struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>);
  |                                ^^^^^^^^^^^^^^ not found in this scope
  |
help: you might be missing a const parameter
  |
9 | struct EntriesBuffer<const HashesEntryLEN: /* Type */>(Box<[[u8; HashesEntryLEN]; 5]>);
  |                     ++++++++++++++++++++++++++++++++++

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/109141.rs:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0596]: cannot borrow `*self.0` as mutable, as it is behind a `&` reference
 --> /home/runner/work/glacier/glacier/ices/109141.rs:5:9
  |
5 |         self.0.iter_mut()
  |         ^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
  |
help: consider changing this to be a mutable reference
  |
4 |     fn a(&mut self) -> impl Iterator {
  |          ~~~~~~~~~

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

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

=== stdout ===
=== stderr ===
error[E0425]: cannot find value `HashesEntryLEN` in this scope
 --> /home/runner/work/glacier/glacier/ices/109141.rs:9:32
  |
9 | struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>);
  |                                ^^^^^^^^^^^^^^ not found in this scope
  |
help: you might be missing a const parameter
  |
9 | struct EntriesBuffer<const HashesEntryLEN: /* Type */>(Box<[[u8; HashesEntryLEN]; 5]>);
  |                     ++++++++++++++++++++++++++++++++++

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/109141.rs:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <rust-lang/rust#76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0596]: cannot borrow `*self.0` as mutable, as it is behind a `&` reference
 --> /home/runner/work/glacier/glacier/ices/109141.rs:5:9
  |
5 |         self.0.iter_mut()
  |         ^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
  |
help: consider changing this to be a mutable reference
  |
4 |     fn a(&mut self) -> impl Iterator {
  |          ~~~~~~~~~

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

Some errors have detailed explanations: E0425, E0596.
For more information about an error, try `rustc --explain E0425`.
==============
@JohnTitor JohnTitor merged commit 25fd993 into master Jun 4, 2023
@JohnTitor JohnTitor deleted the autofix/ices/109141.rs branch June 4, 2023 08: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