about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorJonathan Brouwer <jonathantbrouwer@gmail.com>2025-06-14 00:08:28 +0200
committerJonathan Brouwer <jonathantbrouwer@gmail.com>2025-06-14 00:08:28 +0200
commit1d036f408efa6e12b2fcd35588b4595fde5b0af2 (patch)
treec8fb31bea7fcfff831c569584f3ebfb4c14c1529 /compiler
parentc9995d2492dc94ea92ac6639ac8757199da749d0 (diff)
downloadrust-1d036f408efa6e12b2fcd35588b4595fde5b0af2.tar.gz
rust-1d036f408efa6e12b2fcd35588b4595fde5b0af2.zip
Fix incorrect suggestion when calling an associated type with a type anchor
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir_typeck/src/method/suggest.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs
index 6cb53bbd745..288d915e85c 100644
--- a/compiler/rustc_hir_typeck/src/method/suggest.rs
+++ b/compiler/rustc_hir_typeck/src/method/suggest.rs
@@ -724,7 +724,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             {
                 let def_path = tcx.def_path_str(adt_def.did());
                 err.span_suggestion(
-                    ty.span.to(item_ident.span),
+                    sugg_span,
                     format!("to construct a value of type `{}`, use the explicit path", def_path),
                     def_path,
                     Applicability::MachineApplicable,