aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-edge.cc
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2023-05-25 17:43:31 +0100
committerPhilip Herron <philip.herron@embecosm.com>2023-05-26 16:28:04 +0000
commit2d806801404fc7628a3d022da92b73cd06197f49 (patch)
tree501116f5b32b72b897f2d6ead3f205d3f5052bc8 /gcc/gimple-range-edge.cc
parentd47f52a583133e7ea1b703bdc1e0461aa650a414 (diff)
downloadgcc-2d806801404fc7628a3d022da92b73cd06197f49.zip
gcc-2d806801404fc7628a3d022da92b73cd06197f49.tar.gz
gcc-2d806801404fc7628a3d022da92b73cd06197f49.tar.bz2
gccrs: Fix bounds checking to check both sides
We were missing bounds checking for both lhs and rhs directions this is important as we might fail checking for all specified bounds properly. This is why for #2236 we need the Type parameter T to realise that it _cannot_ coerce to the i32 max function directly without any adjustments because T has the specified bound of Deref but i32 does not implement Deref. This indrectly forces the autoderef cycle to try a deref in order to get an i32 which _will_ match the i32 max function in the case we pass an &32 as the type parameter T. Fixes #2236 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): stop if error * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::assemble_sized_builtin): fix sized options * typecheck/rust-tyty.cc (BaseType::satisfies_bound): its ok if its an ?T (BaseType::bounds_compatible): likewise * typecheck/rust-tyty.h: update prototype * typecheck/rust-unify.cc (UnifyRules::go): check both sides bounds gcc/testsuite/ChangeLog: * rust/execute/torture/issue-2236.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/gimple-range-edge.cc')
0 files changed, 0 insertions, 0 deletions