2023-09-06 14:58:44 +00:00
|
|
|
//@ignore-32bit
|
2023-07-27 13:23:04 +00:00
|
|
|
//@aux-build:proc_macros.rs
|
2023-06-14 12:16:56 +00:00
|
|
|
#![allow(clippy::redundant_closure_call, unused)]
|
2023-06-14 11:48:34 +00:00
|
|
|
#![warn(clippy::single_call_fn)]
|
|
|
|
#![no_main]
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate proc_macros;
|
|
|
|
|
|
|
|
// Do not lint since it's public
|
|
|
|
pub fn f() {}
|
|
|
|
|
2023-06-14 12:16:56 +00:00
|
|
|
fn i() {}
|
|
|
|
fn j() {}
|
|
|
|
|
|
|
|
fn h() {
|
|
|
|
// Linted
|
|
|
|
let a = i;
|
|
|
|
// Do not lint closures
|
|
|
|
let a = (|| {
|
|
|
|
// Not linted
|
|
|
|
a();
|
|
|
|
// Imo, it's reasonable to lint this as the function is still only being used once. Just in
|
|
|
|
// a closure.
|
|
|
|
j();
|
|
|
|
});
|
|
|
|
a();
|
|
|
|
}
|
|
|
|
|
2023-06-14 11:48:34 +00:00
|
|
|
fn g() {
|
|
|
|
f();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn c() {
|
|
|
|
println!("really");
|
|
|
|
println!("long");
|
|
|
|
println!("function...");
|
|
|
|
}
|
|
|
|
|
|
|
|
fn d() {
|
|
|
|
c();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn a() {}
|
|
|
|
|
|
|
|
fn b() {
|
|
|
|
a();
|
|
|
|
|
|
|
|
external! {
|
|
|
|
fn lol() {
|
|
|
|
lol_inner();
|
|
|
|
}
|
|
|
|
fn lol_inner() {}
|
|
|
|
}
|
|
|
|
with_span! {
|
|
|
|
span
|
|
|
|
fn lol2() {
|
|
|
|
lol2_inner();
|
|
|
|
}
|
|
|
|
fn lol2_inner() {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn e() {
|
|
|
|
b();
|
|
|
|
b();
|
|
|
|
}
|
2023-06-18 01:00:36 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn k() {}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn l() {
|
|
|
|
k();
|
|
|
|
}
|