stabilise cfg_attr

This commit is contained in:
dylan_DPC
2019-01-04 12:37:27 +05:30
parent 21ac19d8fe
commit 1ef99f1353
14 changed files with 7 additions and 94 deletions

View File

@@ -94,11 +94,6 @@ impl<'a> StripUnconfigured<'a> {
return vec![attr];
}
let gate_cfg_attr_multi = if let Some(ref features) = self.features {
!features.cfg_attr_multi
} else {
false
};
let cfg_attr_span = attr.span;
let (cfg_predicate, expanded_attrs) = match attr.parse(self.sess, |parser| {
@@ -130,21 +125,8 @@ impl<'a> StripUnconfigured<'a> {
// Check feature gate and lint on zero attributes in source. Even if the feature is gated,
// we still compute as if it wasn't, since the emitted error will stop compilation further
// along the compilation.
match (expanded_attrs.len(), gate_cfg_attr_multi) {
(0, false) => {
// FIXME: Emit unused attribute lint here.
},
(1, _) => {},
(_, true) => {
emit_feature_err(
self.sess,
"cfg_attr_multi",
cfg_attr_span,
GateIssue::Language,
"cfg_attr with zero or more than one attributes is experimental",
);
},
(_, false) => {}
if expanded_attrs.len() == 0 {
// FIXME: Emit unused attribute lint here.
}
if attr::cfg_matches(&cfg_predicate, self.sess, self.features) {