-
Notifications
You must be signed in to change notification settings - Fork 1.8k
too_many_lines
: only highlight the function signature
#15461
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
base: master
Are you sure you want to change the base?
Conversation
for consistency with the other `check_fn`s
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
Lintcheck changes for 49666f6
This comment will be updated if you push new changes |
span, | ||
span.with_hi(decl.output.span().hi()), |
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.
You can pass in def_id
and use cx.tcx.def_span()
here
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.
Oh, thanks! I borrowed the decl
thing from too_many_arguments
, so I'll change that lint too then (in a separate PR)
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.
Though I don't quite understand why that span ends up being different from the one passed to check_fn
(which spans the whole function)?
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.
Looking at https://github.com/rust-lang/rust-clippy/actions/runs/16912149309#user-content-too-many-arguments (from a PR that changes too_many_arguments
to use def_span
as well), it looks like def_span
also includes the where
bounds -- and that's kind of unnecessary imo. What do you think?
as recommended in rust-lang#15461 (comment)
resolves #15430
changelog: [
too_many_lines
]: only highlight the function signature