rust/tests/ui/generic-associated-types/issue-80433.stderr

55 lines
2.1 KiB
Plaintext

error: missing required bound on `Output`
--> $DIR/issue-80433.rs:7:5
|
LL | type Output<'a>;
| ^^^^^^^^^^^^^^^-
| |
| help: add the required where clause: `where Self: 'a`
|
= note: this bound is currently required to ensure that impls have maximum flexibility
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error[E0107]: missing generics for associated type `TestMut::Output`
--> $DIR/issue-80433.rs:21:47
|
LL | fn test_simpler<'a>(dst: &'a mut impl TestMut<Output = &'a mut f32>)
| ^^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
--> $DIR/issue-80433.rs:7:10
|
LL | type Output<'a>;
| ^^^^^^ --
help: add missing lifetime argument
|
LL | fn test_simpler<'a>(dst: &'a mut impl TestMut<Output<'a> = &'a mut f32>)
| ++++
error[E0499]: cannot borrow `*dst` as mutable more than once at a time
--> $DIR/issue-80433.rs:25:10
|
LL | *dst.test_mut() = n.into();
| ^^^-----------
| |
| `*dst` was mutably borrowed here in the previous iteration of the loop
| argument requires that `*dst` is borrowed for `'static`
error[E0521]: borrowed data escapes outside of function
--> $DIR/issue-80433.rs:25:10
|
LL | fn test_simpler<'a>(dst: &'a mut impl TestMut<Output = &'a mut f32>)
| -- --- `dst` is a reference that is only valid in the function body
| |
| lifetime `'a` defined here
...
LL | *dst.test_mut() = n.into();
| ^^^^^^^^^^^^^^
| |
| `dst` escapes the function body here
| argument requires that `'a` must outlive `'static`
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0107, E0499, E0521.
For more information about an error, try `rustc --explain E0107`.