aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-tree.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-08-23 16:31:17 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-12-13 14:00:06 +0100
commitb1b35204d8a186a6fadc8534e99e9161892192ac (patch)
treecf4c292fb42affbd0293c30229fb6cb510a5a059 /gcc/rust/backend/rust-tree.h
parent06688fe40a249a406634d3307f662e2fe2e0c517 (diff)
downloadgcc-b1b35204d8a186a6fadc8534e99e9161892192ac.zip
gcc-b1b35204d8a186a6fadc8534e99e9161892192ac.tar.gz
gcc-b1b35204d8a186a6fadc8534e99e9161892192ac.tar.bz2
gccrs: Add unsafe checks for Rust
The UnsafeChecker visitor verifies that unsafe actions are only performed in unsafe contexts. Otherwise, an error should be reported to the user and the compilation pipeline should be halted. These contexts, which include unsafe blocks or unsafe functions, are allowed to perform more actions than regular safe Rust code. These actions currently include: - Dereferencing raw pointers - Calls to unsafe functions - Use of inline assembly - Use of mutable static - Use of extern static - Access to a union's field - Call to functions with #[target(feature)] attribute - Initializing type with rustc_layout_scalar_valid_range attribute - Mutation of layout constrained field - Borrow of layout constrained field gcc/rust/ * checks/errors/rust-unsafe-checker.cc: New. * checks/errors/rust-unsafe-checker.h: New.
Diffstat (limited to 'gcc/rust/backend/rust-tree.h')
0 files changed, 0 insertions, 0 deletions