Skip to content

Commit 59f0f2e

Browse files
committed
Fix span after rebase
1 parent 81394ce commit 59f0f2e

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/librustc_typeck/check/method/suggest.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
6969
error: MethodError<'tcx>,
7070
args: Option<&'gcx [hir::Expr]>,
7171
) {
72+
let orig_span = span;
7273
let mut span = span;
7374
// Avoid suggestions when we don't know what's going on.
7475
if rcvr_ty.references_error() {
@@ -397,7 +398,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
397398
}
398399
} else {
399400
err.span_label(span, format!("{} not found in `{}`", item_kind, ty_str));
400-
self.tcx.sess.trait_methods_not_found.borrow_mut().insert(span);
401+
self.tcx.sess.trait_methods_not_found.borrow_mut().insert(orig_span);
401402
}
402403

403404
if self.is_fn_ty(&rcvr_ty, span) {

src/test/ui/did_you_mean/bad-assoc-pat.stderr

+2-6
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ error[E0599]: no associated item named `AssocItem` found for type `u8` in the cu
6565
--> $DIR/bad-assoc-pat.rs:21:24
6666
|
6767
LL | ($ty: ty) => ($ty::AssocItem)
68-
| -----^^^^^^^^^
69-
| |
70-
| associated item not found in `u8`
68+
| ^^^^^^^^^ associated item not found in `u8`
7169
...
7270
LL | pat!(u8) => {}
7371
| -------- in this macro invocation
@@ -76,9 +74,7 @@ error[E0599]: no associated item named `AssocItem` found for type `u8` in the cu
7674
--> $DIR/bad-assoc-pat.rs:32:16
7775
|
7876
LL | ty!()::AssocItem => {}
79-
| -------^^^^^^^^^
80-
| |
81-
| associated item not found in `u8`
77+
| ^^^^^^^^^ associated item not found in `u8`
8278

8379
error: aborting due to 12 previous errors
8480

src/test/ui/issues/issue-58734.stderr

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ error[E0599]: no function or associated item named `nonexistent` found for type
22
--> $DIR/issue-58734.rs:20:12
33
|
44
LL | Trait::nonexistent(());
5-
| -------^^^^^^^^^^^
6-
| |
7-
| function or associated item not found in `dyn Trait`
5+
| ^^^^^^^^^^^ function or associated item not found in `dyn Trait`
86

97
error: aborting due to previous error
108

0 commit comments

Comments
 (0)