rust-lang/rust-clippy

unused_lifetime false positive

Open

#2678 aperta il 17 apr 2018

Vedi su GitHub
 (12 commenti) (0 reazioni) (1 assegnatario)Rust (1391 fork)batch import
C-enhancementgood first issue

Metriche repository

Star
 (10.406 star)
Metriche merge PR
 (Merge medio 19g 22h) (113 PR mergiate in 30 g)

Descrizione

I'm using this type of stuff in a -sys-crate:

unsafe extern "C" fn callback<'a>(data: *mut c_void) {
    let _s = Box::from_raw(data as *mut S<'a>);
}

and this triggers unused_lifetime.

Playground with more context (also shows the #2677 issue): https://play.rust-lang.org/?gist=21a412537258ede9cbda42350501b90a&version=nightly

Guida contributor