Repository navigation
Replace manual AttributeParser construction by parse_limited_all - #166386
Conversation
|
|
| |_lint_id, _span, _kind| { | ||
| // FIXME(jdonszelmann): emit lints here properly | ||
| // NOTE that before new attribute parsing, they didn't happen either | ||
| // but it would be nice if we could change that. |
There was a problem hiding this comment.
We should in fact not emit lints here, they're emitted during lowering so emitting them here would duplicate them
There was a problem hiding this comment.
well, not if the macro isn't #[macro_export]ed right? This may be a problem.
There was a problem hiding this comment.
I think macro definitions always end up in the HIR, regardless of whether they're exported.
So they should always be checked
| // FIXME(jdonszelmann) don't care about tools here maybe? Just parse what we can. | ||
| // Does that prevents errors from happening? maybe | ||
| let mut parser = AttributeParser::new( | ||
| let attrs = AttributeParser::parse_limited_all( |
There was a problem hiding this comment.
The docs of parse_limited_all says:
Therefore, if
parse_filteris None, then features must be provided.
We should assert this hehe
There was a problem hiding this comment.
otherwise it's easy to accidentally pass tests if you happen not to put any attributes on an item where features matter
There was a problem hiding this comment.
Agreed, good idea
|
Some changes occurred in compiler/rustc_attr_parsing |
|
@bors r=jdonszelmann |
…zelmann Replace manual `AttributeParser` construction by `parse_limited_all` It's interesting to see this old code, of when attribute parsers were just introduced, hihi :3 r? @jdonszelmann because this has your FIXMEs
…zelmann Replace manual `AttributeParser` construction by `parse_limited_all` It's interesting to see this old code, of when attribute parsers were just introduced, hihi :3 r? @jdonszelmann because this has your FIXMEs
This comment has been minimized.
This comment has been minimized.
9ff59b0 to
5a0c4ea
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r=jdonszelmann |
Rollup of 11 pull requests Successful merges: - #165769 (Fix invalid instantiation of fake intrinsic bodies) - #166374 (Undo accidental duplication checking for attributes on macro calls) - #166386 (Replace manual `AttributeParser` construction by `parse_limited_all`) - #162565 (Add `c_buffer_length` lint helper) - #166096 (llvm-wrapper: Pass more arguments to PreCodeGenCallback) - #166395 (std: fix positioned read/write on VxWorks) - #166404 (Change `ChildExt::kill_process_group` to be `&self`) - #166405 (Check for errors before encoding metadata) - #166412 (std: Fix locking test on GNU/Hurd) - #166413 (std: Fix symlink chmod test on GNU/Hurd) - #166421 (core: Stabilize `float_bits_const`)
Rollup merge of #166386 - JonathanBrouwer:parse-all, r=jdonszelmann Replace manual `AttributeParser` construction by `parse_limited_all` It's interesting to see this old code, of when attribute parsers were just introduced, hihi :3 r? @jdonszelmann because this has your FIXMEs
It's interesting to see this old code, of when attribute parsers were just introduced, hihi :3
r? @jdonszelmann because this has your FIXMEs