File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -1028,7 +1028,13 @@ fn to_real_manifest(
1028
1028
}
1029
1029
1030
1030
if original_toml. project . is_some ( ) {
1031
- warnings. push ( format ! ( "`[project]` is deprecated in favor of `[package]`" ) ) ;
1031
+ if Edition :: Edition2024 <= edition {
1032
+ anyhow:: bail!(
1033
+ "`[project]` is not supported as of the 2024 Edition, please use `[package]`"
1034
+ ) ;
1035
+ } else {
1036
+ warnings. push ( format ! ( "`[project]` is deprecated in favor of `[package]`" ) ) ;
1037
+ }
1032
1038
}
1033
1039
1034
1040
if resolved_package. metabuild . is_some ( ) {
Original file line number Diff line number Diff line change @@ -1005,6 +1005,37 @@ fn warn_manifest_with_project() {
1005
1005
. run ( ) ;
1006
1006
}
1007
1007
1008
+ #[ cargo_test( nightly, reason = "edition2024" ) ]
1009
+ fn error_manifest_with_project_on_2024 ( ) {
1010
+ let p = project ( )
1011
+ . file (
1012
+ "Cargo.toml" ,
1013
+ r#"
1014
+ cargo-features = ["edition2024"]
1015
+
1016
+ [project]
1017
+ name = "foo"
1018
+ version = "0.0.1"
1019
+ edition = "2024"
1020
+ "# ,
1021
+ )
1022
+ . file ( "src/main.rs" , "fn main() {}" )
1023
+ . build ( ) ;
1024
+
1025
+ p. cargo ( "check" )
1026
+ . masquerade_as_nightly_cargo ( & [ "edition2024" ] )
1027
+ . with_status ( 101 )
1028
+ . with_stderr (
1029
+ "\
1030
+ [ERROR] failed to parse manifest at `[CWD]/Cargo.toml`
1031
+
1032
+ Caused by:
1033
+ `[project]` is not supported as of the 2024 Edition, please use `[package]`
1034
+ " ,
1035
+ )
1036
+ . run ( ) ;
1037
+ }
1038
+
1008
1039
#[ cargo_test]
1009
1040
fn warn_manifest_package_and_project ( ) {
1010
1041
let p = project ( )
You can’t perform that action at this time.
0 commit comments