}
impl TomlProfiles {
- fn validate(&self, features: &Features) -> CargoResult<()> {
+ fn validate(&self, features: &Features, warnings: &mut Vec<String>) -> CargoResult<()> {
if let Some(ref test) = self.test {
- test.validate("test", features)?;
+ test.validate("test", features, warnings)?;
}
if let Some(ref doc) = self.doc {
- doc.validate("doc", features)?;
+ doc.validate("doc", features, warnings)?;
}
if let Some(ref bench) = self.bench {
- bench.validate("bench", features)?;
+ bench.validate("bench", features, warnings)?;
}
if let Some(ref dev) = self.dev {
- dev.validate("dev", features)?;
+ dev.validate("dev", features, warnings)?;
}
if let Some(ref release) = self.release {
- release.validate("release", features)?;
+ release.validate("release", features, warnings)?;
}
Ok(())
}
}
impl TomlProfile {
- fn validate(&self, name: &str, features: &Features) -> CargoResult<()> {
+ fn validate(
+ &self,
+ name: &str,
+ features: &Features,
+ warnings: &mut Vec<String>,
+ ) -> CargoResult<()> {
if let Some(ref profile) = self.build_override {
features.require(Feature::profile_overrides())?;
profile.validate_override()?;
}
}
}
+
+ match name {
+ "test" | "bench" => {
+ if self.panic.is_some() {
+ warnings.push(format!("`panic` setting is ignored for `{}` profile", name))
+ }
+ }
+ _ => {}
+ }
Ok(())
}
),
};
if let Some(ref profiles) = me.profile {
- profiles.validate(&features)?;
+ profiles.validate(&features, &mut warnings)?;
}
let profiles = build_profiles(&me.profile);
let publish = match project.publish {