-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: emit error when shuttle::main is named main (#707)
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#[shuttle_codegen::main] | ||
async fn main() -> ShuttleRocket {} |
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: shuttle_runtime::main functions cannot be named `main` | ||
--> tests/ui/main/duplicate-main-fn.rs:2:10 | ||
| | ||
2 | async fn main() -> ShuttleRocket {} | ||
| ^^^^ | ||
|
||
error[E0601]: `main` function not found in crate `$CRATE` | ||
--> tests/ui/main/duplicate-main-fn.rs:2:36 | ||
| | ||
2 | async fn main() -> ShuttleRocket {} | ||
| ^ consider adding a `main` function to `$DIR/tests/ui/main/duplicate-main-fn.rs` |