]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #80920 - rylev:check_attr-refactor, r=davidtwco
authorDylan DPC <dylan.dpc@gmail.com>
Sun, 14 Feb 2021 15:54:42 +0000 (16:54 +0100)
committerGitHub <noreply@github.com>
Sun, 14 Feb 2021 15:54:42 +0000 (16:54 +0100)
commitac1d26bcd3a26523c7e7ebb2dd0b37d6b2834291
tree96024d4a5568ea17d21e71efd130e71371005e31
parent29ed864dc3a066487180d08dcf8b64c6afedebba
parent9f0e1d4921bbb40fea71594d7c599c09ab513232
Rollup merge of #80920 - rylev:check_attr-refactor, r=davidtwco

Visit more targets when validating attributes

This begins to address #80048, allowing for additional validation of attributes.

There are more refactorings that can be done, though I think they should be tackled in additional PRs:
* ICE when a builtin attribute is encountered that is not checked
* Move some of the attr checking done `ast_validation` into `rustc_passes`
  * note that this requires a bit of additional refactoring, especially of extern items which currently parse attributes (and thus are a part of the AST) but do not possess attributes in their HIR representation.
* Rename `Target` to `AttributeTarget`
* Refactor attribute validation completely to go through `Visitor::visit_attribute`.
  * This would require at a minimum passing `Target` into this method which might be too big of a refactoring to be worth it.
  * It's also likely not possible to do all the validation this way as some validation requires knowing what other attributes a target has.

r? `@davidtwco`