Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 16, 2025

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jun 16, 2025

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
Copy link
Contributor

antoyo commented Jun 16, 2025

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
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.

Copy link
Contributor

@antoyo antoyo left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

@GuillaumeGomez GuillaumeGomez force-pushed the fix-warnings branch 4 times, most recently from 9099d70 to e5d9107 Compare June 16, 2025 14:59
@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
Copy link
Contributor

antoyo commented Jun 16, 2025

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