about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
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();