|
| 1 | +error[E0599]: no function or associated item named `project_move_mut` found for struct `ProjectedField` in the current scope |
| 2 | + --> tests/ui/compile-fail/pre_rfc.rs:68:5 |
| 3 | + | |
| 4 | +68 | p!(@move mut foo->bar) |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `ProjectedField<_, _>` |
| 6 | + | |
| 7 | +note: if you're trying to build a new `ProjectedField<_, _>`, consider using `ProjectedField::<P, F>::__new` which returns `ProjectedField<_, _>` |
| 8 | + --> src/compat.rs |
| 9 | + | |
| 10 | + | pub unsafe fn __new() -> Self { |
| 11 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 12 | +help: there is a method `project_move` with a similar name, but with different arguments |
| 13 | + --> src/compat.rs |
| 14 | + | |
| 15 | + | / pub unsafe fn project_move<'a>(self, raw: *const P) -> <P as Project<F>>::Output<'a> |
| 16 | + | | where |
| 17 | + | | P: Project<F>, |
| 18 | + | |______________________^ |
| 19 | + = note: this error originates in the macro `p` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 20 | + |
| 21 | +warning: unused variable: `b` |
| 22 | + --> tests/ui/compile-fail/pre_rfc.rs:38:9 |
| 23 | + | |
| 24 | +38 | let b = p!(@mut foo->field); |
| 25 | + | ^ help: if this is intentional, prefix it with an underscore: `_b` |
| 26 | + | |
| 27 | + = note: `#[warn(unused_variables)]` on by default |
| 28 | + |
| 29 | +error[E0499]: cannot borrow value as mutable more than once at a time |
| 30 | + --> tests/ui/compile-fail/pre_rfc.rs:38:13 |
| 31 | + | |
| 32 | +36 | let a = p!(@mut foo->field); |
| 33 | + | ------------------- first mutable borrow occurs here |
| 34 | +37 | // ------------------- first exclusive projection occurs here |
| 35 | +38 | let b = p!(@mut foo->field); |
| 36 | + | ^^^^^^^^^^^^^^^^^^^ second mutable borrow occurs here |
| 37 | +39 | // ^^^^^^^^^^^^^^^^^^^ second exclusive projection occurs here |
| 38 | +40 | MaybeUninit::write(a, 42); |
| 39 | + | - first borrow later used here |
| 40 | + | |
| 41 | + = note: this error originates in the macro `p` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 42 | + |
| 43 | +error[E0502]: cannot borrow `*foo` as mutable because it is also borrowed as immutable |
| 44 | + --> tests/ui/compile-fail/pre_rfc.rs:53:5 |
| 45 | + | |
| 46 | +46 | start_proj!(foo); |
| 47 | + | ---------------- immutable borrow occurs here |
| 48 | +... |
| 49 | +53 | MaybeUninit::write(foo, value); |
| 50 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here |
| 51 | +54 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^ projected value used here |
| 52 | +55 | unsafe { field.assume_init_read() } |
| 53 | + | ----- immutable borrow later used here |
| 54 | + |
| 55 | +error[E0515]: cannot return value referencing function parameter `foo` |
| 56 | + --> tests/ui/compile-fail/pre_rfc.rs:74:8 |
| 57 | + | |
| 58 | +72 | start_proj!(mut foo); |
| 59 | + | -------------------- `foo` is borrowed here |
| 60 | +73 | //------------------ `foo` is borrowed here |
| 61 | +74 | p!(@mut foo->bar) |
| 62 | + | ^^^^^^^^^^^^^ returns a value referencing data owned by the current function |
0 commit comments