【发布时间】:2022-09-23 12:39:45
【问题描述】:
我尝试添加允许dead_code 和unused_must_use:
#[allow(dead_code)]
#[allow(unused_must_use)]
#[implement(MyStruct)]
pub struct MyStructList(pub Rc<Vec<MyStruct>>);
但是仍然收到警告,仍然是新的生锈,调用 drop 是什么意思?
warning: unused return value of `Box::<T>::from_raw` that must be used
--> test.rs
|
| #[implement(MyStruct)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
= note: this warning originates in the attribute macro `implement` (in Nightly builds, run with -Z macro-backtrace for more info)
-
宏
implement是如何定义的? -
这回答了你的问题了吗? How to disable unused code warnings in Rust?
-
这看起来像是宏中的错误;我怀疑你能做些什么。
标签: rust compiler-warnings rust-proc-macros