From f4f546c9881c47923c7d37e8cf7a9bc35f37489c Mon Sep 17 00:00:00 2001 From: badumbatish Date: Thu, 29 Aug 2024 10:07:19 -0700 Subject: gccrs: Rehaul, Apply code review from Arthur gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::visit): Change API, public/private, comments, formatting from code review (CompileAsm::asm_build_expr): Likewise. (CompileAsm::tree_codegen_asm): Likewise. * backend/rust-compile-asm.h (class CompileAsm): Likewise. * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise. * expand/rust-macro-builtins-asm.cc (strip_double_quotes): Likewise. (parse_options): Likewise. (parse_asm_arg): Likewise. (expand_inline_asm_strings): Likewise. (parse_asm): Likewise. * expand/rust-macro-builtins-asm.h (strip_double_quotes): Likewise. (expand_inline_asm_strings): Likewise. (expand_inline_asm_string): Likewise. * hir/tree/rust-hir-expr.h: Likewise. gcc/testsuite/ChangeLog: * rust/compile/inline_asm_typecheck.rs: Change comments --- gcc/testsuite/rust/compile/inline_asm_typecheck.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gcc/testsuite/rust/compile') diff --git a/gcc/testsuite/rust/compile/inline_asm_typecheck.rs b/gcc/testsuite/rust/compile/inline_asm_typecheck.rs index 22b7fb1..b2daefc 100644 --- a/gcc/testsuite/rust/compile/inline_asm_typecheck.rs +++ b/gcc/testsuite/rust/compile/inline_asm_typecheck.rs @@ -12,10 +12,9 @@ fn main() { // This demonstrates that asm!'s is inferred with a unit type is parsed correctly. let _ = asm!("nop"); - // This errors out per rust spec - // The asm! block never returns, and its return type is defined as ! (never). - // Behavior is undefined if execution falls through past the end of the asm code. - // A noreturn asm block behaves just like a function which doesn't return; notably, local variables in scope are not dropped before it is invoked. + // The asm! block never returns, and its return type is defined as ! (never). + // Behavior is undefined if execution falls through past the end of the asm code. + // A noreturn asm block behaves just like a function which doesn't return; notably, local variables in scope are not dropped before it is invoked. let _ = asm!("nop", options(noreturn)); } } -- cgit v1.1