Closed Bug 1878779 Opened 1 year ago Closed 1 year ago

[rustc-1.77] error: field `0` is never read

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

[task 2024-02-05T21:56:30.403Z] 21:56:30    ERROR -  error: field `0` is never read
[task 2024-02-05T21:56:30.403Z] 21:56:30     INFO -     --> gfx/wr/webrender/src/device/gl.rs:937:28
[task 2024-02-05T21:56:30.403Z] 21:56:30     INFO -      |
[task 2024-02-05T21:56:30.403Z] 21:56:30     INFO -  937 | pub struct UniformLocation(gl::GLint);
[task 2024-02-05T21:56:30.403Z] 21:56:30     INFO -      |            --------------- ^^^^^^^^^
[task 2024-02-05T21:56:30.403Z] 21:56:30     INFO -      |            |
[task 2024-02-05T21:56:30.403Z] 21:56:30     INFO -      |            field in this struct
[task 2024-02-05T21:56:30.403Z] 21:56:30     INFO -      |
[task 2024-02-05T21:56:30.403Z] 21:56:30     INFO -      = note: `UniformLocation` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
[task 2024-02-05T21:56:30.404Z] 21:56:30     INFO -      = note: `-D dead-code` implied by `-D warnings`
[task 2024-02-05T21:56:30.404Z] 21:56:30     INFO -      = help: to override `-D warnings` add `#[allow(dead_code)]`
[task 2024-02-05T21:56:30.404Z] 21:56:30     INFO -  help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
[task 2024-02-05T21:56:30.404Z] 21:56:30     INFO -      |
[task 2024-02-05T21:56:30.404Z] 21:56:30     INFO -  937 | pub struct UniformLocation(());
[task 2024-02-05T21:56:30.404Z] 21:56:30     INFO -      |                            ~~
[task 2024-02-05T21:56:30.404Z] 21:56:30    ERROR -  error: field `0` is never read
[task 2024-02-05T21:56:30.404Z] 21:56:30     INFO -     --> gfx/wr/webrender/src/device/query_gl.rs:316:25
[task 2024-02-05T21:56:30.404Z] 21:56:30     INFO -      |
[task 2024-02-05T21:56:30.404Z] 21:56:30     INFO -  316 | pub struct GpuTimeQuery(GpuMarker);
[task 2024-02-05T21:56:30.405Z] 21:56:30     INFO -      |            ------------ ^^^^^^^^^
[task 2024-02-05T21:56:30.405Z] 21:56:30     INFO -      |            |
[task 2024-02-05T21:56:30.405Z] 21:56:30     INFO -      |            field in this struct
[task 2024-02-05T21:56:30.405Z] 21:56:30     INFO -      |
[task 2024-02-05T21:56:30.405Z] 21:56:30     INFO -  help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
[task 2024-02-05T21:56:30.405Z] 21:56:30     INFO -      |
[task 2024-02-05T21:56:30.405Z] 21:56:30     INFO -  316 | pub struct GpuTimeQuery(());
[task 2024-02-05T21:56:30.405Z] 21:56:30     INFO -      |                         ~~
[task 2024-02-05T21:56:30.405Z] 21:56:30    ERROR -  error: could not compile `webrender` (lib) due to 2 previous errors

pub struct UniformLocation(gl::GLint);

This one is never read from Rust, but it's used on the C++ side. It should be marked with #[allow(dead_code)]

pub struct GpuTimeQuery(GpuMarker);

This one is never used at all, which is ironic since it's marked as #[must_use]. The type could be removed entirely, and start_timer could be made to return nothing.

(In reply to Mike Hommey [:glandium] from comment #1)

pub struct UniformLocation(gl::GLint);

This one is never read from Rust, but it's used on the C++ side. It should be marked with #[allow(dead_code)]

pub struct GpuTimeQuery(GpuMarker);

This one is never used at all, which is ironic since it's marked as #[must_use]. The type could be removed entirely, and start_timer could be made to return nothing.

Oh, the impl Drop on GpuMarker actually makes it relevant. That seems to be a diagnostic problem in rustc...

Severity: -- → S3
Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/35ef255a54bd Mark fields rust 1.77 thinks are dead code as being allowed. r=gfx-reviewers,aosmond
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: