]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: offset_of: Compile the offset properly
authorArthur Cohen <arthur.cohen@embecosm.com>
Wed, 30 Jul 2025 09:57:45 +0000 (11:57 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:37:03 +0000 (16:37 +0200)
commiteb54ab61fd5532d08be99721ffdbb03590cc3fff
tree7da45ef1b40250a3a9dc490f00779db0c1f4de3b
parent2f054b8db9fa548443560a1187c998945fc9634a
gccrs: offset_of: Compile the offset properly

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::visit): Add proper handling
of the node.
* rust-backend.h (lookup_field): Declare it.
* rust-gcc.cc (lookup_field): Add forked implementation from gcc/c/.

gcc/testsuite/ChangeLog:

* rust/execute/torture/offset_of1.rs: New test.
gcc/rust/backend/rust-compile-expr.cc
gcc/rust/rust-backend.h
gcc/rust/rust-gcc.cc
gcc/testsuite/rust/execute/torture/offset_of1.rs [new file with mode: 0644]