]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: fix unsafe lookup at zero index
authorPhilip Herron <herron.philip@googlemail.com>
Tue, 20 Jun 2023 09:39:54 +0000 (10:39 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:46:28 +0000 (18:46 +0100)
commit946af759bdc029c1bbd3d6349ad5f80098bc30e3
tree73923514a85b1edf1b232b3939def35b79df6f75
parent8bc4ce7c40be159c83d623beb4cb074e1b5b0daa
gccrs: fix unsafe lookup at zero index

Using lookup_predciate by DefId is the safe way to get the relevant
predicate.

Addresses #1893

gcc/rust/ChangeLog:

* typecheck/rust-hir-trait-resolve.cc: use lookup_predicate (DefID)
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): fix formatting

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-hir-trait-resolve.cc
gcc/rust/typecheck/rust-hir-type-check-path.cc