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

ices/84434.rs: fixed with no errors #734

Merged
merged 1 commit into from
Apr 27, 2021
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#84434

#![crate_type = "lib"]
use std::path::Path;
struct A {
    pub func: fn(check: bool, a: &Path, b: Option<&Path>),
}
const MY_A: A = A {
    func: |check, a, b| {
        if check {
            let _ = ();
        } else if let Some(parent) = b.and_then(|p| p.parent()) {
            let _ = ();
        }
    },
};
=== stdout ===
=== stderr ===
warning: unused variable: `parent`
  --> /home/runner/work/glacier/glacier/ices/84434.rs:10:28
   |
10 |         } else if let Some(parent) = b.and_then(|p| p.parent()) {
   |                            ^^^^^^ help: if this is intentional, prefix it with an underscore: `_parent`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `a`
 --> /home/runner/work/glacier/glacier/ices/84434.rs:7:19
  |
7 |     func: |check, a, b| {
  |                   ^ help: if this is intentional, prefix it with an underscore: `_a`

warning: struct is never constructed: `A`
 --> /home/runner/work/glacier/glacier/ices/84434.rs:3:8
  |
3 | struct A {
  |        ^
  |
  = note: `#[warn(dead_code)]` on by default

warning: constant is never used: `MY_A`
  --> /home/runner/work/glacier/glacier/ices/84434.rs:6:1
   |
6  | / const MY_A: A = A {
7  | |     func: |check, a, b| {
8  | |         if check {
9  | |             let _ = ();
...  |
13 | |     },
14 | | };
   | |__^

warning: 4 warnings emitted

==============

=== stdout ===
=== stderr ===
warning: unused variable: `parent`
  --> /home/runner/work/glacier/glacier/ices/84434.rs:10:28
   |
10 |         } else if let Some(parent) = b.and_then(|p| p.parent()) {
   |                            ^^^^^^ help: if this is intentional, prefix it with an underscore: `_parent`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `a`
 --> /home/runner/work/glacier/glacier/ices/84434.rs:7:19
  |
7 |     func: |check, a, b| {
  |                   ^ help: if this is intentional, prefix it with an underscore: `_a`

warning: struct is never constructed: `A`
 --> /home/runner/work/glacier/glacier/ices/84434.rs:3:8
  |
3 | struct A {
  |        ^
  |
  = note: `#[warn(dead_code)]` on by default

warning: constant is never used: `MY_A`
  --> /home/runner/work/glacier/glacier/ices/84434.rs:6:1
   |
6  | / const MY_A: A = A {
7  | |     func: |check, a, b| {
8  | |         if check {
9  | |             let _ = ();
...  |
13 | |     },
14 | | };
   | |__^

warning: 4 warnings emitted

==============
@JohnTitor JohnTitor merged commit ba30e9f into master Apr 27, 2021
@JohnTitor JohnTitor deleted the autofix/ices/84434.rs branch April 27, 2021 13:23
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