Add #[rustc_dump_generics] attribute#157384
Conversation
|
Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_passes/src/check_attr.rs cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_hir/src/attrs cc @jdonszelmann, @JonathanBrouwer The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes. |
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I can review the attrs part! |
| Allow(Target::Struct), | ||
| Allow(Target::Enum), | ||
| Allow(Target::Union), | ||
| Allow(Target::Trait), |
There was a problem hiding this comment.
You'll probably want a test using it on a trait some day, because I imagine the interaction can be a bit more involved for that. Im not quite sure how far along this is from proof of concept to done. You might want to initially not support traits if that test gives you trouble?
There was a problem hiding this comment.
Just added a test for a trait, but it's definitely not exhaustive. Let me know your thoughts.
2bae2d2 to
7f0f6e0
Compare
|
@bors r+ rollup |
|
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 try jobs=i686-gnu-nopt-1 |
This comment has been minimized.
This comment has been minimized.
Add `#[rustc_dump_generics]` attribute try-job: i686-gnu-nopt-1
|
💔 Test for 87945f8 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
|
That's frustrating. Why does it fail specifically on that target triple? |
|
The specific target doesn't matter. You're printing a You need to add another compiletest normalization rule to make the mapping stable by "normalizing away" the concrete indices. |
Ah, I see. That makes sense. I'll try my best to do that. |
|
@bors try jobs=i686-gnu-nopt-1 |
Add `#[rustc_dump_generics]` attribute try-job: i686-gnu-nopt-1
This comment has been minimized.
This comment has been minimized.
|
bump; this should be ready to merge |
|
@bors r+ rollup |
|
@addiesh: 🔑 Insufficient privileges: not in review users |
|
@bors r=oli-obk |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 8c3f167 (parent) -> 8e15021 (this PR) Test differencesShow 3 test diffsStage 1
Stage 2
Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 8e150217bafcaaaa0c45bf685c55fd56cec48598 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (8e15021): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary -1.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.9%, secondary -4.4%)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: 480.598s -> 481.812s (0.25%) |
View all comments
Added a rustc attribute to dump the generic parameters of a given item to the compiler output.