rust/compiler/rustc_middle/src
bors 7d8c6e781d Auto merge of #135726 - jdonszelmann:attr-parsing, r=oli-obk
New attribute parsing infrastructure

Another step in the plan outlined in https://github.com/rust-lang/rust/issues/131229

introduces infrastructure for structured parsers for attributes, as well as converting a couple of complex attributes to have such structured parsers.

This PR may prove too large to review. I left some of my own comments to guide it a little. Some general notes:

- The first commit is basically standalone. It just preps some mostly unrelated sources for the rest of the PR to work. It might not have enormous merit on its own, but not negative merit either. Could be merged alone, but also doesn't make the review a whole lot easier. (but it's only +274 -209)
- The second commit is the one that introduces new infrastructure. It's the important one to review.
- The 3rd commit uses the new infrastructure showing how some of the more complex attributes can be parsed using it. Theoretically can be split up, though the parsers in this commit are the ones that really test the new infrastructure and show that it all works.
- The 4th commit fixes up rustdoc and clippy. In the previous 2 they didn't compile yet while the compiler does. Separated them out to separate concerns and make the rest more palatable.
- The 5th commit blesses some test outputs. Sometimes that's just because a diagnostic happens slightly earlier than before, which I'd say is acceptable. Sometimes a diagnostic is now only emitted once where it would've been twice before (yay! fixed some bugs). One test I actually moved from crashes to fixed, because it simply doesn't crash anymore. That's why this PR  Closes #132391. I think most choices I made here are generally reasonable, but let me know if you disagree anywhere.
- The 6th commit adds a derive to pretty print attributes
- The 7th removes smir apis for attributes, for the time being. The api will at some point be replaced by one based on `rustc_ast_data_structures::AttributeKind`

In general, a lot of the additions here are comments. I've found it very important to document new things in the 2nd commit well so other people can start using it.

Closes #132391
Closes #136717
2025-02-24 23:07:24 +00:00
..
dep_graph Remove impl_for_typed_def_id macro. 2025-02-04 08:34:11 +11:00
hir Rollup merge of #137334 - compiler-errors:edition-2024-fresh-2, r=saethlin,traviscross 2025-02-23 02:44:18 -05:00
hooks Pretty print pattern type values with transmute if they don't satisfy their pattern 2025-02-05 14:56:41 +00:00
infer Clean up trivial traversal/lift impl generator macro calls. 2025-02-06 13:31:43 +11:00
middle Fix binding mode problems 2025-02-22 00:13:19 +00:00
mir Fix some use items that import more than necessary. 2025-02-24 09:30:42 +11:00
query Auto merge of #136539 - matthewjasper:late-normalize-errors, r=compiler-errors 2025-02-19 07:49:08 +00:00
thir Rollup merge of #137180 - compiler-errors:sym-regions, r=oli-obk 2025-02-23 00:16:19 +01:00
traits Change span field accesses to method calls 2025-02-24 14:22:31 +01:00
ty Auto merge of #135726 - jdonszelmann:attr-parsing, r=oli-obk 2025-02-24 23:07:24 +00:00
util Simplify intra-crate qualifiers. 2025-02-11 14:59:13 +11:00
arena.rs intern valtrees 2025-02-13 00:38:17 +01:00
error.rs clean up layout error diagnostics 2025-02-18 13:22:45 +01:00
lib.rs update cfg(bootstrap) 2025-02-18 09:32:44 -08:00
lint.rs Move methods from Map to TyCtxt, part 3. 2025-02-21 14:31:09 +11:00
macros.rs Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
metadata.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
tests.rs Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
thir.rs Rollup merge of #137180 - compiler-errors:sym-regions, r=oli-obk 2025-02-23 00:16:19 +01:00
values.rs Move some Map methods onto TyCtxt. 2025-02-17 13:21:02 +11:00