Skip to content

Commit 73ffd9a

Browse files
authored
chore: update compile fail test stderr files (#18056)
I noticed this while working on #18017 . Some of the `stderr` compile_fail tests were updated while I generated the output for the new tests I introduced in the mentioned PR. I'm on rust 1.85.0
1 parent fdd9ffa commit 73ffd9a

8 files changed

+118
-83
lines changed

crates/bevy_ecs/compile_fail/tests/ui/query_exact_sized_iterator_safety.stderr

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
error[E0277]: the trait bound `bevy_ecs::query::Changed<Foo>: ArchetypeFilter` is not satisfied
1+
error[E0277]: `bevy_ecs::query::Changed<Foo>` is not a valid `Query` filter based on archetype information
22
--> tests/ui/query_exact_sized_iterator_safety.rs:7:28
33
|
44
7 | is_exact_size_iterator(query.iter());
5-
| ---------------------- ^^^^^^^^^^^^ the trait `ArchetypeFilter` is not implemented for `bevy_ecs::query::Changed<Foo>`, which is required by `QueryIter<'_, '_, &Foo, bevy_ecs::query::Changed<Foo>>: ExactSizeIterator`
5+
| ---------------------- ^^^^^^^^^^^^ invalid `Query` filter
66
| |
77
| required by a bound introduced by this call
88
|
9+
= help: the trait `ArchetypeFilter` is not implemented for `bevy_ecs::query::Changed<Foo>`
10+
= note: an `ArchetypeFilter` typically uses a combination of `With<T>` and `Without<T>` statements
911
= help: the following other types implement trait `ArchetypeFilter`:
10-
With<T>
11-
Without<T>
12-
Or<()>
13-
Or<(F0,)>
14-
Or<(F0, F1)>
15-
Or<(F0, F1, F2)>
16-
Or<(F0, F1, F2, F3)>
17-
Or<(F0, F1, F2, F3, F4)>
12+
()
13+
(F,)
14+
(F0, F1)
15+
(F0, F1, F2)
16+
(F0, F1, F2, F3)
17+
(F0, F1, F2, F3, F4)
18+
(F0, F1, F2, F3, F4, F5)
19+
(F0, F1, F2, F3, F4, F5, F6)
1820
and 26 others
1921
= note: required for `QueryIter<'_, '_, &Foo, bevy_ecs::query::Changed<Foo>>` to implement `ExactSizeIterator`
2022
note: required by a bound in `is_exact_size_iterator`
@@ -23,23 +25,25 @@ note: required by a bound in `is_exact_size_iterator`
2325
16 | fn is_exact_size_iterator<T: ExactSizeIterator>(_iter: T) {}
2426
| ^^^^^^^^^^^^^^^^^ required by this bound in `is_exact_size_iterator`
2527

26-
error[E0277]: the trait bound `bevy_ecs::query::Added<Foo>: ArchetypeFilter` is not satisfied
28+
error[E0277]: `bevy_ecs::query::Added<Foo>` is not a valid `Query` filter based on archetype information
2729
--> tests/ui/query_exact_sized_iterator_safety.rs:12:28
2830
|
2931
12 | is_exact_size_iterator(query.iter());
30-
| ---------------------- ^^^^^^^^^^^^ the trait `ArchetypeFilter` is not implemented for `bevy_ecs::query::Added<Foo>`, which is required by `QueryIter<'_, '_, &Foo, bevy_ecs::query::Added<Foo>>: ExactSizeIterator`
32+
| ---------------------- ^^^^^^^^^^^^ invalid `Query` filter
3133
| |
3234
| required by a bound introduced by this call
3335
|
36+
= help: the trait `ArchetypeFilter` is not implemented for `bevy_ecs::query::Added<Foo>`
37+
= note: an `ArchetypeFilter` typically uses a combination of `With<T>` and `Without<T>` statements
3438
= help: the following other types implement trait `ArchetypeFilter`:
35-
With<T>
36-
Without<T>
37-
Or<()>
38-
Or<(F0,)>
39-
Or<(F0, F1)>
40-
Or<(F0, F1, F2)>
41-
Or<(F0, F1, F2, F3)>
42-
Or<(F0, F1, F2, F3, F4)>
39+
()
40+
(F,)
41+
(F0, F1)
42+
(F0, F1, F2)
43+
(F0, F1, F2, F3)
44+
(F0, F1, F2, F3, F4)
45+
(F0, F1, F2, F3, F4, F5)
46+
(F0, F1, F2, F3, F4, F5, F6)
4347
and 26 others
4448
= note: required for `QueryIter<'_, '_, &Foo, bevy_ecs::query::Added<Foo>>` to implement `ExactSizeIterator`
4549
note: required by a bound in `is_exact_size_iterator`

crates/bevy_ecs/compile_fail/tests/ui/query_iter_combinations_mut_iterator_safety.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ error[E0277]: the trait bound `&mut A: ReadOnlyQueryData` is not satisfied
22
--> tests/ui/query_iter_combinations_mut_iterator_safety.rs:9:17
33
|
44
9 | is_iterator(iter)
5-
| ----------- ^^^^ the trait `ReadOnlyQueryData` is not implemented for `&mut A`, which is required by `QueryCombinationIter<'_, '_, &mut A, (), _>: Iterator`
5+
| ----------- ^^^^ the trait `ReadOnlyQueryData` is not implemented for `&mut A`
66
| |
77
| required by a bound introduced by this call
88
|
99
= help: the following other types implement trait `ReadOnlyQueryData`:
10-
bevy_ecs::change_detection::Ref<'__w, T>
11-
Has<T>
12-
AnyOf<()>
13-
AnyOf<(F0,)>
14-
AnyOf<(F0, F1)>
15-
AnyOf<(F0, F1, F2)>
16-
AnyOf<(F0, F1, F2, F3)>
17-
AnyOf<(F0, F1, F2, F3, F4)>
18-
and 34 others
10+
&Archetype
11+
&T
12+
()
13+
(F,)
14+
(F0, F1)
15+
(F0, F1, F2)
16+
(F0, F1, F2, F3)
17+
(F0, F1, F2, F3, F4)
18+
and 36 others
1919
= note: `ReadOnlyQueryData` is implemented for `&A`, but not for `&mut A`
2020
= note: required for `QueryCombinationIter<'_, '_, &mut A, (), _>` to implement `Iterator`
2121
note: required by a bound in `is_iterator`

crates/bevy_ecs/compile_fail/tests/ui/query_iter_many_mut_iterator_safety.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ error[E0277]: the trait bound `&mut A: ReadOnlyQueryData` is not satisfied
22
--> tests/ui/query_iter_many_mut_iterator_safety.rs:9:17
33
|
44
9 | is_iterator(iter)
5-
| ----------- ^^^^ the trait `ReadOnlyQueryData` is not implemented for `&mut A`, which is required by `QueryManyIter<'_, '_, &mut A, (), std::array::IntoIter<bevy_ecs::entity::Entity, 1>>: Iterator`
5+
| ----------- ^^^^ the trait `ReadOnlyQueryData` is not implemented for `&mut A`
66
| |
77
| required by a bound introduced by this call
88
|
99
= help: the following other types implement trait `ReadOnlyQueryData`:
10-
bevy_ecs::change_detection::Ref<'__w, T>
11-
Has<T>
12-
AnyOf<()>
13-
AnyOf<(F0,)>
14-
AnyOf<(F0, F1)>
15-
AnyOf<(F0, F1, F2)>
16-
AnyOf<(F0, F1, F2, F3)>
17-
AnyOf<(F0, F1, F2, F3, F4)>
18-
and 34 others
10+
&Archetype
11+
&T
12+
()
13+
(F,)
14+
(F0, F1)
15+
(F0, F1, F2)
16+
(F0, F1, F2, F3)
17+
(F0, F1, F2, F3, F4)
18+
and 36 others
1919
= note: `ReadOnlyQueryData` is implemented for `&A`, but not for `&mut A`
2020
= note: required for `QueryManyIter<'_, '_, &mut A, (), std::array::IntoIter<bevy_ecs::entity::Entity, 1>>` to implement `Iterator`
2121
note: required by a bound in `is_iterator`
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
error[E0499]: cannot borrow `lens` as mutable more than once at a time
2-
--> tests/ui\query_lens_lifetime_safety.rs:18:39
2+
--> tests/ui/query_lens_lifetime_safety.rs:18:39
33
|
44
17 | let mut data: Mut<Foo> = lens.query().get_inner(e).unwrap();
55
| ---- first mutable borrow occurs here
6+
18 | let mut data2: Mut<Foo> = lens.query().get_inner(e).unwrap();
7+
| ^^^^ second mutable borrow occurs here
8+
19 |
9+
20 | assert_eq!(&mut *data, &mut *data2); // oops UB
10+
| ---- first borrow later used here
11+
12+
error: aborting due to 1 previous error
13+
14+
For more information about this error, try `rustc --explain E0499`.

crates/bevy_ecs/compile_fail/tests/ui/query_to_readonly.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ error[E0502]: cannot borrow `query` as immutable because it is also borrowed as
66
| |
77
| mutable borrow occurs here
88
| mutable borrow later used here
9-
9 | for _ in query.to_readonly().iter() {}
9+
9 | for _ in query.as_readonly().iter() {}
1010
| ^^^^^ immutable borrow occurs here
1111

1212
error[E0502]: cannot borrow `query` as mutable because it is also borrowed as immutable
1313
--> tests/ui/query_to_readonly.rs:15:18
1414
|
15-
14 | for _ in query.to_readonly().iter() {
15+
14 | for _ in query.as_readonly().iter() {
1616
| --------------------------
1717
| |
1818
| immutable borrow occurs here
@@ -26,7 +26,7 @@ error[E0502]: cannot borrow `query` as immutable because it is also borrowed as
2626
38 | let mut mut_foo = query.single_mut();
2727
| ----- mutable borrow occurs here
2828
...
29-
41 | let readonly_query = query.to_readonly();
29+
41 | let readonly_query = query.as_readonly();
3030
| ^^^^^ immutable borrow occurs here
3131
...
3232
46 | *mut_foo = Foo;
@@ -35,7 +35,7 @@ error[E0502]: cannot borrow `query` as immutable because it is also borrowed as
3535
error[E0502]: cannot borrow `query` as mutable because it is also borrowed as immutable
3636
--> tests/ui/query_to_readonly.rs:58:27
3737
|
38-
54 | let readonly_query = query.to_readonly();
38+
54 | let readonly_query = query.as_readonly();
3939
| ----- immutable borrow occurs here
4040
...
4141
58 | let mut mut_foo = query.single_mut();

crates/bevy_ecs/compile_fail/tests/ui/system_param_derive_readonly.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@ error[E0277]: the trait bound `&'static mut Foo: ReadOnlyQueryData` is not satis
22
--> tests/ui/system_param_derive_readonly.rs:16:11
33
|
44
16 | state.get(&world);
5-
| ^^^ the trait `ReadOnlyQueryData` is not implemented for `&'static mut Foo`, which is required by `Mutable<'_, '_>: ReadOnlySystemParam`
5+
| ^^^ the trait `ReadOnlyQueryData` is not implemented for `&'static mut Foo`
66
|
77
= help: the following other types implement trait `ReadOnlyQueryData`:
8-
bevy_ecs::change_detection::Ref<'__w, T>
9-
Has<T>
10-
AnyOf<()>
11-
AnyOf<(F0,)>
12-
AnyOf<(F0, F1)>
13-
AnyOf<(F0, F1, F2)>
14-
AnyOf<(F0, F1, F2, F3)>
15-
AnyOf<(F0, F1, F2, F3, F4)>
16-
and 34 others
8+
&Archetype
9+
&T
10+
()
11+
(F,)
12+
(F0, F1)
13+
(F0, F1, F2)
14+
(F0, F1, F2, F3)
15+
(F0, F1, F2, F3, F4)
16+
and 36 others
1717
= note: `ReadOnlyQueryData` is implemented for `&'static Foo`, but not for `&'static mut Foo`
1818
= note: required for `bevy_ecs::system::Query<'_, '_, &'static mut Foo>` to implement `ReadOnlySystemParam`
1919
= note: 1 redundant requirement hidden
2020
= note: required for `Mutable<'_, '_>` to implement `ReadOnlySystemParam`
2121
note: required by a bound in `SystemState::<Param>::get`
22-
--> $BEVY_ROOT/crates/bevy_ecs/src/system/function_system.rs:215:16
22+
--> $BEVY_ROOT/bevy_ecs/src/system/function_system.rs:487:16
2323
|
24-
213 | pub fn get<'w, 's>(&'s mut self, world: &'w World) -> SystemParamItem<'w, 's, Param>
24+
485 | pub fn get<'w, 's>(&'s mut self, world: &'w World) -> SystemParamItem<'w, 's, Param>
2525
| --- required by a bound in this associated function
26-
214 | where
27-
215 | Param: ReadOnlySystemParam,
26+
486 | where
27+
487 | Param: ReadOnlySystemParam,
2828
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `SystemState::<Param>::get`
2929

3030
error: aborting due to 1 previous error
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0521]: borrowed data escapes outside of closure
2-
--> tests/ui\system_query_iter_sort_lifetime_safety.rs:12:9
2+
--> tests/ui/system_query_iter_sort_lifetime_safety.rs:12:9
33
|
44
9 | let mut stored: Option<&A> = None;
55
| ---------- `stored` declared here, outside of the closure body
@@ -8,3 +8,7 @@ error[E0521]: borrowed data escapes outside of closure
88
11 | // Try to smuggle the lens item out of the closure.
99
12 | stored = Some(left);
1010
| ^^^^^^^^^^^^^^^^^^^ `left` escapes the closure body here
11+
12+
error: aborting due to 1 previous error
13+
14+
For more information about this error, try `rustc --explain E0521`.
Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1+
error: invalid attribute, expected `mutable` or `derive`
2+
--> tests/ui/world_query_derive.rs:14:14
3+
|
4+
14 | #[query_data(mut)]
5+
| ^^^
6+
7+
error: `mutable` does not take any arguments
8+
--> tests/ui/world_query_derive.rs:21:14
9+
|
10+
21 | #[query_data(mutable(foo))]
11+
| ^^^^^^^
12+
13+
error: `derive` requires at least one argument
14+
--> tests/ui/world_query_derive.rs:28:14
15+
|
16+
28 | #[query_data(derive)]
17+
| ^^^^^^
18+
119
error[E0277]: the trait bound `&'static mut Foo: ReadOnlyQueryData` is not satisfied
220
--> tests/ui/world_query_derive.rs:10:8
321
|
422
10 | a: &'static mut Foo,
523
| ^^^^^^^^^^^^^^^^ the trait `ReadOnlyQueryData` is not implemented for `&'static mut Foo`
624
|
725
= help: the following other types implement trait `ReadOnlyQueryData`:
8-
MutableUnmarked
9-
MutableMarkedReadOnly
10-
NestedMutableUnmarked
11-
bevy_ecs::change_detection::Ref<'__w, T>
12-
Has<T>
13-
AnyOf<()>
14-
AnyOf<(F0,)>
15-
AnyOf<(F0, F1)>
16-
and 37 others
26+
&Archetype
27+
&T
28+
()
29+
(F,)
30+
(F0, F1)
31+
(F0, F1, F2)
32+
(F0, F1, F2, F3)
33+
(F0, F1, F2, F3, F4)
34+
and 39 others
1735
note: required by a bound in `_::assert_readonly`
1836
--> tests/ui/world_query_derive.rs:7:10
1937
|
@@ -22,28 +40,28 @@ note: required by a bound in `_::assert_readonly`
2240
= note: this error originates in the derive macro `QueryData` (in Nightly builds, run with -Z macro-backtrace for more info)
2341

2442
error[E0277]: the trait bound `MutableMarked: ReadOnlyQueryData` is not satisfied
25-
--> tests/ui/world_query_derive.rs:22:8
43+
--> tests/ui/world_query_derive.rs:43:8
2644
|
27-
22 | a: MutableMarked,
45+
43 | a: MutableMarked,
2846
| ^^^^^^^^^^^^^ the trait `ReadOnlyQueryData` is not implemented for `MutableMarked`
2947
|
3048
= help: the following other types implement trait `ReadOnlyQueryData`:
31-
MutableUnmarked
32-
MutableMarkedReadOnly
33-
NestedMutableUnmarked
34-
bevy_ecs::change_detection::Ref<'__w, T>
35-
Has<T>
36-
AnyOf<()>
37-
AnyOf<(F0,)>
38-
AnyOf<(F0, F1)>
39-
and 37 others
49+
&Archetype
50+
&T
51+
()
52+
(F,)
53+
(F0, F1)
54+
(F0, F1, F2)
55+
(F0, F1, F2, F3)
56+
(F0, F1, F2, F3, F4)
57+
and 39 others
4058
note: required by a bound in `_::assert_readonly`
41-
--> tests/ui/world_query_derive.rs:19:10
59+
--> tests/ui/world_query_derive.rs:40:10
4260
|
43-
19 | #[derive(QueryData)]
61+
40 | #[derive(QueryData)]
4462
| ^^^^^^^^^ required by this bound in `assert_readonly`
4563
= note: this error originates in the derive macro `QueryData` (in Nightly builds, run with -Z macro-backtrace for more info)
4664

47-
error: aborting due to 2 previous errors
65+
error: aborting due to 5 previous errors
4866

4967
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)