]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #8896 - Alexendoo:fn_sig_ice, r=llogiq
authorbors <bors@rust-lang.org>
Thu, 26 May 2022 16:33:30 +0000 (16:33 +0000)
committerbors <bors@rust-lang.org>
Thu, 26 May 2022 16:33:30 +0000 (16:33 +0000)
Only return `DefId`s to `Fn`-like definitions in `clippy_utils::fn_def_id`

Fixes #8850

in `returns.rs` `tcx.fn_sig` is called on the result of `fn_def_id`, which panics if the def is a `const`/`static`/etc rather than a functions definition

https://github.com/rust-lang/rust-clippy/blob/bc4d39e5fea64970dded1e6d2132d41435c0ef24/clippy_lints/src/returns.rs#L294-L303

changelog: Fix ICE due to callable `static`/`const`s


Trivial merge