]> git.lizzy.rs Git - rust.git/commitdiff
Fix span after rebase
authorEsteban Küber <esteban@kuber.com.ar>
Sat, 23 Mar 2019 21:10:29 +0000 (14:10 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Sat, 23 Mar 2019 21:10:39 +0000 (14:10 -0700)
src/librustc_typeck/check/method/suggest.rs
src/test/ui/did_you_mean/bad-assoc-pat.stderr
src/test/ui/issues/issue-58734.stderr

index cdb492b09798bf457582739f5bd0a3c78d53f743..7b530c69a88820aea6503e2dbf18d4b95e621b7a 100644 (file)
@@ -69,6 +69,7 @@ pub fn report_method_error<'b>(
         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 @@ pub fn report_method_error<'b>(
                     }
                 } 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) {
index 51c039760a4f4f2bf1c96eace51b8f5849a2498e..59b865437a2e0f724c7b3505e009d71b225c40dc 100644 (file)
@@ -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
 
index d2f356df7ced3b1e2b00759e378fa28e54d172ca..07f2a046b2dbbbcab2639babcc243fca79a0779f 100644 (file)
@@ -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