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

ices/95271.sh: fixed with no errors #1287

Merged
merged 1 commit into from
Jun 8, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 8, 2022

Issue: rust-lang/rust#95271

rustc  --crate-type lib --edition=2021 - 2>&1 << EOF

enum Foo {
    Foo(i32),
}

fn bar(foo: Foo) {
    || {
        // `let foo = foo;` makes the ICE disappear
        let Foo::Foo(baz) = foo;
    };
}
pub fn main() {}

EOF
=== stdout ===
/home/runner/work/glacier/glacier/ices/95271.sh: line 1: let: =: syntax error: operand expected (error token is "=")
warning: unused variable: `baz`
 --> <anon>:9:22
  |
9 |         let Foo::Foo(baz) = foo;
  |                      ^^^ help: if this is intentional, prefix it with an underscore: `_baz`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: enum is never used: `Foo`
 --> <anon>:2:6
  |
2 | enum Foo {
  |      ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `bar`
 --> <anon>:6:4
  |
6 | fn bar(foo: Foo) {
  |    ^^^

warning: unused closure that must be used
  --> <anon>:7:5
   |
7  | /     || {
8  | |         //  makes the ICE disappear
9  | |         let Foo::Foo(baz) = foo;
10 | |     };
   | |______^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: closures are lazy and do nothing unless called

warning: 4 warnings emitted

=== stderr ===
==============

=== stdout ===
/home/runner/work/glacier/glacier/ices/95271.sh: line 1: let: =: syntax error: operand expected (error token is "=")
warning: unused variable: `baz`
 --> <anon>:9:22
  |
9 |         let Foo::Foo(baz) = foo;
  |                      ^^^ help: if this is intentional, prefix it with an underscore: `_baz`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: enum is never used: `Foo`
 --> <anon>:2:6
  |
2 | enum Foo {
  |      ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function is never used: `bar`
 --> <anon>:6:4
  |
6 | fn bar(foo: Foo) {
  |    ^^^

warning: unused closure that must be used
  --> <anon>:7:5
   |
7  | /     || {
8  | |         //  makes the ICE disappear
9  | |         let Foo::Foo(baz) = foo;
10 | |     };
   | |______^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: closures are lazy and do nothing unless called

warning: 4 warnings emitted

=== stderr ===
==============
@JohnTitor JohnTitor merged commit 7b2bec0 into master Jun 8, 2022
@JohnTitor JohnTitor deleted the autofix/ices/95271.sh branch June 8, 2022 10:58
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