diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-02-05 15:48:02 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-30 13:51:49 +0200 |
| commit | 05b29f9a9295caf71fedfc24e6d7062bba434171 (patch) | |
| tree | 8c94ee91cac59af0af3d8fd0027c8a70f7c1d6c2 /compiler/rustc_infer/src | |
| parent | 71b4e2d852be70174579e7e5a96644418348a7da (diff) | |
| download | rust-05b29f9a9295caf71fedfc24e6d7062bba434171.tar.gz rust-05b29f9a9295caf71fedfc24e6d7062bba434171.zip | |
Inline WhereClause into Generics.
Diffstat (limited to 'compiler/rustc_infer/src')
| -rw-r--r-- | compiler/rustc_infer/src/infer/error_reporting/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/error_reporting/note.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index 14555ad9255..8f363cbe0de 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -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, diff --git a/compiler/rustc_infer/src/infer/error_reporting/note.rs b/compiler/rustc_infer/src/infer/error_reporting/note.rs index baea3e8285a..cbdcf013522 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/note.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/note.rs @@ -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!( "{} {}", |
