Skip to content

Commit ffde86e

Browse files
committed
Update to edition 2021 on master (#3028)
Objective During work on #3009 I've found that not all jobs use actions-rs, and therefore, an previous version of Rust is used for them. So while compilation and other stuff can pass, checking markup and Android build may fail with compilation errors. Solution This PR adds `action-rs` for any job running cargo, and updates the edition to 2021.
1 parent 6a8a8c9 commit ffde86e

File tree

45 files changed

+71
-55
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+71
-55
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ jobs:
125125
runs-on: ubuntu-latest
126126
steps:
127127
- uses: actions/checkout@v2
128+
- uses: actions-rs/toolchain@v1
129+
with:
130+
toolchain: stable
128131
- uses: actions/cache@v2
129132
with:
130133
path: |
@@ -255,6 +258,9 @@ jobs:
255258
if: always()
256259
steps:
257260
- uses: actions/checkout@v2
261+
- uses: actions-rs/toolchain@v1
262+
with:
263+
toolchain: stable
258264
- name: Install alsa and udev
259265
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
260266
if: runner.os == 'linux'

.github/workflows/dependencies.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v2
26+
- uses: actions-rs/toolchain@v1
27+
with:
28+
toolchain: stable
29+
override: true
2630
- name: Install cargo-deny
2731
run: cargo install cargo-deny
2832
- name: Check for security advisories and unmaintained crates
@@ -32,6 +36,10 @@ jobs:
3236
runs-on: ubuntu-latest
3337
steps:
3438
- uses: actions/checkout@v2
39+
- uses: actions-rs/toolchain@v1
40+
with:
41+
toolchain: stable
42+
override: true
3543
- name: Install cargo-deny
3644
run: cargo install cargo-deny
3745
- name: Check for banned and duplicated dependencies
@@ -41,6 +49,10 @@ jobs:
4149
runs-on: ubuntu-latest
4250
steps:
4351
- uses: actions/checkout@v2
52+
- uses: actions-rs/toolchain@v1
53+
with:
54+
toolchain: stable
55+
override: true
4456
- name: Install cargo-deny
4557
run: cargo install cargo-deny
4658
- name: Check for unauthorized licenses
@@ -50,6 +62,10 @@ jobs:
5062
runs-on: ubuntu-latest
5163
steps:
5264
- uses: actions/checkout@v2
65+
- uses: actions-rs/toolchain@v1
66+
with:
67+
toolchain: stable
68+
override: true
5369
- name: Install cargo-deny
5470
run: cargo install cargo-deny
5571
- name: Checked for unauthorized crate sources

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
categories = ["game-engines", "graphics", "gui", "rendering"]
66
description = "A refreshingly simple data-driven game engine and app framework"
77
exclude = ["assets/**/*", "tools/**/*", ".github/**/*", "crates/**/*"]

benches/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "benches"
33
version = "0.1.0"
4-
edition = "2018"
4+
edition = "2021"
55

66
[dev-dependencies]
77
criterion = "0.3"

crates/bevy_app/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_app"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides core App functionality for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_asset/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_asset"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides asset functionality for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_audio/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_audio"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides audio functionality for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_core"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides core functionality for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_derive"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides derive implementations for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_derive/src/enum_variant_meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn derive_enum_variant_meta(input: TokenStream) -> TokenStream {
2121
let indices = 0..names.len();
2222

2323
TokenStream::from(quote! {
24-
impl #impl_generics #bevy_util_path::EnumVariantMeta for #struct_name#ty_generics #where_clause {
24+
impl #impl_generics #bevy_util_path::EnumVariantMeta for #struct_name #ty_generics #where_clause {
2525
fn enum_variant_index(&self) -> usize {
2626
match self {
2727
#(#struct_name::#idents {..} => #indices,)*

crates/bevy_derive/src/shader_defs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn derive_shader_defs(input: TokenStream) -> TokenStream {
4040
let (impl_generics, ty_generics, _where_clause) = generics.split_for_impl();
4141

4242
TokenStream::from(quote! {
43-
impl #impl_generics #bevy_render_path::shader::ShaderDefs for #struct_name#ty_generics {
43+
impl #impl_generics #bevy_render_path::shader::ShaderDefs for #struct_name #ty_generics {
4444
fn shader_defs_len(&self) -> usize {
4545
#shader_defs_len
4646
}

crates/bevy_diagnostic/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_diagnostic"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides diagnostic functionality for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_dylib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_dylib"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Force the Bevy Engine to be dynamically linked for faster linking"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_dynamic_plugin/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_dynamic_plugin"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides dynamic plugin loading capabilities for non-wasm platforms"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_ecs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_ecs"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Bevy Engine's entity component system"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_ecs/macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "bevy_ecs_macros"
33
version = "0.5.0"
44
description = "Bevy ECS Macros"
5-
edition = "2018"
5+
edition = "2021"
66
license = "MIT OR Apache-2.0"
77

88
[lib]

crates/bevy_ecs/macros/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub fn derive_bundle(input: TokenStream) -> TokenStream {
148148

149149
TokenStream::from(quote! {
150150
/// SAFE: ComponentId is returned in field-definition-order. [from_components] and [get_components] use field-definition-order
151-
unsafe impl #impl_generics #ecs_path::bundle::Bundle for #struct_name#ty_generics #where_clause {
151+
unsafe impl #impl_generics #ecs_path::bundle::Bundle for #struct_name #ty_generics #where_clause {
152152
fn component_ids(
153153
components: &mut #ecs_path::component::Components,
154154
storages: &mut #ecs_path::storage::Storages,
@@ -377,7 +377,7 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream {
377377
let fetch_struct_visibility = &ast.vis;
378378

379379
TokenStream::from(quote! {
380-
impl #impl_generics #path::system::SystemParam for #struct_name#ty_generics #where_clause {
380+
impl #impl_generics #path::system::SystemParam for #struct_name #ty_generics #where_clause {
381381
type Fetch = #fetch_struct_name <(#(<#field_types as #path::system::SystemParam>::Fetch,)*), #punctuated_generic_idents>;
382382
}
383383

@@ -410,7 +410,7 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream {
410410
}
411411

412412
impl #impl_generics #path::system::SystemParamFetch<'w, 's> for #fetch_struct_name <(#(<#field_types as #path::system::SystemParam>::Fetch,)*), #punctuated_generic_idents> {
413-
type Item = #struct_name#ty_generics;
413+
type Item = #struct_name #ty_generics;
414414
unsafe fn get_param(
415415
state: &'s mut Self,
416416
system_meta: &#path::system::SystemMeta,

crates/bevy_gilrs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_gilrs"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Gamepad system made using Gilrs for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_gltf/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_gltf"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Bevy Engine GLTF loading"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_input/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_input"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides input functionality for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_internal/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_internal"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "An internal Bevy crate used to facilitate optional dynamic linking via the 'dynamic' feature"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_log/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_log"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides logging for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_macro_utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_macro_utils"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "A collection of utils for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_math/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_math"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides math functionality for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_pbr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_pbr"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Adds PBR rendering to Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_reflect/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_reflect"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Dynamically interact with rust types"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_reflect/bevy_reflect_derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_reflect_derive"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Derive implementations for bevy_reflect"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_reflect/bevy_reflect_derive/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ fn impl_struct(
206206
TokenStream::from(quote! {
207207
#get_type_registration_impl
208208

209-
impl #impl_generics #bevy_reflect_path::Struct for #struct_name#ty_generics #where_clause {
209+
impl #impl_generics #bevy_reflect_path::Struct for #struct_name #ty_generics #where_clause {
210210
fn field(&self, name: &str) -> Option<&dyn #bevy_reflect_path::Reflect> {
211211
match name {
212212
#(#field_names => Some(&self.#field_idents),)*
@@ -259,7 +259,7 @@ fn impl_struct(
259259
}
260260

261261
// SAFE: any and any_mut both return self
262-
unsafe impl #impl_generics #bevy_reflect_path::Reflect for #struct_name#ty_generics #where_clause {
262+
unsafe impl #impl_generics #bevy_reflect_path::Reflect for #struct_name #ty_generics #where_clause {
263263
#[inline]
264264
fn type_name(&self) -> &str {
265265
std::any::type_name::<Self>()
@@ -349,7 +349,7 @@ fn impl_tuple_struct(
349349
TokenStream::from(quote! {
350350
#get_type_registration_impl
351351

352-
impl #impl_generics #bevy_reflect_path::TupleStruct for #struct_name#ty_generics {
352+
impl #impl_generics #bevy_reflect_path::TupleStruct for #struct_name #ty_generics {
353353
fn field(&self, index: usize) -> Option<&dyn #bevy_reflect_path::Reflect> {
354354
match index {
355355
#(#field_indices => Some(&self.#field_idents),)*
@@ -381,7 +381,7 @@ fn impl_tuple_struct(
381381
}
382382

383383
// SAFE: any and any_mut both return self
384-
unsafe impl #impl_generics #bevy_reflect_path::Reflect for #struct_name#ty_generics {
384+
unsafe impl #impl_generics #bevy_reflect_path::Reflect for #struct_name #ty_generics {
385385
#[inline]
386386
fn type_name(&self) -> &str {
387387
std::any::type_name::<Self>()
@@ -457,7 +457,7 @@ fn impl_value(
457457
#get_type_registration_impl
458458

459459
// SAFE: any and any_mut both return self
460-
unsafe impl #impl_generics #bevy_reflect_path::Reflect for #type_name#ty_generics #where_clause {
460+
unsafe impl #impl_generics #bevy_reflect_path::Reflect for #type_name #ty_generics #where_clause {
461461
#[inline]
462462
fn type_name(&self) -> &str {
463463
std::any::type_name::<Self>()
@@ -715,10 +715,10 @@ fn impl_get_type_registration(
715715
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
716716
quote! {
717717
#[allow(unused_mut)]
718-
impl #impl_generics #bevy_reflect_path::GetTypeRegistration for #type_name#ty_generics #where_clause {
718+
impl #impl_generics #bevy_reflect_path::GetTypeRegistration for #type_name #ty_generics #where_clause {
719719
fn get_type_registration() -> #bevy_reflect_path::TypeRegistration {
720-
let mut registration = #bevy_reflect_path::TypeRegistration::of::<#type_name#ty_generics>();
721-
#(registration.insert::<#registration_data>(#bevy_reflect_path::FromType::<#type_name#ty_generics>::from_type());)*
720+
let mut registration = #bevy_reflect_path::TypeRegistration::of::<#type_name #ty_generics>();
721+
#(registration.insert::<#registration_data>(#bevy_reflect_path::FromType::<#type_name #ty_generics>::from_type());)*
722722
registration
723723
}
724724
}

crates/bevy_render/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "bevy_render"
33
version = "0.5.0"
4-
edition = "2018"
4+
edition = "2021"
55
description = "Provides rendering functionality for Bevy Engine"
66
homepage = "https://bevyengine.org"
77
repository = "https://github.com/bevyengine/bevy"

crates/bevy_render/src/mesh/mesh/conversions.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//!
66
//! ```rust
77
//! use bevy_render::mesh::VertexAttributeValues;
8-
//! use std::convert::{ TryInto, TryFrom };
98
//!
109
//! // creating std::vec::Vec
1110
//! let buffer = vec![[0_u32; 4]; 10];
@@ -27,7 +26,6 @@
2726
2827
use crate::mesh::VertexAttributeValues;
2928
use bevy_utils::EnumVariantMeta;
30-
use std::convert::TryFrom;
3129
use thiserror::Error;
3230

3331
#[derive(Debug, Clone, Error)]
@@ -357,7 +355,6 @@ impl TryFrom<VertexAttributeValues> for Vec<f32> {
357355
#[cfg(test)]
358356
mod tests {
359357
use super::VertexAttributeValues;
360-
use std::convert::{TryFrom, TryInto};
361358
#[test]
362359
fn f32() {
363360
let buffer = vec![0.0; 10];

0 commit comments

Comments
 (0)