-
Notifications
You must be signed in to change notification settings - Fork 13.3k
core/std: squash dead_code warnings from fail! invocations. #16196
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
Conversation
Would this cause breakage if someone has a |
It probably would. The functions/statics could just be renamed to start with |
Theoretically it wouldn't cause actual breakage, because the only way for this to pop up is when inside a dead function (i.e. that would be flagged as an error anyway), but it does cause noise in that case, so I changed it. NB. I had to adjust (The |
@huonw I'm actually surprised the |
The fail macro defines some function/static items internally, which got a dead_code warning when `fail!()` is used inside a dead function. This is ugly and unnecessarily reveals implementation details, so the warnings can be squashed. Fixes #16192.
Was this cancelled by someone, or are the exceptions just spurious? |
I don't know why it's not listed but auto-mac-64-opt failed: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/724/ |
Does someone have an inkling about what is going on here? It is failing with a pile of errors like <std macros>:7:9: 7:69 error: code is never used: `FILE_LINE`
<std macros>:7 static FILE_LINE: (&'static str, uint) = (file!(), line!());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ but
i.e. the thing it's complaining about doesn't seem to exist. (It passes locally.) |
That's pretty strange. Sure makes it look like it's using the old macros. |
When you did a |
This generalises the behaviour with struct fields (which recieve no dead_code warning if they have a leading _), and other similar lints, to all items, e.g. `fn _foo() {} fn main() {}` has no warnings.
Oh, I didn't even think of that... |
|
The fail macro defines some function/static items internally, which got a dead_code warning when `fail!()` is used inside a dead function. This is ugly and unnecessarily reveals implementation details, so the warnings can be squashed. Fixes rust-lang#16192.
The fail macro defines some function/static items internally, which got a dead_code warning when `fail!()` is used inside a dead function. This is ugly and unnecessarily reveals implementation details, so the warnings can be squashed. Fixes #16192.
…e, r=Veykril Rename generator to coroutine Follow the rename in nightly (see https://blog.rust-lang.org/inside-rust/2023/10/23/coroutines.html) This makes it much easier to test code with the nightly compiler.
The fail macro defines some function/static items internally, which got
a dead_code warning when
fail!()
is used inside a dead function. Thisis ugly and unnecessarily reveals implementation details, so the
warnings can be squashed.
Fixes #16192.