diff options
Diffstat (limited to 'gcc/rust/checks/errors/rust-unsafe-checker.cc')
-rw-r--r-- | gcc/rust/checks/errors/rust-unsafe-checker.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/rust/checks/errors/rust-unsafe-checker.cc b/gcc/rust/checks/errors/rust-unsafe-checker.cc index 8d986c7..c6ed922 100644 --- a/gcc/rust/checks/errors/rust-unsafe-checker.cc +++ b/gcc/rust/checks/errors/rust-unsafe-checker.cc @@ -637,6 +637,17 @@ UnsafeChecker::visit (AsyncBlockExpr &) } void +UnsafeChecker::visit (InlineAsm &expr) +{ + if (unsafe_context.is_in_context ()) + return; + + rust_error_at ( + expr.get_locus (), ErrorCode::E0133, + "use of inline assembly is unsafe and requires unsafe function or block"); +} + +void UnsafeChecker::visit (TypeParam &) {} |