about summary refs log tree commit diff
path: root/clippy_lints/src/multiple_bound_locations.rs
diff options
context:
space:
mode:
Diffstat (limited to 'clippy_lints/src/multiple_bound_locations.rs')
-rw-r--r--clippy_lints/src/multiple_bound_locations.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/clippy_lints/src/multiple_bound_locations.rs b/clippy_lints/src/multiple_bound_locations.rs
index d608f3bf7b4..d276e29bace 100644
--- a/clippy_lints/src/multiple_bound_locations.rs
+++ b/clippy_lints/src/multiple_bound_locations.rs
@@ -6,7 +6,7 @@ use rustc_session::declare_lint_pass;
 use rustc_span::Span;
 
 use clippy_utils::diagnostics::span_lint;
-use clippy_utils::source::snippet_opt;
+use clippy_utils::source::SpanRangeExt;
 
 declare_clippy_lint! {
     /// ### What it does
@@ -54,8 +54,10 @@ impl EarlyLintPass for MultipleBoundLocations {
                 match clause {
                     WherePredicate::BoundPredicate(pred) => {
                         if (!pred.bound_generic_params.is_empty() || !pred.bounds.is_empty())
-                            && let Some(name) = snippet_opt(cx, pred.bounded_ty.span)
-                            && let Some(bound_span) = generic_params_with_bounds.get(name.as_str())
+                            && let Some(Some(bound_span)) = pred
+                                .bounded_ty
+                                .span
+                                .with_source_text(cx, |src| generic_params_with_bounds.get(src))
                         {
                             emit_lint(cx, *bound_span, pred.bounded_ty.span);
                         }