mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
lint: port trivial bounds diagnostics
Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
01a64af4dd
commit
3c9bda5b20
@ -366,3 +366,5 @@ lint-builtin-type-alias-where-clause = where clauses are not enforced in type al
|
||||
|
||||
lint-builtin-type-alias-generic-bounds = bounds on generic parameters are not enforced in type aliases
|
||||
.suggestion = the bound will not be checked when the type alias is used, and should be removed
|
||||
|
||||
lint-builtin-trivial-bounds = {$predicate_kind_name} bound {$predicate} does not depend on any type or lifetime parameters
|
||||
|
@ -1671,12 +1671,10 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
|
||||
};
|
||||
if predicate.is_global() {
|
||||
cx.struct_span_lint(TRIVIAL_BOUNDS, span, |lint| {
|
||||
lint.build(&format!(
|
||||
"{} bound {} does not depend on any type \
|
||||
or lifetime parameters",
|
||||
predicate_kind_name, predicate
|
||||
))
|
||||
.emit();
|
||||
lint.build(fluent::lint::builtin_trivial_bounds)
|
||||
.set_arg("predicate_kind_name", predicate_kind_name)
|
||||
.set_arg("predicate", predicate)
|
||||
.emit();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user