diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-08-12 12:11:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 12:11:26 +0000 |
commit | 021e4953390da748515debfc8973149457d3118a (patch) | |
tree | 73573cba94d37ba75ad953f201fb15195bfeb027 /gcc/rust/backend/rust-compile-resolve-path.cc | |
parent | fadc70475147768a68ccc9e0011bd3fe85d90096 (diff) | |
parent | 8899dc9bf70b193dc59dbc8e81400de22c203e8f (diff) | |
parent | d4ddd73b0b8ddd44204844a4d650424539335899 (diff) | |
download | gcc-021e4953390da748515debfc8973149457d3118a.zip gcc-021e4953390da748515debfc8973149457d3118a.tar.gz gcc-021e4953390da748515debfc8973149457d3118a.tar.bz2 |
Merge #1465 #1467
1465: intrinsics: Add wrapping_{add, sub, mul} r=CohenArthur a=CohenArthur
Since wrapping arithmetics are guaranteed in Rust, we turn on the -fwrapv and simply desugar wrapping_{add, sub, mul} to their non-checked inner operations. This is the only difference between a wrapping add and a regular addition: The regular addition will gain some checks for overflows, which are simply not used for the wrapping version.
Fixes #1449
`@bjorn3` if you want to have a look :)
1467: Desugar HIR::IdentifierExpr into HIR::PathInExpression r=philberty a=philberty
This completly removes the HIR::IdentifierExpr and unifies how we handle
generics in general. There was a hack from last year that did not infer
generic arguments on IdentifierExpr's which leads to a type inferencing
behvaiour mismatch which was becoming difficult to debug. This simplifies
everything.
The changes to the test case reflect making our code more compliant to
real rustc apart from compile/traits3.rs which will be fixed as part of the
refactoring effort going on in the type system.
Fixes #1456
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Co-authored-by: Philip Herron <philip.herron@embecosm.com>