-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
new lint: large_stack_frames
#10827
new lint: large_stack_frames
#10827
Conversation
r? @dswij (rustbot has picked a reviewer for you, use r? to override) |
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.
Just a small comment
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.
LGTM, thanks for the PR and the detailed description of the lint!
Seems like there's a conflict, can you help to rebase? I think it's good to merge afterward
ok, I rebased and also made the lint description a tiny bit easier to read (got rid of all the references to "MIR") |
@bors r+ |
new lint: `large_stack_frames` This implements a lint that looks for functions that use a lot of stack space. It uses the MIR because conveniently every temporary gets its own local and I think it maps best to stack space used in a function. It's probably going to be quite inaccurate in release builds, but at least for debug builds where opts are less aggressive on LLVM's side I think this is accurate "enough". (This does not work for generic functions yet. Not sure if I should try to get it working in this PR or if it could land without it for now and be added in a followup PR.) I also put it under the nursery category because this probably needs more work... changelog: new lint: [`large_stack_frames`]
💔 Test failed - checks-action_test |
@y21 Seems like you need to update https://github.com/rust-lang/rust-clippy/actions/runs/5230370766/jobs/9443890954 |
sorry, I wasn't home for most of the weekend. Updated |
☔ The latest upstream changes (presumably #10921) made this pull request unmergeable. Please resolve the merge conflicts. |
Thanks! Let's try that again 😄 @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This implements a lint that looks for functions that use a lot of stack space.
It uses the MIR because conveniently every temporary gets its own local and I think it maps best to stack space used in a function.
It's probably going to be quite inaccurate in release builds, but at least for debug builds where opts are less aggressive on LLVM's side I think this is accurate "enough".
(This does not work for generic functions yet. Not sure if I should try to get it working in this PR or if it could land without it for now and be added in a followup PR.)
I also put it under the nursery category because this probably needs more work...
changelog: new lint: [
large_stack_frames
]