clap-validator icon indicating copy to clipboard operation
clap-validator copied to clipboard

Build warnings with Rust 1.89.0

Open play-tank opened this issue 4 months ago • 1 comments

I'm writing a CLAP plugin in rust, and I have made "clap-validator" a child in my workspace so that I can more easily debug it with source. However, running "cargo build" with the 1.89.0 compiler yields a number of warnings.

Documenting them here. Going to clean these up and submit a PR.


git/clap-validator » rustc --version
rustc 1.89.0 (29483883e 2025-08-04)
git/clap-validator » cargo build
    Updating crates.io index

....

  Downloaded 62 crates (4.9MiB) in 0.53s
warning: unused imports: `FileType` and `IndexerResults`
  --> src/plugin/preset_discovery.rs:18:25
   |
18 | pub use self::indexer::{FileType, Flags, IndexerResults, Location, LocationValue, Soundpack};
   |                         ^^^^^^^^         ^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `PresetFlags`
  --> src/plugin/preset_discovery.rs:19:66
   |
19 | pub use self::metadata_receiver::{PluginAbi, Preset, PresetFile, PresetFlags};
   |                                                                  ^^^^^^^^^^^

warning: field `prefered_dialect` is never read
  --> src/plugin/ext/note_ports.rs:37:9
   |
35 | pub struct NotePort {
   |            -------- field in this struct
36 |     /// The preferred dialect for this note port. This should only ever contain a single value.
37 |     pub prefered_dialect: clap_note_dialect,
   |         ^^^^^^^^^^^^^^^^
   |
   = note: `NotePort` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: field `default` is never read
  --> src/plugin/ext/params.rs:60:9
   |
52 | pub struct Param {
   |            ----- field in this struct
...
60 |     pub default: f64,
   |         ^^^^^^^
   |
   = note: `Param` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis

warning: fields `name` and `description` are never read
  --> src/plugin/preset_discovery/indexer.rs:61:9
   |
60 | pub struct FileType {
   |            -------- fields in this struct
61 |     pub name: String,
   |         ^^^^
62 |     pub description: Option<String>,
   |         ^^^^^^^^^^^
   |
   = note: `FileType` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis

warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/plugin/library.rs:234:26
    |
234 |     pub fn create_plugin(&self, id: &str, host: Rc<Host>) -> Result<Plugin> {
    |                          ^^^^^ the lifetime is elided here          ------ the same lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
234 |     pub fn create_plugin(&self, id: &str, host: Rc<Host>) -> Result<Plugin<'_>> {
    |                                                                           ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/plugin/library.rs:251:37
    |
251 |     pub fn preset_discovery_factory(&self) -> Result<PresetDiscoveryFactory> {
    |                                     ^^^^^            ---------------------- the same lifetime is hidden here
    |                                     |
    |                                     the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
    |
251 |     pub fn preset_discovery_factory(&self) -> Result<PresetDiscoveryFactory<'_>> {
    |                                                                            ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/plugin/preset_discovery.rs:137:28
    |
137 |     pub fn create_provider(&self, metadata: &ProviderMetadata) -> Result<Provider> {
    |                            ^^^^^ the lifetime is elided here             -------- the same lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
    |
137 |     pub fn create_provider(&self, metadata: &ProviderMetadata) -> Result<Provider<'_>> {
    |                                                                                  ++++

warning: `clap-validator` (bin "clap-validator") generated 8 warnings (run `cargo fix --bin "clap-validator"` to apply 2 suggestions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.72s`

play-tank avatar Sep 03 '25 01:09 play-tank