Rewrite inline attribute parser to use new infrastructure and improve diagnostics for all parsed attributes#138165
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| return OptimizeAttr::Default; | ||
| }; | ||
|
|
||
| inline_span = Some(attr.span()); |
e6dad01 to
2a707bf
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #138302) made this pull request unmergeable. Please resolve the merge conflicts. |
b7dda57 to
88a713a
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot review |
This comment has been minimized.
This comment has been minimized.
|
ah shit, broke clippy 😭 |
|
Yay! |
| // Latest feature: rustdoc JSON: Don't apply #[repr] privacy heuristics | ||
| pub const FORMAT_VERSION: u32 = 46; | ||
| // Latest feature: Pretty printing of inline attributes changed | ||
| pub const FORMAT_VERSION: u32 = 48; |
There was a problem hiding this comment.
Uh, we skipped 47. Oh well, not much to be done about it now.
There was a problem hiding this comment.
@GuillaumeGomez: when you add the (tidy?) check for updating the number and comment in tandem, could you also add a check that the number is being increased by one?
There was a problem hiding this comment.
I opened #142677 for that. But that's a good point. Added to my TODO list.
There was a problem hiding this comment.
#138165 (comment), earlier it was thaught that someone else was going to do 46->47, to this should do 47->48. I think the takeaways are:
a) Don't try to be too clever and do a double bounce
b) #142601 should fix this. 🤞
There was a problem hiding this comment.
I've published rustdoc-types = "0.48.0", with a note that 0.47.0/format_version=47 will never exist. https://github.com/rust-lang/rustdoc-types/blob/trunk/CHANGELOG.md#v0.48.0
There was a problem hiding this comment.
I've published rustdoc-types = "0.48.0", with a note that 0.47.0/format_version=47 will never exist. https://github.com/rust-lang/rustdoc-types/blob/trunk/CHANGELOG.md#v0.48.0
|
Finished benchmarking commit (1bb3352): comparison URL. Overall result: ❌ regressions - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.8%, secondary -1.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 4.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.1%, secondary 0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 693.071s -> 692.01s (-0.15%) |
rewrite `optimize` attribute to use new attribute parsing infrastructure r? `@oli-obk` I'm afraid we'll get quite a few of these PRs in the future. If we get a lot of trivial changes I'll start merging multiple into one PR. They should be easy to review :) Waiting on rust-lang#138165 first
rewrite `optimize` attribute to use new attribute parsing infrastructure r? ``@oli-obk`` I'm afraid we'll get quite a few of these PRs in the future. If we get a lot of trivial changes I'll start merging multiple into one PR. They should be easy to review :) Waiting on rust-lang#138165 first
rewrite `optimize` attribute to use new attribute parsing infrastructure r? ```@oli-obk``` I'm afraid we'll get quite a few of these PRs in the future. If we get a lot of trivial changes I'll start merging multiple into one PR. They should be easy to review :) Waiting on rust-lang#138165 first
|
@jdonszelmann Is the binary size jump expected? I thought this would only change the infrastructure but not actual inlining? |
|
@oli-obk and I have been looking at this this morning. It has to do with attribute encoding cross crate and I'm working on a fix. The fix is luckily rather simple, but it was definitely an unexpected side effect. I expect to be busy for an hour or so more and then have a pr ready :) |
Encode hir attributes cross-crate properly r? `@oli-obk` This should return the lost perf in #138165 cc: `@therealprof`
Rollup merge of #138291 - jdonszelmann:optimize-attr, r=oli-obk rewrite `optimize` attribute to use new attribute parsing infrastructure r? ```@oli-obk``` I'm afraid we'll get quite a few of these PRs in the future. If we get a lot of trivial changes I'll start merging multiple into one PR. They should be easy to review :) Waiting on #138165 first
To be precise almost completely addressed, the |
…i-obk Encode hir attributes cross-crate properly r? `@oli-obk` This should return the lost perf in #138165 cc: `@therealprof`
…i-obk Encode hir attributes cross-crate properly r? `@oli-obk` This should return the lost perf in #138165 cc: `@therealprof`
Rewrite `inline` attribute parser to use new infrastructure and improve diagnostics for all parsed attributes r? `@oli-obk` This PR: - creates a new parser for inline attributes - creates consistent error messages and error codes between attribute parsers; inline and others - as such changes a few error messages for other attributes to be (in my eyes) much more consistent - tests ast-lowering lints introduced by rust-lang#138164 since this is now useful for the first time - Coalesce some useless error codes Builds on top of rust-lang#138164 Closes rust-lang#137950
r? @oli-obk
This PR:
Builds on top of #138164
Closes #137950