error[E0502]: cannot borrow `query` as immutable because it is also borrowed as mutable
 --> tests/ui/query_to_readonly.rs:9:18
  |
8 |     for _ in query.iter_mut() {
  |              ----------------
  |              |
  |              mutable borrow occurs here
  |              mutable borrow later used here
9 |         for _ in query.to_readonly().iter() {}
  |                  ^^^^^^^^^^^^^^^^^^^ immutable borrow occurs here

error[E0502]: cannot borrow `query` as mutable because it is also borrowed as immutable
  --> tests/ui/query_to_readonly.rs:14:18
   |
13 |     for _ in query.to_readonly().iter() {
   |              --------------------------
   |              |
   |              immutable borrow occurs here
   |              immutable borrow later used here
14 |         for _ in query.iter_mut() {}
   |                  ^^^^^^^^^^^^^^^^ mutable borrow occurs here

error[E0502]: cannot borrow `query` as immutable because it is also borrowed as mutable
  --> tests/ui/query_to_readonly.rs:39:30
   |
36 |         let mut mut_foo = query.single_mut();
   |                           ------------------ mutable borrow occurs here
...
39 |         let readonly_query = query.to_readonly();
   |                              ^^^^^^^^^^^^^^^^^^^ immutable borrow occurs here
...
43 |         *mut_foo = Foo;
   |          ------- mutable borrow later used here

error[E0502]: cannot borrow `query` as mutable because it is also borrowed as immutable
  --> tests/ui/query_to_readonly.rs:55:27
   |
51 |         let readonly_query = query.to_readonly();
   |                              ------------------- immutable borrow occurs here
...
55 |         let mut mut_foo = query.single_mut();
   |                           ^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
56 |
57 |         println!("{ref_foo:?}");
   |                    ------- immutable borrow later used here
