-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Code
I tried this code:
#[main]
fn main() {}
I expected an error, because the main attribute has never been available on stable, and had apparently been removed in #84217.
Instead, the program ran without error, although the attribute has no apparent effect.
Version it worked on
It most recently worked as expected (emitting an error) on Rust 1.52.1:
$ cargo +1.52.1 build
Compiling regression-testing v0.0.0 (/Users/jeremy/src/github.com/jeremyBanks/rust-regression)
error[E0658]: declaration of a non-standard `#[main]` function may change over time, for now a top-level `fn main()` is required
--> src/main.rs:2:1
|
2 | fn main() {}
| ^^^^^^^^^^^^
|
= note: see issue #29634 <https://github.com/rust-lang/rust/issues/29634> for more information
Version with regression
This stopped being an error in 1.53.0 (in which a warning was still emitted), and continues to be accepted in stable through the current 1.58.1 version (in which the warning has also disappeared).
$ cargo +1.53.0 build
Compiling regression-testing v0.0.0 (/Users/jeremy/src/github.com/jeremyBanks/rust-regression)
warning: unused attribute
--> src/main.rs:1:1
|
1 | #[main]
| ^^^^^^^
|
= note: `#[warn(unused_attributes)]` on by default
$ cargo +1.58.1 build
Compiling regression-testing v0.0.0 (/Users/jeremy/src/github.com/jeremyBanks/rust-regression)
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.