Skip to content

Fix fuzz warnings and deny warnings by default in build system#713

Merged
antoyo merged 6 commits into
rust-lang:masterfrom
GuillaumeGomez:fix-warnings
Jun 16, 2025
Merged

Fix fuzz warnings and deny warnings by default in build system#713
antoyo merged 6 commits into
rust-lang:masterfrom
GuillaumeGomez:fix-warnings

Conversation

@GuillaumeGomez

@GuillaumeGomez GuillaumeGomez commented Jun 16, 2025

Copy link
Copy Markdown
Member

Fixes #712.

Fix the following warnings:

warning: unused variable: `curr`
  --> src/fuzz/reduce.rs:42:13
   |
42 |     let mut curr = 0;
   |             ^^^^ help: if this is intentional, prefix it with an underscore: `_curr`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: variable does not need to be mutable
  --> src/fuzz/reduce.rs:42:9
   |
42 |     let mut curr = 0;
   |         ----^^^^
   |         |
   |         help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

warning: unused `Result` that must be used
   --> src/fuzz/reduce.rs:431:9
    |
431 |         out.write_all(line.as_bytes());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
    = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
    |
431 |         let _ = out.write_all(line.as_bytes());
    |         +++++++

warning: `y` (bin "y") generated 3 warnings (run `cargo fix --bin "y"` to apply 1 suggestion)

@antoyo

antoyo commented Jun 16, 2025

Copy link
Copy Markdown
Contributor

LGTM. I'll let @FractalFir approve just to make sure he didn't have other plans for this variable.

@GuillaumeGomez GuillaumeGomez changed the title Fix warnings Fix fuzz warnings and deny warnings by default in build system Jun 16, 2025
@FractalFir

Copy link
Copy Markdown
Contributor

This looks correct. curr was just a remnant from an older version of this pass, which tried to apply this reduction on a per-function basis.

Now, it tries to apply it on sections of the file.

@antoyo antoyo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
@GuillaumeGomez
GuillaumeGomez force-pushed the fix-warnings branch 4 times, most recently from 9099d70 to e5d9107 Compare June 16, 2025 14:59
Comment thread Cargo.lock
@antoyo
antoyo enabled auto-merge June 16, 2025 15:43
@antoyo
antoyo merged commit fda0bb9 into rust-lang:master Jun 16, 2025
38 checks passed
@GuillaumeGomez
GuillaumeGomez deleted the fix-warnings branch June 16, 2025 15:56
@antoyo

antoyo commented Jun 16, 2025

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warnings in the fuzzer

3 participants