Open
Description
This function:
#[deprecated(since = "yoinks ago")]
pub fn since() {}
After runing rustdoc -wjson
gives
"2": {
"attrs": ["#[attr = Deprecation {deprecation: Deprecation {since:\nNonStandard(\"yoinks ago\")}}]\n"],
"crate_id": 0,
"deprecation": {"note": null, "since": "yoinks ago"},
"docs": null,
"id": 2,
"inner": {
"function": {
"generics": {"params": [], "where_predicates": []},
"has_body": true,
"header": {"abi": "Rust", "is_async": false, "is_const": false, "is_unsafe": false},
"sig": {"inputs": [], "is_c_variadic": false, "output": null}
}
},
"links": {},
"name": "since",
"span": {
"begin": [10, 0],
"end": [10, 17],
"filename": "/home/gh-aDotInTheVoid/rust2/tests/rustdoc-json/attrs/deprecated.rs"
},
"visibility": "public"
},
We include "attrs": ["#[attr = Deprecation {deprecation: Deprecation {since:\nNonStandard(\"yoinks ago\")}}]\n"],
, but this is redundant because it's also availible (in a better, more structed format) as "deprecation": {"note": null, "since": "yoinks ago"},
We should remove this info from attrs
, and only provide it in deprecation
.
CC @obi1kenobi
Here's the bones of a testcase because I started on this this evening but it's too late to finish
#[deprecated]
pub fn raw() {}
#[deprecated = "here's a reason"]
pub fn equals_string() {}
#[deprecated(since = "yoinks ago")]
pub fn since() {}
#[deprecated(note = "7")]
pub fn note() {}
#[deprecated(since = "tomorrow", note = "sorry")]
pub fn since_and_note() {}