modified lint to work with MIR
Working with MIR let's us exclude expressions like `&fn_name as &dyn Something` and `(&fn_name)()`. Also added ABI, unsafety and whether a function is variadic in the lint suggestion, included the `&` in the span of the lint and updated the test.
This commit is contained in:
parent
975547d475
commit
3214de7359
7 changed files with 322 additions and 59 deletions
|
@ -2645,6 +2645,11 @@ declare_lint! {
|
|||
reference: "issue #76200 <https://github.com/rust-lang/rust/issues/76200>",
|
||||
edition: None,
|
||||
};
|
||||
|
||||
declare_lint! {
|
||||
pub FUNCTION_REFERENCES,
|
||||
Warn,
|
||||
"suggest casting functions to pointers when attempting to take references",
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
|
@ -2762,6 +2767,7 @@ declare_lint_pass! {
|
|||
CONST_EVALUATABLE_UNCHECKED,
|
||||
INEFFECTIVE_UNSTABLE_TRAIT_IMPL,
|
||||
UNINHABITED_STATIC,
|
||||
FUNCTION_REFERENCES,
|
||||
]
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue