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

CI failing due to dead_code warnings on nightly #1205

Closed
nicholasbishop opened this issue Jun 14, 2024 · 2 comments
Closed

CI failing due to dead_code warnings on nightly #1205

nicholasbishop opened this issue Jun 14, 2024 · 2 comments
Assignees

Comments

@nicholasbishop
Copy link
Member

See https://github.com/rust-osdev/uefi-rs/actions/runs/9508727436/job/26210548798 for example:

error: struct `GraphicsOutput` is never constructed
  --> uefi/src/proto/console/gop.rs:74:12
   |
74 | pub struct GraphicsOutput(GraphicsOutputProtocol);
   |            ^^^^^^^^^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
[... many more warnings like this...]

I believe this is the same issue as rust-lang/rust#126169.

Since this will likely affect a lot of projects, my guess is the change will eventually be reverted or made less strict (e.g. skipped for repr(C)/repr(transparent) types). So for now I think the best solution is to silence that warning for the nightly jobs.

Per https://doc.rust-lang.org/rustc/lints/levels.html, it should be possible to override the warning by appending -A dead-code. However, I tested RUSTFLAGS="-D warnings -A dead-code" cargo +nightly build -p uefi locally and still see all the same warnings. So for now I'll put up a PR that just sets an empty RUSTFLAGS for the nightly jobs (instead of our usual default of -D warnings.

@nicholasbishop
Copy link
Member Author

#1206 is up with the temporary fix. I'll keep this bug open until the lint issue is properly resolved, either with rustc changes or uefi-rs changes.

@nicholasbishop
Copy link
Member Author

Rustc has reverted the changes that led to these warnings. Workarounds removed in #1302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant