Skip to content

Commit 5abc5e9

Browse files
author
Guanqun Lu
committed
add FIXME and use 'span_label'
1 parent 4cb86c9 commit 5abc5e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_typeck/check/method/suggest.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
519519
}
520520

521521
if item_name.as_str() == "as_str" && actual.peel_refs().is_str() {
522-
err.span_suggestion(
522+
// FIXME: the span is not quite correct, it should point to ".as_str()" instead
523+
// of just "as_str".
524+
err.span_label(
523525
span,
524-
"try removing `as_str`",
525-
String::new(),
526-
Applicability::MaybeIncorrect,
526+
"try removing `as_str`"
527527
);
528528
} else if let Some(lev_candidate) = lev_candidate {
529529
let def_kind = lev_candidate.def_kind();

0 commit comments

Comments
 (0)