E0043

E0043#

无用的属性标注。

属性可能因以下原因失效:本应唯一却存在重复,应用于无效实体,或被误用。

错误示例#

///|
/// This is an invalid usage as the deprecation warning should be unique
#deprecated("")
#deprecated("The attribute is unused because it's duplicated")
pub fn f() -> Unit {

}

///|
/// This is an invalid usage as struct can't be external
#external
pub struct T {}

///|
/// This is an invalid usage as it expects a string
#deprecated(asdfasdf)
pub fn g() -> Unit {

}

建议#

根据具体的警告信息应用修复方案。

///|
#deprecated("")
pub fn f() -> Unit {

}

///|
pub struct T {}

///|
#deprecated("asdfasdf")
pub fn g() -> Unit {

}