fix: misleading add dyn
to derive macro suggestion
This commit is contained in:
parent
44a500c8c1
commit
1caec6fa1d
3 changed files with 42 additions and 1 deletions
|
@ -3307,7 +3307,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
|||
let label = "add `dyn` keyword before this trait";
|
||||
let mut diag =
|
||||
rustc_errors::struct_span_err!(tcx.sess, self_ty.span, E0782, "{}", msg);
|
||||
diag.multipart_suggestion_verbose(label, sugg, Applicability::MachineApplicable);
|
||||
if self_ty.span.can_be_used_for_suggestions() {
|
||||
diag.multipart_suggestion_verbose(
|
||||
label,
|
||||
sugg,
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
}
|
||||
// check if the impl trait that we are considering is a impl of a local trait
|
||||
self.maybe_lint_blanket_trait_impl(&self_ty, &mut diag);
|
||||
diag.emit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue