-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Issue an error or warning when using no_mangle
on language items
#140203
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
base: master
Are you sure you want to change the base?
Issue an error or warning when using no_mangle
on language items
#140203
Conversation
rustbot has assigned @petrochenkov. Use |
r? @bjorn3 |
f599390
to
caa2b04
Compare
This comment has been minimized.
This comment has been minimized.
This fails due to a test that defines #[panic_handler] //~ ERROR `panic_impl` lang item must be applied to a function
#[no_mangle]
static X: u32 = 42; This somehow seems to be an error priority issue, the error that this pull request issues is correct. I am not sure exactly how to avoid this, as I don't think checking that the target is a function is correct, as some language items are not functions. |
you can probably just fix the test if you look at the history of the test and ensure that what it's trying to test is still tested |
Thank you @Noratrieb I deleted the My understanding is that the test should verify that the |
This pull requests adds the code to issue an error or a warning when using
no_mangle
on language items. This should detail why theundefined symbol
error is issued for the code described in #139923.The pull request adds two ui tests, one testing the error and the other one the warning.
I would love some feedback here, as I am not sure that the error and warning are issues using the right API.