]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Parse raw ref operator
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 21 May 2024 08:23:55 +0000 (10:23 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 17 Mar 2025 15:35:33 +0000 (16:35 +0100)
commita0f4c30e52aebcb5c71ea5eba98fb20dbbc56858
tree2771e39bae0a9e77ae3839714809190423fed642
parent949892cb959fa9c9d7f148aae746181cefd8b956
gccrs: Parse raw ref operator

The raw ref operator is an unstable feature required to obtain a pointer
to unaligned adresses (mainly unaligned struct fields) without UB.

gcc/rust/ChangeLog:

* ast/rust-ast-builder.cc (Builder::ref): Adapt constructor to the new
API.
* ast/rust-ast-collector.cc (TokenCollector::visit): Emit a raw weak
keyword when required.
* ast/rust-ast.cc (BorrowExpr::as_string): Change as_string
representation to handle raw ref operator.
* ast/rust-expr.h (class BorrowExpr): Add raw discriminant.
* expand/rust-macro-builtins-include.cc: Adapt constructor to the new
API.
* parse/rust-parse-impl.h: Handle the raw weak keyword.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-builder.cc
gcc/rust/ast/rust-ast-collector.cc
gcc/rust/ast/rust-ast.cc
gcc/rust/ast/rust-expr.h
gcc/rust/expand/rust-macro-builtins-include.cc
gcc/rust/parse/rust-parse-impl.h