Add allow-by-default lint for unit bindings
This lint is not triggered if any of the following conditions are met: - The user explicitly annotates the binding with the `()` type. - The binding is from a macro expansion. - The user explicitly wrote `let () = init;` - The user explicitly wrote `let pat = ();`. This is allowed for local lifetimes.
This commit is contained in:
@@ -1845,3 +1845,10 @@ impl<'a> DecorateLint<'a, ()> for AsyncFnInTraitDiag {
|
||||
fluent::lint_async_fn_in_trait
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(lint_unit_bindings)]
|
||||
pub struct UnitBindingsDiag {
|
||||
#[label]
|
||||
pub label: Span,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user