-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move expression check to LateLintPass
Changes: - Move from EarlyLintPass - Fix entrypoint check with function path def_id.
- Loading branch information
Vincent Dal Maso
committed
Jul 11, 2019
1 parent
6d193e3
commit d456959
Showing
10 changed files
with
72 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// ignore-macos | ||
// ignore-windows | ||
|
||
#![feature(main)] | ||
|
||
#[warn(clippy::main_recursion)] | ||
#[allow(unconditional_recursion)] | ||
#[main] | ||
fn a() { | ||
println!("Hello, World!"); | ||
a(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error: recursing into entrypoint `a` | ||
--> $DIR/entrypoint_recursion.rs:11:5 | ||
| | ||
LL | a(); | ||
| ^ | ||
| | ||
= note: `-D clippy::main-recursion` implied by `-D warnings` | ||
= help: consider using another function for this recursion | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#[warn(clippy::main_recursion)] | ||
#[allow(unconditional_recursion)] | ||
fn main() { | ||
println!("Hello, World!"); | ||
main(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
error: You are recursing into main() | ||
--> $DIR/std_main_recursion.rs:4:5 | ||
error: recursing into entrypoint `main` | ||
--> $DIR/std_main_recursion.rs:5:5 | ||
| | ||
LL | main(); | ||
| ^^^^^^ | ||
| ^^^^ | ||
| | ||
= note: `-D clippy::main-recursion` implied by `-D warnings` | ||
= help: Consider using another function for this recursion | ||
= help: consider using another function for this recursion | ||
|
||
error: aborting due to previous error | ||
|