Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,10 @@ impl Config {

fn check_deprecated_fields(&self) {
if !self.types.type_traits_mapping.is_empty() {
eprintln!(
"warning: `types.type-traits-mapping` is deprecated, use `types.custom` instead"
);
Warning::DeprecatedTypeTraitsMapping.emit();
}
if !self.types.type_attributes_mapping.is_empty() {
eprintln!(
"warning: `types.type-attributes-mapping` is deprecated, use `types.custom` instead"
);
Warning::DeprecatedTypeAttributesMapping.emit();
}
}

Expand Down
18 changes: 18 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@ pub(crate) enum Warning {
)
)]
IgnoredManifestRustVersion,
/// User set the deprecated `types.type-traits-mapping` field.
#[error("`types.type-traits-mapping` is deprecated")]
#[diagnostic(
severity(Warning),
help(
"Use `types.custom` instead. See https://cornucopia-rs.github.io/cornucopia/configuration.html#custom-type-mappings for more."
)
)]
DeprecatedTypeTraitsMapping,
/// User set the deprecated `types.type-attributes-mapping` field.
#[error("`types.type-attributes-mapping` is deprecated")]
#[diagnostic(
severity(Warning),
help(
"Use `types.custom` instead. See https://cornucopia-rs.github.io/cornucopia/configuration.html#custom-type-mappings for more."
)
)]
DeprecatedTypeAttributesMapping,
}

impl Warning {
Expand Down