You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch implements the 'dispatch_from_dyn' lang item specifically for
'Box'. While there are other smart pointers and types that require this
lang item for dynamic dispatch, they are omitted in this patch as they
are not yet fully supported by the compiler.
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Handle Box
receivers correctly during dynamic dispatch.
* typecheck/rust-hir-dot-operator.cc (MethodResolver::try_hook):
Extract the inner type of a Box to resolve trait methods.
* util/rust-lang-item.cc (Rust::LangItem::lang_items): Register
dispatch_from_dyn to the BiMap.
* util/rust-lang-item.h (class LangItem): Add DISPATCH_FROM_DYN
to the Kind enum.
gcc/testsuite/ChangeLog:
* rust/execute/box-dispatch-from-dyn.rs: New test.
Signed-off-by: Enes Cevik <enes@nsvke.com>
0 commit comments