lint: port missing debug impl diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
28655bc955
commit
284ec37810
@ -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-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) {
|
||||
cx.struct_span_lint(MISSING_DEBUG_IMPLEMENTATIONS, item.span, |lint| {
|
||||
lint.build(&format!(
|
||||
"type does not implement `{}`; consider adding `#[derive(Debug)]` \
|
||||
or a manual implementation",
|
||||
cx.tcx.def_path_str(debug)
|
||||
))
|
||||
.emit();
|
||||
lint.build(fluent::lint::builtin_missing_debug_impl)
|
||||
.set_arg("debug", cx.tcx.def_path_str(debug))
|
||||
.emit();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user