reqwest-middleware icon indicating copy to clipboard operation
reqwest-middleware copied to clipboard

Improper handling of deprecated_attributes feature / Compiler warning as of 1.84.0

Open w1ll-i-code opened this issue 1 month ago • 1 comments

Bug description

As of rust 1.84.0, rustc will warn that the feature deprecated_attributes is not in the library users Cargo.toml.

warning: unexpected `cfg` condition value: `deprecated_attributes`                                        
   --> src/external_api_client/mod.rs:291:20
    |                   
291 |           let span = reqwest_otel_span!(                                                            
    |  ____________________^        
292 | |             name = "backend_request",
293 | |             req,       
294 | |             time_elapsed = tracing::field::Empty                                                  
295 | |         );                                                                                                                                                                                                   
    | |_________^             
    |                                                                                                     
    = note: no expected values for `feature`                                                              
    = help: consider adding `deprecated_attributes` as a feature in `Cargo.toml`                          
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration                                                               
    = note: `#[warn(unexpected_cfgs)]` on by default
    = note: this warning originates in the macro `reqwest_otel_span` (in Nightly builds, run with -Z macro-backtrace for more info) 

To Reproduce

  1. use the macro reqwest_otel_span! from the reqwest-tracing library.
  2. run cargo +1.84.0 check
  3. Observe the new errors.

Expected behavior

This should not happen. I'll further investigate how to fix this.

w1ll-i-code avatar Jan 13 '25 11:01 w1ll-i-code