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

[E0541] Use of unknown meta item #2526

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

MahadMuhammad
Copy link
Contributor

Use of unknown meta item E0541


Code Tested:


gcc/rust/ChangeLog:

* backend/rust-compile-base.cc: Added ErrorCode.

gcc/testsuite/ChangeLog:

* rust/compile/attr_deprecated_2.rs: Updated comment to pass the testcase.

gcc/rust/ChangeLog:

	* backend/rust-compile-base.cc:
	Added ErrorCode.

gcc/testsuite/ChangeLog:

	* rust/compile/attr_deprecated_2.rs:
	Updated comment to pass the testcase.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
@MahadMuhammad
Copy link
Contributor Author

MahadMuhammad commented Aug 5, 2023

When we just declare this function inside the main, without calling it, It compiled successfully, without giving any error - compiler-explorer

Is that a bug or a normal behaviour?

@P-E-P P-E-P added enhancement diagnostic diagnostic static analysis labels Aug 7, 2023
@P-E-P
Copy link
Member

P-E-P commented Aug 9, 2023

When we just declare this function inside the main, without calling it, It compiled successfully, without giving any error - compiler-explorer

Is that a bug or a normal behaviour?

It certainly miss something, it is a bug. Although I'm not entirely sure it should be an error, a quick look at the reference show that it should emit a warning. I don't know why this is handled in the backend, I thought it would be handled by the attribute checker but it is not.

@MahadMuhammad
Copy link
Contributor Author

MahadMuhammad commented Aug 9, 2023

I will raise a new issue for this, once we are sure that it's a bug, Thanks for this interesting reference :)

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 10, 2023
Merged via the queue into Rust-GCC:master with commit 152eb85 Aug 10, 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 enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants