1
Fork 0

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:
Jubilee 2023-12-15 14:08:16 -08:00 committed by GitHub
commit 58353fa458
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 53 additions and 153 deletions

View file

@ -273,7 +273,6 @@ fn overlap<'tcx>(
causing the impls to overlap",
infcx.resolve_vars_if_possible(failing_obligation.predicate)
));
lint
},
);
}

View file

@ -194,7 +194,6 @@ fn lint_object_unsafe_trait(
// Only provide the help if its a local trait, otherwise it's not
violation.solution().add_to(err);
}
err
},
);
}

View file

@ -450,7 +450,6 @@ fn report_conflicting_impls<'tcx>(
msg,
|err| {
decorate(tcx, &overlap, impl_span, err);
err
},
);
}