about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuanqun Lu <guanqun.lu@gmail.com>2019-10-01 15:22:52 +0800
committerGuanqun Lu <guanqun.lu@gmail.com>2019-10-02 09:06:37 +0800
commit5abc5e9b3df85ec6fa22e67e0ea624cd225d2007 (patch)
treec3855b0a4f3af1ba73e0f5bb4a3d12aa0f733c2b /src
parent4cb86c908989087dca7d3ad2b5c9029c62aaf852 (diff)
downloadrust-5abc5e9b3df85ec6fa22e67e0ea624cd225d2007.tar.gz
rust-5abc5e9b3df85ec6fa22e67e0ea624cd225d2007.zip
add FIXME and use 'span_label'
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/check/method/suggest.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs
index 89055628342..e9a8a52857a 100644
--- a/src/librustc_typeck/check/method/suggest.rs
+++ b/src/librustc_typeck/check/method/suggest.rs
@@ -519,11 +519,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 }
 
                 if item_name.as_str() == "as_str" && actual.peel_refs().is_str() {
-                    err.span_suggestion(
+                    // FIXME: the span is not quite correct, it should point to ".as_str()" instead
+                    // of just "as_str".
+                    err.span_label(
                         span,
-                        "try removing `as_str`",
-                        String::new(),
-                        Applicability::MaybeIncorrect,
+                        "try removing `as_str`"
                     );
                 } else if let Some(lev_candidate) = lev_candidate {
                     let def_kind = lev_candidate.def_kind();