E0043

E0043#

无用的属性标注。

An attribute will not take effect due to reasons such as being duplicated while it should be unique, being applied to an entity that it has no effect, or being misused

错误示例#

///|
/// 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 {

}

建议#

Apply the fix according to the specific warning message.

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

}

///|
pub struct T {}

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

}