aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2024-11-01 16:18:28 +0000
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-21 12:32:55 +0100
commit0a30f01a61b7a945c29935bc6cb95cf1ba89bb91 (patch)
tree29bdd5c46c4a44842852c3baa9536bea6f18e521 /gcc/rust
parent2f0df594cf8a7b1a9a11bb947ff2a9ae4a82bc40 (diff)
downloadgcc-0a30f01a61b7a945c29935bc6cb95cf1ba89bb91.zip
gcc-0a30f01a61b7a945c29935bc6cb95cf1ba89bb91.tar.gz
gcc-0a30f01a61b7a945c29935bc6cb95cf1ba89bb91.tar.bz2
gccrs: fix bad type inferencing on path's
This catch to inject inference variables into generic paths was a catch all 'hack' that we needed before we handled generics correctly as we do now. Fixes #3009 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): remove hack gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3009.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-path.cc8
1 files changed, 0 insertions, 8 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-path.cc b/gcc/rust/typecheck/rust-hir-type-check-path.cc
index c655209..231ddd6 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-path.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-path.cc
@@ -490,14 +490,6 @@ TypeCheckExpr::resolve_segments (NodeId root_resolved_node_id,
}
rust_assert (resolved_node_id != UNKNOWN_NODEID);
- if (tyseg->needs_generic_substitutions () && !reciever_is_generic)
- {
- location_t locus = segments.back ().get_locus ();
- tyseg = SubstMapper::InferSubst (tyseg, locus);
- if (tyseg->get_kind () == TyTy::TypeKind::ERROR)
- return;
- }
-
context->insert_receiver (expr_mappings.get_hirid (), prev_segment);
// name scope first