Also warn if an invalid doc attribute is used on a macro invocation - #161003
Conversation
There was a problem hiding this comment.
r? me
so when we reach rustc_attr_parsing, the attribute is not present and there won't trigger an error. I don't think it's worth changing this logic but in case someone things otherwise, it's mentioned. :)
that's implemented in #160904, which does this (sort of) and also like three other things 🙈
I think this is a good step to merge first, makes ^ a bit simpler.
@bors r+ rollup
|
@mejrs Nicely done! |
…c, r=mejrs Also warn if an invalid `doc` attribute is used on a macro invocation Fixes rust-lang#160880. So about this: I think the error message is good enough, but I can specialize it in case it's not a doc comment but a doc attribute. Also: currently the ignored attributes are not kept in the AST, so when we reach `rustc_attr_parsing`, the attribute is not present and there won't trigger an error. I don't think it's worth changing this logic but in case someone thinks otherwise, it's mentioned. :) r? @JonathanBrouwer
|
Also just a note - I don't think this fixes #160880. I think we should FCW on that and later try a crater run and see if we can get away with erroring on it again. |
Rollup of 13 pull requests Successful merges: - #160976 (Ensure TLS accesses don't call the global allocator through panic (part 2)) - #160438 ([rustdoc] Change table odd table rows background color to not make it the same as inline code) - #160985 (self-profile more of borrowck) - #137858 (Add new `unused_footnote_definition` rustdoc lint) - #159566 (Add support for generics in `offload`and remove `no_mangle` attribute) - #160676 (rustc_public: split `def`s out of `ty`) - #160861 (rustc_parse: suggest removing semicolon before `if` block) - #160958 (Remove unused `#[non_exhaustive]` in library) - #160978 (move resolve_path to Session inherent method) - #160990 (Remove old cfg parser which is now dead code) - #160991 (Add offload component on nightly) - #160999 (doc changes to expect messages in process.rs) - #161003 (Also warn if an invalid `doc` attribute is used on a macro invocation)
Rollup of 13 pull requests Successful merges: - #160976 (Ensure TLS accesses don't call the global allocator through panic (part 2)) - #160438 ([rustdoc] Change table odd table rows background color to not make it the same as inline code) - #160985 (self-profile more of borrowck) - #137858 (Add new `unused_footnote_definition` rustdoc lint) - #159566 (Add support for generics in `offload`and remove `no_mangle` attribute) - #160676 (rustc_public: split `def`s out of `ty`) - #160861 (rustc_parse: suggest removing semicolon before `if` block) - #160958 (Remove unused `#[non_exhaustive]` in library) - #160978 (move resolve_path to Session inherent method) - #160990 (Remove old cfg parser which is now dead code) - #160991 (Add offload component on nightly) - #160999 (doc changes to expect messages in process.rs) - #161003 (Also warn if an invalid `doc` attribute is used on a macro invocation)
|
Replaced it with "part of" then. |
Rollup merge of #161003 - GuillaumeGomez:doc-attr-macro-invoc, r=mejrs Also warn if an invalid `doc` attribute is used on a macro invocation Fixes #160880. So about this: I think the error message is good enough, but I can specialize it in case it's not a doc comment but a doc attribute. Also: currently the ignored attributes are not kept in the AST, so when we reach `rustc_attr_parsing`, the attribute is not present and there won't trigger an error. I don't think it's worth changing this logic but in case someone thinks otherwise, it's mentioned. :) r? @JonathanBrouwer
|
Finished benchmarking commit (d80b7f1): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (primary -1.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 455.642s -> 454.976s (-0.15%) |
Part of #160880.
So about this: I think the error message is good enough, but I can specialize it in case it's not a doc comment but a doc attribute.
Also: currently the ignored attributes are not kept in the AST, so when we reach
rustc_attr_parsing, the attribute is not present and there won't trigger an error. I don't think it's worth changing this logic but in case someone thinks otherwise, it's mentioned. :)r? @JonathanBrouwer