From 2f4bcc5bf7b296dcd7ee6048a90237c56de36557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Mon, 25 Oct 2021 18:00:13 +0000 Subject: [PATCH] Update for edition 2021 (#2997) # Objective - update for Edition 2021 ## Solution - remove the `resolver = "2"` - update for https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html by adding a few ` ` --- .github/workflows/ci.yml | 10 +++++++++- .github/workflows/dependencies.yml | 16 +++++++++++++++ Cargo.toml | 3 +-- benches/Cargo.toml | 2 +- crates/bevy_app/Cargo.toml | 2 +- crates/bevy_asset/Cargo.toml | 2 +- crates/bevy_audio/Cargo.toml | 2 +- crates/bevy_core/Cargo.toml | 2 +- crates/bevy_core/src/lib.rs | 2 +- crates/bevy_derive/Cargo.toml | 2 +- crates/bevy_derive/src/enum_variant_meta.rs | 2 +- crates/bevy_derive/src/resource.rs | 2 +- crates/bevy_derive/src/shader_defs.rs | 2 +- crates/bevy_diagnostic/Cargo.toml | 2 +- crates/bevy_dylib/Cargo.toml | 2 +- crates/bevy_dynamic_plugin/Cargo.toml | 2 +- crates/bevy_ecs/Cargo.toml | 2 +- crates/bevy_ecs/macros/Cargo.toml | 2 +- crates/bevy_ecs/macros/src/lib.rs | 6 +++--- crates/bevy_gilrs/Cargo.toml | 2 +- crates/bevy_gltf/Cargo.toml | 2 +- crates/bevy_input/Cargo.toml | 2 +- crates/bevy_internal/Cargo.toml | 2 +- crates/bevy_log/Cargo.toml | 2 +- crates/bevy_macro_utils/Cargo.toml | 2 +- crates/bevy_math/Cargo.toml | 2 +- crates/bevy_pbr/Cargo.toml | 2 +- crates/bevy_reflect/Cargo.toml | 2 +- .../bevy_reflect_derive/Cargo.toml | 2 +- .../bevy_reflect_derive/src/lib.rs | 20 +++++++++---------- crates/bevy_render/Cargo.toml | 2 +- .../bevy_render/src/mesh/mesh/conversions.rs | 3 --- crates/bevy_render/src/render_graph/graph.rs | 1 - .../src/texture/image_texture_conversion.rs | 1 - crates/bevy_render/src/texture/texture.rs | 2 -- crates/bevy_scene/Cargo.toml | 2 +- crates/bevy_sprite/Cargo.toml | 2 +- crates/bevy_tasks/Cargo.toml | 2 +- crates/bevy_text/Cargo.toml | 2 +- crates/bevy_transform/Cargo.toml | 2 +- crates/bevy_ui/Cargo.toml | 2 +- crates/bevy_utils/Cargo.toml | 2 +- crates/bevy_wgpu/Cargo.toml | 2 +- crates/bevy_wgpu/src/lib.rs | 2 +- crates/bevy_window/Cargo.toml | 2 +- crates/bevy_window/src/lib.rs | 2 +- crates/bevy_winit/Cargo.toml | 2 +- examples/ios/Cargo.toml | 2 +- pipelined/bevy_core_pipeline/Cargo.toml | 2 +- pipelined/bevy_gltf2/Cargo.toml | 2 +- pipelined/bevy_pbr2/Cargo.toml | 2 +- pipelined/bevy_render2/Cargo.toml | 2 +- .../bevy_render2/src/mesh/mesh/conversions.rs | 3 --- .../bevy_render2/src/render_graph/graph.rs | 1 - pipelined/bevy_sprite2/Cargo.toml | 2 +- tools/ci/Cargo.toml | 2 +- 56 files changed, 83 insertions(+), 73 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78deb9dcea..0fa9ead0ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true - name: Install Android targets run: rustup target add aarch64-linux-android armv7-linux-androideabi - name: Install Cargo APK @@ -145,6 +149,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true - name: Install alsa and udev run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev if: runner.os == 'linux' @@ -155,7 +163,7 @@ jobs: - name: Checks dead links run: cargo deadlinks --dir target/doc/bevy continue-on-error: true - + check-missing-examples-in-docs: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 078c643d6e..619d2115a1 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -23,6 +23,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true - name: Install cargo-deny run: cargo install cargo-deny - name: Check for security advisories and unmaintained crates @@ -32,6 +36,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true - name: Install cargo-deny run: cargo install cargo-deny - name: Check for banned and duplicated dependencies @@ -41,6 +49,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true - name: Install cargo-deny run: cargo install cargo-deny - name: Check for unauthorized licenses @@ -50,6 +62,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true - name: Install cargo-deny run: cargo install cargo-deny - name: Checked for unauthorized crate sources diff --git a/Cargo.toml b/Cargo.toml index 5a4dca68a0..2d68287a14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", @@ -14,7 +14,6 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"] license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/bevyengine/bevy" -resolver = "2" [workspace] exclude = ["benches"] diff --git a/benches/Cargo.toml b/benches/Cargo.toml index 3d13d202ef..6e2ff0a9a1 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -5,7 +5,7 @@ authors = [ "Bevy Contributors ", "Carter Anderson ", ] -edition = "2018" +edition = "2021" [dev-dependencies] criterion = "0.3" diff --git a/crates/bevy_app/Cargo.toml b/crates/bevy_app/Cargo.toml index 58e8ac243e..5d99e47200 100644 --- a/crates/bevy_app/Cargo.toml +++ b/crates/bevy_app/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_app" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_asset/Cargo.toml b/crates/bevy_asset/Cargo.toml index a1fede4dfa..c4fee0cba8 100644 --- a/crates/bevy_asset/Cargo.toml +++ b/crates/bevy_asset/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_asset" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_audio/Cargo.toml b/crates/bevy_audio/Cargo.toml index e5d9b02163..d84f389e40 100644 --- a/crates/bevy_audio/Cargo.toml +++ b/crates/bevy_audio/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_audio" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_core/Cargo.toml b/crates/bevy_core/Cargo.toml index ef6283e890..a0b5539c2e 100644 --- a/crates/bevy_core/Cargo.toml +++ b/crates/bevy_core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_core" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_core/src/lib.rs b/crates/bevy_core/src/lib.rs index 50ab218cd6..e4c6f6de55 100644 --- a/crates/bevy_core/src/lib.rs +++ b/crates/bevy_core/src/lib.rs @@ -43,7 +43,7 @@ impl Plugin for CorePlugin { app.world .get_resource::() .cloned() - .unwrap_or_else(DefaultTaskPoolOptions::default) + .unwrap_or_default() .create_default_pools(&mut app.world); app.init_resource::