File tree Expand file tree Collapse file tree 2 files changed +47
-10
lines changed Expand file tree Collapse file tree 2 files changed +47
-10
lines changed Original file line number Diff line number Diff line change @@ -520,16 +520,16 @@ impl TomlProfile {
520
520
features. require ( Feature :: named_profiles ( ) ) ?;
521
521
}
522
522
523
- if self . dir_name . is_some ( ) {
524
- features . require ( Feature :: named_profiles ( ) ) ? ;
525
- }
526
-
527
- // `dir-name` validation
528
- match & self . dir_name {
529
- None => { }
530
- Some ( dir_name ) => {
531
- Self :: validate_name ( dir_name , "dir- name" ) ? ;
532
- }
523
+ if let Some ( dir_name ) = self . dir_name {
524
+ // This is disabled for now, as we would like to stabilize named
525
+ // profiles without this, and then decide in the future if it is
526
+ // needed. This helps simplify the UI a little.
527
+ bail ! (
528
+ "dir-name= \" {} \" in profile `{}` is not currently allowed, \
529
+ directory names are tied to the profile name for custom profiles" ,
530
+ dir_name ,
531
+ name
532
+ ) ;
533
533
}
534
534
535
535
// `inherits` validation
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ Caused by:
100
100
}
101
101
102
102
#[ cargo_test]
103
+ #[ ignore] // dir-name is currently disabled
103
104
fn invalid_dir_name ( ) {
104
105
let p = project ( )
105
106
. file (
@@ -134,6 +135,42 @@ Caused by:
134
135
. run ( ) ;
135
136
}
136
137
138
+ #[ cargo_test]
139
+ fn dir_name_disabled ( ) {
140
+ let p = project ( )
141
+ . file (
142
+ "Cargo.toml" ,
143
+ r#"
144
+ cargo-features = ["named-profiles"]
145
+
146
+ [package]
147
+ name = "foo"
148
+ version = "0.1.0"
149
+
150
+ [profile.release-lto]
151
+ inherits = "release"
152
+ dir-name = "lto"
153
+ lto = true
154
+ "# ,
155
+ )
156
+ . file ( "src/lib.rs" , "" )
157
+ . build ( ) ;
158
+
159
+ p. cargo ( "build" )
160
+ . masquerade_as_nightly_cargo ( )
161
+ . with_status ( 101 )
162
+ . with_stderr (
163
+ "\
164
+ error: failed to parse manifest at `[ROOT]/foo/Cargo.toml`
165
+
166
+ Caused by:
167
+ dir-name=\" lto\" in profile `release-lto` is not currently allowed, \
168
+ directory names are tied to the profile name for custom profiles
169
+ " ,
170
+ )
171
+ . run ( ) ;
172
+ }
173
+
137
174
#[ cargo_test]
138
175
fn invalid_inherits ( ) {
139
176
let p = project ( )
You can’t perform that action at this time.
0 commit comments