Skip to content

Commit a1e3529

Browse files
committed
bump rust version for codegen
1 parent 9f01ebd commit a1e3529

File tree

9 files changed

+24
-22
lines changed

9 files changed

+24
-22
lines changed

.github/workflows/bevy_api_gen.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions-rs/toolchain@v1
2828
with:
2929
profile: minimal
30-
toolchain: nightly-2024-01-24
30+
toolchain: nightly-2024-05-20
3131
override: true
3232
- name: Rust Cache
3333
uses: Swatinem/[email protected]
@@ -54,7 +54,7 @@ jobs:
5454
with:
5555
profile: minimal
5656
components: rustfmt
57-
toolchain: nightly-2024-01-24
57+
toolchain: nightly-2024-05-20
5858
override: true
5959
- name: Rust Cache
6060
uses: Swatinem/[email protected]
@@ -77,7 +77,7 @@ jobs:
7777
rm -rf crates
7878
- uses: actions-rs/toolchain@v1
7979
with:
80-
toolchain: nightly-2024-01-24
80+
toolchain: nightly-2024-05-20
8181
components: clippy
8282
override: true
8383
- name: Rust Cache
@@ -100,7 +100,7 @@ jobs:
100100
rm -rf crates
101101
- uses: actions-rs/toolchain@v1
102102
with:
103-
toolchain: nightly-2024-01-24
103+
toolchain: nightly-2024-05-20
104104
override: true
105105
- name: Rust Cache
106106
uses: Swatinem/[email protected]
@@ -122,7 +122,7 @@ jobs:
122122
rm -rf crates
123123
- uses: actions-rs/toolchain@v1
124124
with:
125-
toolchain: nightly-2024-01-24
125+
toolchain: nightly-2024-05-20
126126
override: true
127127
- name: Rust Cache
128128
uses: Swatinem/[email protected]

check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CURRENT_DIR=$(basename "$PWD")
44

55

66
if [[ "$CURRENT_DIR" == "bevy_api_gen" ]]; then
7-
cargo clippy --all-targets --message-format=json
7+
cargo +nightly-2024-05-20 clippy --all-targets --message-format=json
88
else
99
cargo clippy --workspace --all-targets --message-format=json --features="lua54 lua_script_api rhai rhai_script_api teal rune bevy/file_watcher bevy/multi_threaded"
1010
fi

crates/bevy_api_gen/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ source = "discover"
3737
rustc_private = true
3838

3939
[rust-analyzer.check]
40-
overrideCommand = ["cargo", "+nightly-2024-01-24", "a", "--message-format=json"]
40+
overrideCommand = ["cargo", "+nightly-2024-05-20", "a", "--message-format=json"]
4141

4242

4343
[dependencies]
4444
log = "0.4"
4545
env_logger = "0.11"
46-
rustc_plugin = "=0.9.0-nightly-2024-01-24"
46+
rustc_plugin = "=0.10.0-nightly-2024-05-20"
4747
indexmap = "2"
4848
tempdir = "0.3"
4949
cargo_metadata = "0.18"

crates/bevy_api_gen/readme.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ bevy_api_gen is a Cargo plugin that generates reflection-powered wrappers for Be
88
To install bevy_api_gen, use the following command:
99

1010
```bash
11-
cargo +nightly-2024-01-24 install bevy_api_gen
11+
cargo +nightly-2024-05-20 install bevy_api_gen
1212
```
1313

1414
# Usage
@@ -18,39 +18,39 @@ cargo +nightly-2024-01-24 install bevy_api_gen
1818
To run the main codegen process, use the following command:
1919

2020
```bash
21-
cargo +nightly-2024-01-24 bevy-api-gen generate
21+
cargo +nightly-2024-05-20 bevy-api-gen generate
2222
```
2323

24-
This will perform all parts of the process and generate meta as well as .rs files for each crate in your workspace in your `/target/plugin-nightly-2024-01-24/bevy_api_gen` directory
24+
This will perform all parts of the process and generate meta as well as .rs files for each crate in your workspace in your `/target/plugin-nightly-2024-05-20/bevy_api_gen` directory
2525

2626
## Collect
2727

2828
After generating all the files, you can 'collect' them in a mod.rs file like so:
2929

