Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E0535] Unknown argument given to inline attribute #2559

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

MahadMuhammad
Copy link
Contributor

Unknown argument given to inline attribute. E0535

The inline attribute only supports two arguments:

  • always
  • never

All other arguments given to the inline attribute will always return this error.

Running testcases:

➜  gccrs-build gcc/crab1 /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/inline_2.rs
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/inline_2.rs:2:3: error: invalid argument, ‘inline’ attribute only accepts ‘always’ or ‘never’ [E0535]
    2 | #[inline(A)] // { dg-error "unknown inline option" }
      |   ^~~~~~
      |   unknown inline option
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/inline_2.rs:5:3: error: invalid number of arguments
    5 | #[inline(A, B)] // { dg-error "invalid number of arguments" }
      |   ^~~~~~

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl): Added rich_location & error code.

gcc/testsuite/ChangeLog:

* rust/compile/inline_2.rs: Added new message.

The inline attribute only supports two arguments:
 - always
 - never
All other arguments given to the inline attribute will
return error.

gcc/rust/ChangeLog:

	* backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
	Added rich_location & error code.

gcc/testsuite/ChangeLog:

	* rust/compile/inline_2.rs: Added new message.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
@philberty philberty added the diagnostic diagnostic static analysis label Aug 16, 2023
@philberty philberty added this to the GCC 14 Stage 3 milestone Aug 16, 2023
@philberty
Copy link
Member

nice one using the fixit

@philberty philberty added this pull request to the merge queue Aug 16, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 16, 2023
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philberty philberty added this pull request to the merge queue Aug 17, 2023
Merged via the queue into Rust-GCC:master with commit b9ae354 Aug 17, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic diagnostic static analysis
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants