Skip to content

Commit 2580348

Browse files
committed
Use span_look_ahead instead of next_point
1 parent 20f3f43 commit 2580348

File tree

1 file changed

+3
-6
lines changed
  • compiler/rustc_trait_selection/src/traits/error_reporting

1 file changed

+3
-6
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1367,12 +1367,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
13671367

13681368
// Issue #109436, we need to add parentheses properly for method calls
13691369
// for example, `foo.into()` should be `(&foo).into()`
1370-
if let Ok(snippet) = self
1371-
.tcx
1372-
.sess
1373-
.source_map()
1374-
.span_to_snippet(self.tcx.sess.source_map().next_point(span))
1375-
{
1370+
if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(
1371+
self.tcx.sess.source_map().span_look_ahead(span, Some("."), Some(50)),
1372+
) {
13761373
if snippet == "." {
13771374
err.multipart_suggestion_verbose(
13781375
sugg_msg,

0 commit comments

Comments
 (0)