Fix rust 1.62 changes (#5154)

# Objective

CI is now failing with some changes that landed in 1.62.

## Solution

* Fix an unused lifetime by using it (we double-used the `w` lifetime).
* Update compile_fail error messages
* temporarily disable check-unused-dependencies
This commit is contained in:
Carter Anderson 2022-06-30 19:24:28 +00:00
parent b3fa4790b7
commit 96f0ebb9af
6 changed files with 76 additions and 26 deletions

2
.github/bors.toml vendored
View File

@ -11,7 +11,7 @@ status = [
"run-examples-on-wasm", "run-examples-on-wasm",
"check-doc", "check-doc",
"check-missing-examples-in-docs", "check-missing-examples-in-docs",
"check-unused-dependencies", # "check-unused-dependencies",
"ci", "ci",
"miri", "miri",
"check-compiles", "check-compiles",

View File

@ -274,27 +274,27 @@ jobs:
echo "if this step fails, run the following command and commit the changed file on your PR." echo "if this step fails, run the following command and commit the changed file on your PR."
echo " > cargo run -p build-example-pages -- update" echo " > cargo run -p build-example-pages -- update"
git diff --quiet HEAD -- git diff --quiet HEAD --
# TODO: re-enable once cargo-udeps builds with changes from rust 1.62
check-unused-dependencies: # check-unused-dependencies:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- uses: actions/cache@v3 # - uses: actions/cache@v3
with: # with:
path: | # path: |
~/.cargo/bin/ # ~/.cargo/bin/
~/.cargo/registry/index/ # ~/.cargo/registry/index/
~/.cargo/registry/cache/ # ~/.cargo/registry/cache/
~/.cargo/git/db/ # ~/.cargo/git/db/
target/ # target/
key: ${{ runner.os }}-cargo-check-unused-dependencies-${{ hashFiles('**/Cargo.toml') }} # key: ${{ runner.os }}-cargo-check-unused-dependencies-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1 # - uses: actions-rs/toolchain@v1
with: # with:
toolchain: nightly # toolchain: nightly
override: true # override: true
- name: Installs cargo-udeps # - name: Installs cargo-udeps
run: cargo install --force cargo-udeps # run: cargo install --force cargo-udeps
- name: Install alsa and udev # - name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev # run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
- name: Run cargo udeps # - name: Run cargo udeps
run: cargo udeps # run: cargo udeps

View File

@ -142,7 +142,7 @@ where
} }
impl<'w, 's, Q: WorldQuery, QF: Fetch<'w, State = Q::State>, F: WorldQuery, I: Iterator> Iterator impl<'w, 's, Q: WorldQuery, QF: Fetch<'w, State = Q::State>, F: WorldQuery, I: Iterator> Iterator
for QueryManyIter<'w, 'w, Q, QF, F, I> for QueryManyIter<'w, 's, Q, QF, F, I>
where where
I::Item: Borrow<Entity>, I::Item: Borrow<Entity>,
{ {

View File

@ -6,6 +6,16 @@ error[E0277]: the trait bound `bevy_ecs::query::Changed<Foo>: ArchetypeFilter` i
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
| |
= help: the following other types implement trait `ArchetypeFilter`:
()
(F0, F1)
(F0, F1, F2)
(F0, F1, F2, F3)
(F0, F1, F2, F3, F4)
(F0, F1, F2, F3, F4, F5)
(F0, F1, F2, F3, F4, F5, F6)
(F0, F1, F2, F3, F4, F5, F6, F7)
and 26 others
= note: required because of the requirements on the impl of `ExactSizeIterator` for `QueryIter<'_, '_, &Foo, ReadFetch<'_, Foo>, bevy_ecs::query::Changed<Foo>>` = note: required because of the requirements on the impl of `ExactSizeIterator` for `QueryIter<'_, '_, &Foo, ReadFetch<'_, Foo>, bevy_ecs::query::Changed<Foo>>`
note: required by a bound in `is_exact_size_iterator` note: required by a bound in `is_exact_size_iterator`
--> tests/ui/query_exact_sized_iterator_safety.rs:16:30 --> tests/ui/query_exact_sized_iterator_safety.rs:16:30
@ -21,6 +31,16 @@ error[E0277]: the trait bound `bevy_ecs::query::Added<Foo>: ArchetypeFilter` is
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
| |
= help: the following other types implement trait `ArchetypeFilter`:
()
(F0, F1)
(F0, F1, F2)
(F0, F1, F2, F3)
(F0, F1, F2, F3, F4)
(F0, F1, F2, F3, F4, F5)
(F0, F1, F2, F3, F4, F5, F6)
(F0, F1, F2, F3, F4, F5, F6, F7)
and 26 others
= note: required because of the requirements on the impl of `ExactSizeIterator` for `QueryIter<'_, '_, &Foo, ReadFetch<'_, Foo>, bevy_ecs::query::Added<Foo>>` = note: required because of the requirements on the impl of `ExactSizeIterator` for `QueryIter<'_, '_, &Foo, ReadFetch<'_, Foo>, bevy_ecs::query::Added<Foo>>`
note: required by a bound in `is_exact_size_iterator` note: required by a bound in `is_exact_size_iterator`
--> tests/ui/query_exact_sized_iterator_safety.rs:16:30 --> tests/ui/query_exact_sized_iterator_safety.rs:16:30

View File

@ -12,6 +12,16 @@ error[E0277]: the trait bound `&'static mut Foo: ReadOnlyWorldQuery` is not sati
18 | assert_readonly::<Mutable>(); 18 | assert_readonly::<Mutable>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `ReadOnlyWorldQuery` is not implemented for `&'static mut Foo` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `ReadOnlyWorldQuery` is not implemented for `&'static mut Foo`
| |
= help: the following other types implement trait `ReadOnlyWorldQuery`:
&T
()
(F0, F1)
(F0, F1, F2)
(F0, F1, F2, F3)
(F0, F1, F2, F3, F4)
(F0, F1, F2, F3, F4, F5)
(F0, F1, F2, F3, F4, F5, F6)
and 48 others
= note: `ReadOnlyWorldQuery` is implemented for `&'static Foo`, but not for `&'static mut Foo` = note: `ReadOnlyWorldQuery` is implemented for `&'static Foo`, but not for `&'static mut Foo`
= note: required because of the requirements on the impl of `ReadOnlySystemParamFetch` for `QueryState<&'static mut Foo>` = note: required because of the requirements on the impl of `ReadOnlySystemParamFetch` for `QueryState<&'static mut Foo>`
= note: 2 redundant requirements hidden = note: 2 redundant requirements hidden

View File

@ -4,6 +4,16 @@ error[E0277]: the trait bound `&'static mut Foo: ReadOnlyWorldQuery` is not sati
9 | a: &'static mut Foo, 9 | a: &'static mut Foo,
| ^^^^^^^^^^^^^^^^ the trait `ReadOnlyWorldQuery` is not implemented for `&'static mut Foo` | ^^^^^^^^^^^^^^^^ the trait `ReadOnlyWorldQuery` is not implemented for `&'static mut Foo`
| |
= help: the following other types implement trait `ReadOnlyWorldQuery`:
&T
()
(F0, F1)
(F0, F1, F2)
(F0, F1, F2, F3)
(F0, F1, F2, F3, F4)
(F0, F1, F2, F3, F4, F5)
(F0, F1, F2, F3, F4, F5, F6)
and 51 others
note: required by a bound in `_::assert_readonly` note: required by a bound in `_::assert_readonly`
--> tests/ui/world_query_derive.rs:7:10 --> tests/ui/world_query_derive.rs:7:10
| |
@ -17,6 +27,16 @@ error[E0277]: the trait bound `MutableMarked: ReadOnlyWorldQuery` is not satisfi
20 | a: MutableMarked, 20 | a: MutableMarked,
| ^^^^^^^^^^^^^ the trait `ReadOnlyWorldQuery` is not implemented for `MutableMarked` | ^^^^^^^^^^^^^ the trait `ReadOnlyWorldQuery` is not implemented for `MutableMarked`
| |
= help: the following other types implement trait `ReadOnlyWorldQuery`:
&T
()
(F0, F1)
(F0, F1, F2)
(F0, F1, F2, F3)
(F0, F1, F2, F3, F4)
(F0, F1, F2, F3, F4, F5)
(F0, F1, F2, F3, F4, F5, F6)
and 51 others
note: required by a bound in `_::assert_readonly` note: required by a bound in `_::assert_readonly`
--> tests/ui/world_query_derive.rs:18:10 --> tests/ui/world_query_derive.rs:18:10
| |