The previous warning was detected at the decoding level, with the test
removed in an earlier commit. Here it is brought back, in the custom
profile processing level.
Keeping this warning will serve to prevent confusion, when people expect
to affect the 'debug' directory via the 'debug' profile to no effect,
where in fact the 'dev' profile is the profile that they opted to
change.
let add_unused = |warnings: &mut Warnings| {
for key in unused {
warnings.add_warning(format!("unused manifest key: {}", key));
- if key == "profile.debug" || key == "profiles.debug" {
+ if key == "profiles.debug" {
warnings.add_warning("use `[profile.dev]` to configure debug builds".to_string());
}
}
pub fn validate(&self, features: &Features, warnings: &mut Vec<String>) -> CargoResult<()> {
for (name, profile) in &self.0 {
+ if name == "debug" {
+ warnings.push("use `[profile.dev]` to configure debug builds".to_string());
+ }
+
profile.validate(&name, features, warnings)?;
}
Ok(())
.file("src/lib.rs", "")
.build();
+ p.cargo("build -Z named-profiles")
+ .masquerade_as_nightly_cargo()
+ .with_stderr(
+ "\
+warning: use `[profile.dev]` to configure debug builds
+[..]
+[..]",
+ )
+ .run();
+
p.cargo("build -Z named-profiles")
.masquerade_as_nightly_cargo()
.run();