- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.8k
 
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing
Description
The lint does not detect the long function which is the second main in the example, however, it detects the problem in the first main.
The clippy.toml:
too-many-lines-threshold = 2The code:
#![deny(clippy::all)]
#![deny(clippy::pedantic)]
fn f() -> u16 {
    0
}
// This fails the check (should).
//fn main() {
//    println!("Hello, world!");
//    println!("Hello,1 world!");
//    println!("Hello,12 world!");
//}
// This passes (shouldn't).
fn main() {
    println!("Hello, world! {}", f());
    println!("Hello,1 world!");
    println!("Hello,12 world!");
    println!("Hello1, world!");
    println!("Hello,2 world!");
    println!("Hello, 5world!");
    println!("Hello, w6orld!");
}clippy 0.0.212 (b029042 2019-07-12)
I was able to reproduce the problem with a single println!("Hello, world! {}", f()) statement - every line after such a statement is not counted.
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing