rust-lang/rust-clippy

unused_lifetime false positive

Open

#2.678 geöffnet am 17. Apr. 2018

Auf GitHub ansehen
 (12 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Rust (1.391 Forks)batch import
C-enhancementgood first issue

Repository-Metriken

Stars
 (10.406 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 19T 22h) (113 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide