Rollup merge of #118727 - compiler-errors:lint-decorate, r=WaffleLapkin
Don't pass lint back out of lint decorator Change the decorator function in the signature of the `emit_lint`/`span_lint`/etc family of methods from `impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>) -> &'b mut DiagnosticBuilder<'a, ()>` to `impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'a, ()>)`. I consider it easier to read this way, especially when there's control flow involved. r? nnethercote though feel free to reassign
This commit is contained in:
commit
58353fa458
38 changed files with 53 additions and 153 deletions
|
@ -661,7 +661,7 @@ pub(crate) fn prohibit_explicit_late_bound_lifetimes(
|
|||
args.args[0].hir_id(),
|
||||
multispan,
|
||||
msg,
|
||||
|lint| lint,
|
||||
|_| {},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
Applicability::MachineApplicable,
|
||||
);
|
||||
self.maybe_lint_blanket_trait_impl(self_ty, lint);
|
||||
lint
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1434,8 +1434,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
format!("<{} as {}>::{}", qself_ty, tcx.item_name(trait_did), assoc_ident),
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
|
||||
lint
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ pub fn check_abi(tcx: TyCtxt<'_>, hir_id: hir::HirId, span: Span, abi: Abi) {
|
|||
hir_id,
|
||||
span,
|
||||
"use of calling convention not supported on this target",
|
||||
|lint| lint,
|
||||
|_| {},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ fn check_static_inhabited(tcx: TyCtxt<'_>, def_id: LocalDefId) {
|
|||
"static of uninhabited type",
|
||||
|lint| {
|
||||
lint
|
||||
.note("uninhabited statics cannot be initialized, and any access would be an immediate error")
|
||||
.note("uninhabited statics cannot be initialized, and any access would be an immediate error");
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -1093,7 +1093,7 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
|
|||
"this {descr} contains `{field_ty}`, which {note}, \
|
||||
and makes it not a breaking change to become \
|
||||
non-zero-sized in the future."
|
||||
))
|
||||
));
|
||||
},
|
||||
)
|
||||
} else {
|
||||
|
|
|
@ -574,7 +574,6 @@ fn emit_implied_wf_lint<'tcx>(
|
|||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
}
|
||||
lint
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -276,7 +276,6 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> {
|
|||
lint.help(format!(
|
||||
"or use `{{{idx}:{default_modifier}}}` to keep the default formatting of `{default_result}`",
|
||||
));
|
||||
lint
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ fn check_unused_traits(tcx: TyCtxt<'_>, (): ()) {
|
|||
item.hir_id(),
|
||||
path.span,
|
||||
msg,
|
||||
|lint| lint,
|
||||
|_| {},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -522,7 +522,7 @@ fn lint_auto_trait_impl<'tcx>(
|
|||
format!(
|
||||
"try using the same sequence of generic parameters as the {self_descr} definition",
|
||||
),
|
||||
)
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
|
|||
param.hir_id,
|
||||
param.span,
|
||||
TYPE_DEFAULT_NOT_ALLOWED,
|
||||
|lint| lint,
|
||||
|_| {},
|
||||
);
|
||||
}
|
||||
Defaults::Deny => {
|
||||
|
|
|
@ -925,7 +925,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
|
|||
"you can use the `'static` lifetime directly, in place of `{}`",
|
||||
lifetime.ident,
|
||||
);
|
||||
lint.help(help)
|
||||
lint.help(help);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue