lint: port variant size difference diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
e5f2e0e16c
commit
14c3016583
3 changed files with 54 additions and 6 deletions
|
@ -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();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue