about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-03-23 14:10:29 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-03-23 14:10:39 -0700
commit59f0f2edc16131aa5ac199e1a348ceddebef1636 (patch)
tree21a63f586617cb0575664fc80c27498e50db93a5
parent81394ce9ae436595511e7a29e53875f2e62bf312 (diff)
downloadrust-59f0f2edc16131aa5ac199e1a348ceddebef1636.tar.gz
rust-59f0f2edc16131aa5ac199e1a348ceddebef1636.zip
Fix span after rebase
-rw-r--r--src/librustc_typeck/check/method/suggest.rs3
-rw-r--r--src/test/ui/did_you_mean/bad-assoc-pat.stderr8
-rw-r--r--src/test/ui/issues/issue-58734.stderr4
3 files changed, 5 insertions, 10 deletions
diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs
index cdb492b0979..7b530c69a88 100644
--- a/src/librustc_typeck/check/method/suggest.rs
+++ b/src/librustc_typeck/check/method/suggest.rs
@@ -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() {
@@ -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) {
diff --git a/src/test/ui/did_you_mean/bad-assoc-pat.stderr b/src/test/ui/did_you_mean/bad-assoc-pat.stderr
index 51c039760a4..59b865437a2 100644
--- a/src/test/ui/did_you_mean/bad-assoc-pat.stderr
+++ b/src/test/ui/did_you_mean/bad-assoc-pat.stderr
@@ -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
@@ -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
 
diff --git a/src/test/ui/issues/issue-58734.stderr b/src/test/ui/issues/issue-58734.stderr
index d2f356df7ce..07f2a046b2d 100644
--- a/src/test/ui/issues/issue-58734.stderr
+++ b/src/test/ui/issues/issue-58734.stderr
@@ -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