-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Apply mismatched-lifetime-syntaxes
to trait and extern functions
#142129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply mismatched-lifetime-syntaxes
to trait and extern functions
#142129
Conversation
|
This comment has been minimized.
This comment has been minimized.
f1c3313
to
9c6320a
Compare
Waiting a bit for discussions in #t-lang > Feedback on mismatched_lifetime_syntaxes. I'll come back to this approx. next Wednesday. |
@rustbot note check-impact-for-svd2rust (Reminder for myself) check impact of expanding the lint against https://github.com/rust-embedded/svd2rust -> https://github.com/stm32-rs/stm32-rs. |
@rustbot note perf-before-merge (Reminder for myself) check perf before merge, even tho again I expect this to be dominated by warning emission cost. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The implementation and tests look good to me. We should:
- Check the perf impact.
- Check if
svd2rust
is again impacted (if they use trait generators that exhibit the problem, it's possible that the fix of the generator is quite trivial but may impact generated crates likestm32f4
a lot for local dev builds).
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…ke-places, r=<try> Apply `mismatched-lifetime-syntaxes` to trait and extern functions r? `@jieyouxu` <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_SUMMARY_START --> ### Summary Notes - [check-impact-for-svd2rust](#142129 (comment)) by [jieyouxu](https://github.com/jieyouxu) - [perf-before-merge](#142129 (comment)) by [jieyouxu](https://github.com/jieyouxu) *Managed by ``@rustbot`—see` [help](https://forge.rust-lang.org/triagebot/note.html) for details* <!-- TRIAGEBOT_SUMMARY_END --> <!-- TRIAGEBOT_END -->
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (39a127b): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never 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.3%, secondary 4.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 754.356s -> 753.447s (-0.12%) |
Looked at the perf results. @rustbot note remove perf-before-merge |
I looked at stm32-rs (whose crates are generated with
Looks like this will cause quite a few new warnings. Very rough examples (they exhibit the same pattern):
Looks like the way the embedded crates are setup involves quite a few traits which will then trigger this lint expansion. I might look into |
I tried to jump ahead here, but it's always possible I made a misstep:
I think the code you tested is using the released
Looking at the generated
Many of these only have associated constants or types, and the few that have methods look unsuspicious to me. |
Ah sorry, I think you're right. I'll revisit this. |
I think you're right, thanks for the correction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The impl otherwise looks good. Do you think we should update the lint docs to also add two examples, one for a trait method, and another for extern fn?
Tl;dr: no. My first thought is that checking these functions would be the “expected” behavior of the lint, so calling them out in the docs would be more confusing and showing more of an implementation detail than a functional change. |
I'll tag this will relnotes, but then explicitly close it and backlink that relnotes to the relnotes for the "base" lint PR. @rustbot label: +relnotes |
☀️ Test successful - checks-actions |
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 9822e3d (parent) -> 4a73e3c (this PR) Test differencesShow 4 test diffs4 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 4a73e3c224465c0c0e71b39b479a0911460dd794 --output-dir test-dashboard And 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 (4a73e3c): comparison URL. Overall result: ❌ regressions - no action needed@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 1.0%, secondary -1.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 4.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 757.645s -> 757.535s (-0.01%) |
r? @jieyouxu