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

Closed

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 4 times, most recently from 7088d8d to 313cf42 Compare November 14, 2024 03:17
@ErichDonGubler ErichDonGubler force-pushed the rust-lints-with-1.80 branch 2 times, most recently from af32362 to 1bcf90d Compare November 22, 2024 05:32
@ErichDonGubler ErichDonGubler force-pushed the rust-lints-with-1.80 branch 3 times, most recently from 8477e0f to 4144908 Compare November 25, 2024 14:09
@ErichDonGubler ErichDonGubler force-pushed the rust-lints-with-1.80 branch 4 times, most recently from 5d8e12b to 32f2326 Compare November 29, 2024 17:48
@ErichDonGubler ErichDonGubler force-pushed the rust-lints-with-1.80 branch 2 times, most recently from 4576530 to e15347b Compare December 12, 2024 05:08
This was previously an `allow`-by-default warning in Clippy's `pedantic`
group, but with Rust 1.83 it was promoted to a `warn`-by-default member
of its `complexity` group.
Consumes
[`cfg_aliases`#8](katharostech/cfg_aliases#8) to
eliminate warnings from `rustc`.
This resolves remaining outstanding cases that offend [`--check-cfg` in
Rust
1.80](https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html#checked-cfg-names-and-values)
in `wgpu-core`.
`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: Done
Development

Successfully merging this pull request may close these issues.

3 participants