3030
```bash
31-
cargo +nightly-2024-01-24 bevy-api-gen collect
31+
cargo +nightly-2024-05-20 bevy-api-gen collect
3232
```
3333

3434
## List Types
3535

3636
To see a list of all `Reflect` implementing types in your workspace run:
3737

3838
```bash
39-
cargo +nightly-2024-01-24 bevy-api-gen list-types > all_types.txt
39+
cargo +nightly-2024-05-20 bevy-api-gen list-types > all_types.txt
4040
```
4141

4242
## List Templates
4343

4444
To see the list of all templates which you can override use:
4545

4646
```bash
47-
cargo +nightly-2024-01-24 bevy-api-gen list-templates
47+
cargo +nightly-2024-05-20 bevy-api-gen list-templates
4848
```
4949

5050
## Print Template
5151

5252
You can also print any of the templates to stdout:
5353

5454
```bash
55-
cargo +nightly-2024-01-24 bevy-api-gen print item.tera
55+
cargo +nightly-2024-05-20 bevy-api-gen print item.tera
5656
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
22
components = ["clippy", "rust-src", "rustc-dev", "llvm-tools"]
3-
channel = "nightly-2024-01-24"
3+
channel = "nightly-2024-05-20"

crates/bevy_api_gen/src/feature_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};
22

33
use cargo_metadata::{DependencyKind, Metadata, Package};
44
use itertools::{Either, Itertools};
5-
use log::{debug, info};
5+
use log::debug;
66

77
#[derive(Clone, Debug)]
88
pub enum FeatureEffect {

crates/bevy_api_gen/src/modifying_file_loader.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ impl FileLoader for ModifyingFileLoader {
2121
path.to_str().unwrap()
2222
);
2323
RealFileLoader.read_file(path).map(|mut f| {
24-
if !f.contains("extern crate mlua") {
24+
// we make it pub so in case we are re-exporting this crate we won't run into private re-export issues
25+
if !f.contains("pub extern crate mlua") {
2526
f.push_str("#[allow(unused_extern_crates)] extern crate mlua;");
2627
}
27-
if !f.contains("extern crate bevy_reflect") {
28+
if !f.contains("pub extern crate bevy_reflect") {
2829
f.push_str("#[allow(unused_extern_crates)] extern crate bevy_reflect;");
2930
}
3031
f

crates/bevy_api_gen/src/passes/find_methods_and_fields.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use log::{info, trace};
33
use rustc_ast::Attribute;
44
use rustc_hir::{
55
def_id::{DefId, LOCAL_CRATE},
6-
Unsafety,
6+
Safety,
77
};
88
use rustc_infer::infer::TyCtxtInferExt;
99
use rustc_middle::ty::{AdtKind, AssocKind, FieldDef, FnSig, ParamEnv, Ty, TyCtxt, TyKind};
@@ -135,7 +135,7 @@ pub(crate) fn find_methods_and_fields(ctxt: &mut BevyCtxt<'_>, _args: &Args) ->
135135
}
136136
};
137137

138-
let is_unsafe = sig.unsafety == Unsafety::Unsafe;
138+
let is_unsafe = sig.safety == Safety::Unsafe;
139139

140140
if trait_did.is_none() && !ctxt.tcx.visibility(fn_did).is_public() {
141141
log::info!(

makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PACKAGE=bevy_mod_scripting
2121
TEST_NAME=
2222
# # valgrind outputs a callgrind.out.<pid>. We can analyze this with kcachegrind
2323
# kcachegrind
24-
NIGHTLY_VERSION=nightly-2024-01-24
24+
NIGHTLY_VERSION=nightly-2024-05-20
2525
BEVY_VERSION=0.14.2
2626
GLAM_VERSION=0.28.0
2727
CODEGEN_PATH=${PWD}/target/codegen
@@ -48,6 +48,7 @@ valgrind:
4848

4949
install_bevy_api_gen:
5050
rustup install ${NIGHTLY_VERSION}
51+
rustup component add rust-src rustc-dev llvm-tools-preview --toolchain ${NIGHTLY_VERSION}
5152
cargo +${NIGHTLY_VERSION} install --path ./crates/bevy_api_gen
5253

5354
prepare_api_gen:

0 commit comments

Comments
 (0)