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

Raise MSRV to Rust 1.80 #6105

Draft
wants to merge 10 commits into
base: trunk
Choose a base branch
from

Conversation

ErichDonGubler
Copy link
Member

@ErichDonGubler ErichDonGubler commented Aug 12, 2024

@ErichDonGubler ErichDonGubler added area: infrastructure Testing, building, coordinating issues kind: refactor Making existing function faster or nicer labels Aug 12, 2024
@ErichDonGubler ErichDonGubler self-assigned this Aug 12, 2024
@ErichDonGubler ErichDonGubler force-pushed the rust-lints-with-1.80 branch 6 times, most recently from 5b300f7 to 13db95e Compare August 12, 2024 12:26
@ErichDonGubler
Copy link
Member Author

Heeey, we're finally running into the same annoying errors here that I wasn't sure what to do with locally when I saw them:

error: trait `ContextId` is never used
  --> wgpu/src/context.rs:25:11
   |
25 | pub trait ContextId: Into<ObjectId> + From<ObjectId> + Debug + 'static {}
   |           ^^^^^^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`

error: methods `device_downlevel_properties`, `device_mark_lost`, `render_bundle_encoder_multi_draw_indirect`, `render_bundle_encoder_multi_draw_indexed_indirect`, `render_bundle_encoder_multi_draw_indirect_count`, and `render_bundle_encoder_multi_draw_indexed_indirect_count` are never used
   --> wgpu/src/context.rs:190:8
    |
34  | pub trait Context: Debug + WasmNotSendSync + Sized {
    |           ------- methods in this trait
...
190 |     fn device_downlevel_properties(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
290 |     fn device_mark_lost(
    |        ^^^^^^^^^^^^^^^^
...
793 |     fn render_bundle_encoder_multi_draw_indirect(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
802 |     fn render_bundle_encoder_multi_draw_indexed_indirect(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
812 |     fn render_bundle_encoder_multi_draw_indirect_count(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
825 |     fn render_bundle_encoder_multi_draw_indexed_indirect_count(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: methods `device_downlevel_properties`, `device_mark_lost`, `render_bundle_encoder_multi_draw_indirect`, `render_bundle_encoder_multi_draw_indexed_indirect`, `render_bundle_encoder_multi_draw_indirect_count`, and `render_bundle_encoder_multi_draw_indexed_indirect_count` are never used
    --> wgpu/src/context.rs:1249:8
     |
1171 | pub(crate) trait DynContext: Debug + WasmNotSendSync {
     |                  ---------- methods in this trait
...
1249 |     fn device_downlevel_properties(
     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1349 |     fn device_mark_lost(&self, device: &ObjectId, device_data: &crate::Data, message: &str);
     |        ^^^^^^^^^^^^^^^^
...
1790 |     fn render_bundle_encoder_multi_draw_indirect(
     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1799 |     fn render_bundle_encoder_multi_draw_indexed_indirect(
     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1809 |     fn render_bundle_encoder_multi_draw_indirect_count(
     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1822 |     fn render_bundle_encoder_multi_draw_indexed_indirect_count(
     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Checking naga-fuzz v0.0.0 (/Users/runner/work/wgpu/wgpu/naga/fuzz)
    Checking d3d12 v22.0.0 (/Users/runner/work/wgpu/wgpu/d3d12)
error: could not compile `wgpu` (lib) due to 3 previous errors

☝🏻 @cwfitzgerald, @Wumpf: Not sure how to best proceed here, but I haven't given it many brain cycles, either. Will dedicate more in the absence of feedback in the next day or so.

@ErichDonGubler ErichDonGubler force-pushed the rust-lints-with-1.80 branch 4 times, most recently from 3aa12e9 to b5973ab Compare August 12, 2024 12:53
@ErichDonGubler ErichDonGubler changed the title Resolve yet more lints from Rust 1.80, but which are only resolvable in Rust 1.80 or newer Resolve Rust 1.80 lints Aug 12, 2024
@ErichDonGubler ErichDonGubler force-pushed the rust-lints-with-1.80 branch 2 times, most recently from a7cfba6 to 4e2f6ce Compare August 13, 2024 07:49
@ErichDonGubler
Copy link
Member Author

Leaving this as a draft until we actually have the option to upgrade to Rust 1.80.

We might be able to hoist the upgrade to cfg_aliases out if katharostech/cfg_aliases#10 merges and is released.

@ErichDonGubler

This comment was marked as resolved.

@kornelski

This comment was marked as resolved.

@ErichDonGubler

This comment was marked as resolved.

naga/src/back/msl/mod.rs Outdated Show resolved Hide resolved
@ErichDonGubler ErichDonGubler force-pushed the rust-lints-with-1.80 branch 5 times, most recently from 6347080 to 2215894 Compare September 23, 2024 19:52
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to have UB in the GL backend that rust is now catching.

@ErichDonGubler ErichDonGubler force-pushed the rust-lints-with-1.80 branch 2 times, most recently from 181ab8d to 20c76bd Compare October 13, 2024 15:54
`std::mem::{size,align}_of{,_val}` was added to `std::prelude` in Rust
1.80; see
[`rust`#123168](rust-lang/rust#123168).
Weaken our dependence on the `once_cell` crate by using functionality
from `std` instead that was upstreamed from `once_cell`, this time with
what's available in Rust 1.80+.

It's not yet possible to eliminate this dependency entirely, but do what
we can for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: infrastructure Testing, building, coordinating issues kind: refactor Making existing function faster or nicer
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants