[rustc-1.77] error: field `0` is never read
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
| 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
| Assignee | ||
Comment 1•1 year ago
|
||
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.
| Assignee | ||
Comment 2•1 year ago
|
||
(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, andstart_timercould be made to return nothing.
Oh, the impl Drop on GpuMarker actually makes it relevant. That seems to be a diagnostic problem in rustc...
| Assignee | ||
Comment 3•1 year ago
|
||
Pinged the relevant upstream issue. https://github.com/rust-lang/rust/issues/119645#issuecomment-1928443484
Updated•1 year ago
|
| Assignee | ||
Comment 4•1 year ago
|
||
Updated•1 year ago
|
Comment 6•1 year ago
|
||
| bugherder | ||
Description
•