Inline WhereClause into Generics.
This commit is contained in:
parent
71b4e2d852
commit
05b29f9a92
24 changed files with 98 additions and 139 deletions
|
@ -2543,11 +2543,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
let pred = format!("{}: {}", bound_kind, sub);
|
||||
let suggestion = format!(
|
||||
"{} {}",
|
||||
if !generics.where_clause.predicates.is_empty() { "," } else { " where" },
|
||||
if !generics.predicates.is_empty() { "," } else { " where" },
|
||||
pred,
|
||||
);
|
||||
err.span_suggestion(
|
||||
generics.where_clause.tail_span_for_suggestion(),
|
||||
generics.tail_span_for_predicate_suggestion(),
|
||||
"consider adding a where clause",
|
||||
suggestion,
|
||||
Applicability::MaybeIncorrect,
|
||||
|
|
|
@ -372,8 +372,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
.hir()
|
||||
.get_generics(impl_item_def_id)
|
||||
.unwrap()
|
||||
.where_clause
|
||||
.tail_span_for_suggestion();
|
||||
.where_clause_span
|
||||
.shrink_to_hi();
|
||||
|
||||
let suggestion = format!(
|
||||
"{} {}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue