rust-lang / rust-bindgen

Automatically generates Rust FFI bindings to C (and some C++) libraries.
https://rust-lang.github.io/rust-bindgen/
BSD 3-Clause "New" or "Revised" License
4.46k stars 694 forks source link

Clippy will warn on `use bindgen::CargoCallbacks;` regardless of the usage #2712

Open latin-1 opened 10 months ago

latin-1 commented 10 months ago

I'm not sure if it should be reported here though.

Input C/C++ Header

Bindgen Invocation

use bindgen::CargoCallbacks;
//           ^^^^^^^^^^^^^^

bindgen::Builder::default()
    .header("input.h")
    .parse_callbacks(Box::new(CargoCallbacks::new()))
    .generate()
    .unwrap()

Actual Results

error: use of deprecated constant `bindgen::CargoCallbacks`: Use `CargoCallbacks::new()` instead. Please, check the documentation for further information.

Expected Results

No warnings.

emilio commented 10 months ago

Hmm yeah, that's rather unfortunate. Regression from #2653 I guess. I guess we could just do a breaking bump and remove the deprecated item. @pvdrz thoughts?