28 lines
880 B
Plaintext
28 lines
880 B
Plaintext
|
error[E0308]: mismatched types
|
||
|
--> $DIR/ex2b-push-no-existing-names.rs:16:12
|
||
|
|
|
||
|
16 | x.push(y);
|
||
|
| ^ lifetime mismatch
|
||
|
|
|
||
|
= note: expected type `Ref<'_, i32>`
|
||
|
found type `Ref<'_, i32>`
|
||
|
note: the anonymous lifetime #3 defined on the body at 15:43...
|
||
|
--> $DIR/ex2b-push-no-existing-names.rs:15:44
|
||
|
|
|
||
|
15 | fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
|
||
|
| ____________________________________________^ starting here...
|
||
|
16 | | x.push(y);
|
||
|
17 | | }
|
||
|
| |_^ ...ending here
|
||
|
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 15:43
|
||
|
--> $DIR/ex2b-push-no-existing-names.rs:15:44
|
||
|
|
|
||
|
15 | fn foo(x: &mut Vec<Ref<i32>>, y: Ref<i32>) {
|
||
|
| ____________________________________________^ starting here...
|
||
|
16 | | x.push(y);
|
||
|
17 | | }
|
||
|
| |_^ ...ending here
|
||
|
|
||
|
error: aborting due to previous error
|
||
|
|