1
Fork 0

lint: port variant size difference diagnostics

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-06-28 09:52:05 +01:00
parent e5f2e0e16c
commit 14c3016583
3 changed files with 54 additions and 6 deletions

View file

@ -1387,12 +1387,9 @@ impl<'tcx> LateLintPass<'tcx> for VariantSizeDifferences {
VARIANT_SIZE_DIFFERENCES,
enum_definition.variants[largest_index].span,
|lint| {
lint.build(&format!(
"enum variant is more than three times \
larger ({} bytes) than the next largest",
largest
))
.emit();
lint.build(fluent::lint::variant_size_differences)
.set_arg("largest", largest)
.emit();
},
);
}