lint: port missing debug impl diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
28655bc955
commit
284ec37810
2 changed files with 6 additions and 6 deletions
|
@ -328,3 +328,6 @@ lint-builtin-impl-unsafe-method = implementation of an `unsafe` method
|
||||||
lint-builtin-missing-doc = missing documentation for {$article} {$desc}
|
lint-builtin-missing-doc = missing documentation for {$article} {$desc}
|
||||||
|
|
||||||
lint-builtin-missing-copy-impl = type could implement `Copy`; consider adding `impl Copy`
|
lint-builtin-missing-copy-impl = type could implement `Copy`; consider adding `impl Copy`
|
||||||
|
|
||||||
|
lint-builtin-missing-debug-impl =
|
||||||
|
type does not implement `{$debug}`; consider adding `#[derive(Debug)]` or a manual implementation
|
||||||
|
|
|
@ -857,12 +857,9 @@ impl<'tcx> LateLintPass<'tcx> for MissingDebugImplementations {
|
||||||
|
|
||||||
if !self.impling_types.as_ref().unwrap().contains(&item.def_id) {
|
if !self.impling_types.as_ref().unwrap().contains(&item.def_id) {
|
||||||
cx.struct_span_lint(MISSING_DEBUG_IMPLEMENTATIONS, item.span, |lint| {
|
cx.struct_span_lint(MISSING_DEBUG_IMPLEMENTATIONS, item.span, |lint| {
|
||||||
lint.build(&format!(
|
lint.build(fluent::lint::builtin_missing_debug_impl)
|
||||||
"type does not implement `{}`; consider adding `#[derive(Debug)]` \
|
.set_arg("debug", cx.tcx.def_path_str(debug))
|
||||||
or a manual implementation",
|
.emit();
|
||||||
cx.tcx.def_path_str(debug)
|
|
||||||
))
|
|
||||||
.emit();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue