-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Lint on combining #[no_mangle]
and #[export_name]
#131558
base: master
Are you sure you want to change the base?
Lint on combining #[no_mangle]
and #[export_name]
#131558
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @TaKO8Ki (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
f6d8242
to
aa419ee
Compare
This comment has been minimized.
This comment has been minimized.
#[no_mangle]
and #[export_name]
@Urgau Do you know why all these lints are prefixed by |
It's probably a prefix for the lints defined inside Lints outside of that file don't seems to have it at least. |
This comment has been minimized.
This comment has been minimized.
Ah, I see. Mm, great, in tests/ui/asm/naked-functions.rs we find this gem: #[export_name = "exported_function_name"]
#[link_section = ".custom_section"]
#[no_mangle]
#[naked]
pub unsafe extern "C" fn compatible_ffi_attributes_1() {
naked_asm!("", options(raw));
} @sassman Thank you for PRing this lint! It looks like you will have to fix a few cases of it in our test suite as well, and |
8c2d9ca
to
a7989cb
Compare
This comment has been minimized.
This comment has been minimized.
ff86482
to
1f849df
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Now the tests run all green and I have cleaned up the other test that used both Please let me know if there is anything that I can do further. |
I think this check is miss-placed, I think it should be with the others codegen attributes handling in the You can look at the
As well as @rustbot author |
Thanks @Urgau for the guidance, I will refactor the code accordingly. |
This comment has been minimized.
This comment has been minimized.
@Urgau I have refactored the code, but just to be sure I get things right, with this approach we won't have "named" lints that a user can allow or deny anymore or am I missing something? In the previous commit the lint was tied to the If I did got this right then I will adjust the introduced error output expectation to fix the build error: |
Reminder, don't forget to use the |
This comment has been minimized.
This comment has been minimized.
85ae010
to
b996aac
Compare
b996aac
to
1840a42
Compare
@petrochenkov your concern about the unjustified new lint has been resolved by @sassman (the PR author) by issuing the The concern can (I think) be marked as resolved. As a procedural note, with the removal of the new lint, does the FCP still makes sense? |
@rfcbot resolve unjustified-new-lint |
Is there any further thing I can do to support the process? |
☔ The latest upstream changes (presumably #132664) made this pull request unmergeable. Please resolve the merge conflicts. |
1840a42
to
3708c00
Compare
- Add test for issue 47446 - Implement the new lint lint_builtin_mixed_export_name_and_no_mangle - Add suggestion how to fix it
3708c00
to
1696f53
Compare
I agree this no longer needs an FCP. Maybe @davidtwco or another person on the FCP can weigh in to agree or dissent? |
@Urgau is there anything that I can do to support on landing this PR? |
Checkboxes (hidden by Github UI) at #131558 (comment). CC @Aaron1011, @jackh726, @oli-obk, @wesleywiser (consider checking your boxes if ok with the lint as is). |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
This is my very first contribution to the compiler, even though I read the chapter about lints I'm not very certain that this
new lint is done right as a builtin lintPR is right. I appreciate any guidance on how to improve the code.Implement the new lintExtendmixed_export_name_and_no_mangle
as a builtin lint (not sure if that is the right way to go)unused_attributes
lintOld proposed new lint
Fixes #47446