Skip to content

Commit

Permalink
Fix span after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 23, 2019
1 parent 81394ce commit 59f0f2e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/librustc_typeck/check/method/suggest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
error: MethodError<'tcx>,
args: Option<&'gcx [hir::Expr]>,
) {
let orig_span = span;
let mut span = span;
// Avoid suggestions when we don't know what's going on.
if rcvr_ty.references_error() {
Expand Down Expand Up @@ -397,7 +398,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
}
} else {
err.span_label(span, format!("{} not found in `{}`", item_kind, ty_str));
self.tcx.sess.trait_methods_not_found.borrow_mut().insert(span);
self.tcx.sess.trait_methods_not_found.borrow_mut().insert(orig_span);
}

if self.is_fn_ty(&rcvr_ty, span) {
Expand Down
8 changes: 2 additions & 6 deletions src/test/ui/did_you_mean/bad-assoc-pat.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ error[E0599]: no associated item named `AssocItem` found for type `u8` in the cu
--> $DIR/bad-assoc-pat.rs:21:24
|
LL | ($ty: ty) => ($ty::AssocItem)
| -----^^^^^^^^^
| |
| associated item not found in `u8`
| ^^^^^^^^^ associated item not found in `u8`
...
LL | pat!(u8) => {}
| -------- in this macro invocation
Expand All @@ -76,9 +74,7 @@ error[E0599]: no associated item named `AssocItem` found for type `u8` in the cu
--> $DIR/bad-assoc-pat.rs:32:16
|
LL | ty!()::AssocItem => {}
| -------^^^^^^^^^
| |
| associated item not found in `u8`
| ^^^^^^^^^ associated item not found in `u8`

error: aborting due to 12 previous errors

Expand Down
4 changes: 1 addition & 3 deletions src/test/ui/issues/issue-58734.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ error[E0599]: no function or associated item named `nonexistent` found for type
--> $DIR/issue-58734.rs:20:12
|
LL | Trait::nonexistent(());
| -------^^^^^^^^^^^
| |
| function or associated item not found in `dyn Trait`
| ^^^^^^^^^^^ function or associated item not found in `dyn Trait`

error: aborting due to previous error

Expand Down

0 comments on commit 59f0f2e

Please sign in to comment.