UNUSED_MACROS,
node_id,
ident.span,
- &format!("unused macro definition: `{}`", ident.as_str()),
+ &format!("unused macro definition: `{}`", ident.name),
);
}
for (&(def_id, arm_i), &(ident, rule_span)) in self.unused_macro_rules.iter() {
&format!(
"{} rule of macro `{}` is never used",
crate::diagnostics::ordinalize(arm_i + 1),
- ident.as_str()
+ ident.name
),
);
}
) {
let span = path.span;
if let Some(stability) = &ext.stability {
- if let StabilityLevel::Unstable { reason, issue, is_soft } = stability.level {
+ if let StabilityLevel::Unstable { reason, issue, is_soft, implied_by } = stability.level
+ {
let feature = stability.feature;
- if !self.active_features.contains(&feature) && !span.allows_unstable(feature) {
+
+ let is_allowed = |feature| {
+ self.active_features.contains(&feature) || span.allows_unstable(feature)
+ };
+ let allowed_by_implication =
+ implied_by.map(|feature| is_allowed(feature)).unwrap_or(false);
+ if !is_allowed(feature) && !allowed_by_implication {
let lint_buffer = &mut self.lint_buffer;
let soft_handler =
|lint, span, msg: &_| lint_buffer.buffer_lint(lint, node_id, span, msg);
stability::report_unstable(
self.session,
feature,
- reason,
+ reason.to_opt_reason(),
issue,
None,
is_soft,