aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2024-10-11 17:53:50 +0100
committerPhilip Herron <philip.herron@embecosm.com>2024-10-25 10:59:25 +0000
commit8f23349aaf7ba6da4687ac2f4e00a0b680e0842a (patch)
tree7dcab9e0ec77ec746a8f81c4d553db7f2d11fef1 /gcc/rust/hir
parentd222c9356e47765b6872443b9b8d4ed8bf73d085 (diff)
downloadgcc-8f23349aaf7ba6da4687ac2f4e00a0b680e0842a.zip
gcc-8f23349aaf7ba6da4687ac2f4e00a0b680e0842a.tar.gz
gcc-8f23349aaf7ba6da4687ac2f4e00a0b680e0842a.tar.bz2
gccrs: Fix bad recursive operator overload call
When we are typechecking the impl block for DerefMut for &mut T the implementation follows the usual operator overload check but this ended up just resolving directly to the Trait definition which ends up being recursive which we usually handle. The issue we had is that a dereference call can be for either the DEREF or DEREF_MUT lang item here it was looking for a recurisve call to the DEREF lang item but we were in the DEREF_MUT lang item so this case was not accounted for. Fixes #3032 gcc/rust/ChangeLog: * typecheck/rust-hir-trait-reference.h: new get locus helper * typecheck/rust-hir-trait-resolve.cc (AssociatedImplTrait::get_locus): implemention * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::resolve_operator_overload): fix overload gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3032-1.rs: New test. * rust/compile/issue-3032-2.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/hir')
0 files changed, 0 insertions, 0 deletions