`deprecated` attribute should give error with bad arguments
code:
#[deprecated(a,a)]
pub fn a(){}
expected:
error[E0541]: unknown meta item 'a'
--> a.rs:5:14
|
5 | #[deprecated(a,a)]
| ^ expected one of `since`, `note`
error: aborting due to previous error
code:
#[deprecated("a")]
pub fn a(){}
expected:
error[E0565]: item in `deprecated` must be a key/value pair
--> a.rs:5:14
|
5 | #[deprecated("a")]
| ^^^
error: aborting due to previous error
code:
#[deprecated(since=a, note=a)]
pub fn A(){}
Expected:
error: expected unsuffixed literal or identifier, found `a`
--> a.rs:5:20
|
5 | #[deprecated(since=a, note=a)]
| ^
error: aborting due to previous error
Hi can I take this up?
Hi can I take this up?
Did you take it ?
Hi @P-E-P @lucasly-ba
Really sorry, I was away from work, could you guide me and give me some general pointers to get started with this issue? I could find the gcc/rust/parse/rust-parse-impl.h. Could you help me, and tell me if I am looking in the right direction?
@sneaky-potato This should probably be fixed within the attribute checker (rust/util/rust-attributes.cc). You'll need to look for the deprecated attributes and when found check that their values are correct. If not, emit a message.