-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Jun 17, 2019
1 parent
6804156
commit 73978a1
Showing
7 changed files
with
57 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#![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 `main()` | ||
--> $DIR/entrypoint_recursion.rs:8: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 | ||
|
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 `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 | ||
|