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

ices/112824.rs: fixed with errors #1626

Merged
merged 1 commit into from
Oct 15, 2023
Merged

ices/112824.rs: fixed with errors #1626

merged 1 commit into from
Oct 15, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#112824

pub struct Opcode(pub u8);

pub struct Opcode2(&'a S);

impl Opcode2 {
    pub const OP2: Opcode2 = Opcode2(Opcode(0x1));
}

pub fn example2(msg_type: Opcode2) -> impl FnMut(&[u8]) {
    move |i| match msg_type {
        Opcode2::OP2 => unimplemented!(),
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0261]: use of undeclared lifetime name `'a`
 --> /home/runner/work/glacier/glacier/ices/112824.rs:3:21
  |
3 | pub struct Opcode2(&'a S);
  |                   - ^^ undeclared lifetime
  |                   |
  |                   help: consider introducing lifetime `'a` here: `<'a>`

error[E0412]: cannot find type `S` in this scope
 --> /home/runner/work/glacier/glacier/ices/112824.rs:3:24
  |
3 | pub struct Opcode2(&'a S);
  |                        ^ not found in this scope
  |
help: you might be missing a type parameter
  |
3 | pub struct Opcode2<S>(&'a S);
  |                   +++

error: constant pattern depends on a generic parameter
  --> /home/runner/work/glacier/glacier/ices/112824.rs:11:9
   |
11 |         Opcode2::OP2 => unimplemented!(),
   |         ^^^^^^^^^^^^

warning: unused variable: `i`
  --> /home/runner/work/glacier/glacier/ices/112824.rs:10:11
   |
10 |     move |i| match msg_type {
   |           ^ help: if this is intentional, prefix it with an underscore: `_i`
   |
   = note: `#[warn(unused_variables)]` on by default

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

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

=== stdout ===
=== stderr ===
error[E0261]: use of undeclared lifetime name `'a`
 --> /home/runner/work/glacier/glacier/ices/112824.rs:3:21
  |
3 | pub struct Opcode2(&'a S);
  |                   - ^^ undeclared lifetime
  |                   |
  |                   help: consider introducing lifetime `'a` here: `<'a>`

error[E0412]: cannot find type `S` in this scope
 --> /home/runner/work/glacier/glacier/ices/112824.rs:3:24
  |
3 | pub struct Opcode2(&'a S);
  |                        ^ not found in this scope
  |
help: you might be missing a type parameter
  |
3 | pub struct Opcode2<S>(&'a S);
  |                   +++

error: constant pattern depends on a generic parameter
  --> /home/runner/work/glacier/glacier/ices/112824.rs:11:9
   |
11 |         Opcode2::OP2 => unimplemented!(),
   |         ^^^^^^^^^^^^

warning: unused variable: `i`
  --> /home/runner/work/glacier/glacier/ices/112824.rs:10:11
   |
10 |     move |i| match msg_type {
   |           ^ help: if this is intentional, prefix it with an underscore: `_i`
   |
   = note: `#[warn(unused_variables)]` on by default

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

Some errors have detailed explanations: E0261, E0412.
For more information about an error, try `rustc --explain E0261`.
==============
@JohnTitor JohnTitor merged commit 42894eb into master Oct 15, 2023
@JohnTitor JohnTitor deleted the autofix/ices/112824.rs branch October 15, 2023 03:02
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