-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.Z-scriptNightly: cargo scriptNightly: cargo script
Description
Problem
From #12207 (comment)
I don't think a warning should be printed on a script without any frontmatter.
fn main() {
println!("hello world");
}Gives output:
warning: `package.edition` is unspecified, defaulting to `2024`
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s
Running `/Users/nate/.cargo/build/cd/32beff75ef4495/target/debug/foo`
hello world
Proposed Solution
Do not emit warning when no edition is specified for a cargo script. Defaulting to the latest edition is a perfectly reasonable default, and is what anyone would expect. Warnings on bare rust scripts without frontmatter are unnecessary noise for users who may not care about edition stability. If you care about stability, you can still specify it easily with frontmatter.
Notes
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.Z-scriptNightly: cargo scriptNightly: cargo script