diff options
author | Prajwal S N <prajwalnadig21@gmail.com> | 2022-12-31 12:49:02 +0530 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2023-04-06 10:47:16 +0200 |
commit | 776ff053800ad989564b0b3c2904fb072abaf422 (patch) | |
tree | 3d0a62e12dbe4ee8cb086f0693e5ff5434b80cf0 /gcc/rust/hir/tree | |
parent | f66b135d0b55fda15dfce927b14ab9c89b9fb6a7 (diff) | |
download | gcc-776ff053800ad989564b0b3c2904fb072abaf422.zip gcc-776ff053800ad989564b0b3c2904fb072abaf422.tar.gz gcc-776ff053800ad989564b0b3c2904fb072abaf422.tar.bz2 |
gccrs: unsafe: check use of `target_feature` attribute
The `target_feature` attribute is for conditional compilation and may or
may not compile on all platforms. Using it requires an unsafe function
or block.
gcc/rust/ChangeLog:
* checks/errors/rust-unsafe-checker.cc (check_target_attr): New function.
(UnsafeChecker::check_function_attr): Call into `check_target_attr`.
(UnsafeChecker::visit): Check for target_feature attributes.
* checks/errors/rust-unsafe-checker.h: Add declarations.
* util/rust-attributes.cc: Add attribute.
gcc/testsuite/ChangeLog:
* rust/compile/unsafe11.rs: New test.
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
Diffstat (limited to 'gcc/rust/hir/tree')
0 files changed, 0 insertions, 0 deletions