1
Fork 0

Implementation of incompatible features error

If two features are defined as incompatible, using them together would
result in an error
This commit is contained in:
Amjad Alsharafi 2020-09-04 01:47:35 +08:00
parent 08deb863bd
commit 8f2d9069a8
5 changed files with 60 additions and 1 deletions

View file

@ -605,3 +605,8 @@ pub const INCOMPLETE_FEATURES: &[Symbol] = &[
sym::lazy_normalization_consts,
sym::specialization,
];
/// Some features are not allowed to be used together at the same time, if
/// the two are present, produce an error
pub const INCOMPATIBLE_FEATURES: &[(Symbol, Symbol)] =
&[(sym::const_generics, sym::min_const_generics)];

View file

@ -131,7 +131,7 @@ pub fn find_feature_issue(feature: Symbol, issue: GateIssue) -> Option<NonZeroU3
}
pub use accepted::ACCEPTED_FEATURES;
pub use active::{Features, ACTIVE_FEATURES, INCOMPLETE_FEATURES};
pub use active::{Features, ACTIVE_FEATURES, INCOMPATIBLE_FEATURES, INCOMPLETE_FEATURES};
pub use builtin_attrs::{
deprecated_attributes, find_gated_cfg, is_builtin_attr_name, AttributeGate, AttributeTemplate,
AttributeType, BuiltinAttribute, GatedCfg, BUILTIN_ATTRIBUTES, BUILTIN_ATTRIBUTE_MAP,