aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2021-10-05 14:43:24 +0100
committerPhilip Herron <philip.herron@embecosm.com>2021-10-05 14:43:24 +0100
commit591b43e42e7f63841ce46fdd4f2760e47b6a7b0d (patch)
treeca78a39cfaa6563575ad6567d5cd30484bfcd08a /gcc/rust/backend/rust-compile-expr.h
parent6cd07341b1057961bebc8c11d70909ccac781113 (diff)
downloadgcc-591b43e42e7f63841ce46fdd4f2760e47b6a7b0d.zip
gcc-591b43e42e7f63841ce46fdd4f2760e47b6a7b0d.tar.gz
gcc-591b43e42e7f63841ce46fdd4f2760e47b6a7b0d.tar.bz2
Coercion site type checking in CallExprs must hold onto the argument type
Coercion sites like CallExpr arguments must coerce the arguments for type checking, but we must still insert the type of the actual argument for that mapping not the coerced type. For example we might have: ```rust fn dynamic_dispatch(t: &dyn Bar) { t.baz(); } fn main() { let a = &Foo(123); dynamic_dispatch(a); } ``` Here the argument 'a' has a type of (&ADT{Foo}) but this is coerceable to (&dyn{Bar}) which is fine. The backend needs to be able to detect the coercion from the two types in order to generate the vtable code. This patch fixes the type checking such that we store the actual type of (&ADT{Foo}) at that argument mapping instead of the coerced one. Addresses: #700
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.h')
0 files changed, 0 insertions, 0 deletions