diff options
| author | Guanqun Lu <guanqun.lu@gmail.com> | 2019-10-01 15:22:52 +0800 |
|---|---|---|
| committer | Guanqun Lu <guanqun.lu@gmail.com> | 2019-10-02 09:06:37 +0800 |
| commit | 5abc5e9b3df85ec6fa22e67e0ea624cd225d2007 (patch) | |
| tree | c3855b0a4f3af1ba73e0f5bb4a3d12aa0f733c2b /src | |
| parent | 4cb86c908989087dca7d3ad2b5c9029c62aaf852 (diff) | |
| download | rust-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.rs | 8 |
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(); |
