Repository navigation
Conversation
|
cc @rust-lang/clippy Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_attr_ir cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
|
|
RustcTestEntrypointMarker back !#[rustc_test_entrypoint_marker] back !
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add `#[rustc_test_entrypoint_marker]` back !
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (7bab611): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -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 -2.7%, secondary -1.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 3.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: 484.783s -> 485.111s (0.07%) |
|
Happy to take a look at this tomorrow :) |
This is also what clippy does, and it is indeed rather ugly 🤮 |
| // Drop the test entrypoint marker -- unclear how that would interact. | ||
| AttrKind::Synthetic(SyntheticAttr::TestEntrypoint) => {} |
There was a problem hiding this comment.
There was a problem hiding this comment.
oh lmao -- i guess we need to forbid some attrs on EII
There was a problem hiding this comment.
Wow a rustc segfault, that is impressive tbh
| /// This synthetic attribute is added by the `#[test]` and `#[bench]` macros to the annotated | ||
| /// function, so that tools (e.g. rustc drivers doing analysis) can find test entry points | ||
| /// without relying on unstable details such test lowering. | ||
| /// | ||
| /// The attribute is not used by rustc directly and is instead only provided as a utility for | ||
| /// out of tree users. | ||
| TestEntrypoint, |
There was a problem hiding this comment.
I'm not sure if it's right to have bench and test both emit the same trace attribute. It sounds confusing.
There was a problem hiding this comment.
the thought process was that you can distinguish both from the arguments (none for #[test], &mut Bencher for #[bench]), and we just want to make these items findable (and two synth attribs felt overkill). happy to remove #[bench], personally i have on use for it, idk about clippy & co
There was a problem hiding this comment.
I'm happy to keep it for bench for now, the test and bench infra share a lot of internal stuff so it kinda makes sense
7ff15d4 to
6ef674a
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. |
This comment has been minimized.
This comment has been minimized.
6ef674a to
0cfffc4
Compare
|
@bors r+ rollup |
|
❌ Commit 0cfffc4 has been unapproved due to PR CI failure. Reapprove it with |
0cfffc4 to
395e81a
Compare
|
heh this was in fact not correct |
|
@bors r+ rollup |
…=JonathanBrouwer Add `#[rustc_test_entrypoint_marker]` back ! Re-add the unstable and internal `#[rustc_test_entrypoint_marker]` (first sighted in rust-lang#158854)! This is helpful for tools like [Charon](https://github.com/AeneasVerif/charon) to translate test entry points, since once test generation is done there is no simple way of finding these: otherwise one needs to look for statics with `#[rustc_test_marker]`, visit their body, and look for a path to a function inside that body (ugly!) now that synthetic attributes exist doing this is simple and shouldnt cause any regressions :3 (fingers crossed) r? jdonszelmann
View all comments
Re-add the unstable and internal
#[rustc_test_entrypoint_marker](first sighted in #158854)! This is helpful for tools like Charon to translate test entry points, since once test generation is done there is no simple way of finding these: otherwise one needs to look for statics with#[rustc_test_marker], visit their body, and look for a path to a function inside that body (ugly!)now that synthetic attributes exist doing this is simple and shouldnt cause any regressions :3 (fingers crossed)
r? jdonszelmann
LLM Disclosure: I used an LLM to research how attributes work and how to best re-add this feature :)