rust-lang/rust-clippy

unused_lifetime false positive

Open

#2,678 创建于 2018年4月17日

在 GitHub 查看
 (12 评论) (0 反应) (1 负责人)Rust (10,406 star) (1,391 fork)batch import
C-enhancementgood first issue

描述

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

贡献者指南

unused_lifetime false positive · rust-lang/rust-clippy#2678 | Good First Issue