-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Labels
Description
Related to #502
Note that it compiles without -> &mut ZendClassObject<Example>
.
use ext_php_rs::{prelude::*, types::ZendClassObject};
use ext_php_rs::types::Zval;
#[php_class]
pub struct Example {}
#[php_impl]
impl Example {
pub fn __construct() -> Example {
Example {}
}
pub fn some_method(
self_: &mut ZendClassObject<Example>,
zval: &Zval,
) -> &mut ZendClassObject<Example> {
self_
}
}
#[php_module]
pub fn get_module(module: ModuleBuilder) -> ModuleBuilder {
module.class::<Example>()
}
error[E0106]: missing lifetime specifier
--> src/lib.rs:15:10
|
13 | self_: &mut ZendClassObject<Example>,
| -----------------------------
14 | zval: &Zval,
| -----
15 | ) -> &mut ZendClassObject<Example> {
| ^ expected named lifetime parameter
|
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `self_` or `zval`
help: consider introducing a named lifetime parameter
|
12 ~ pub fn some_method<'a>(
13 ~ self_: &'a mut ZendClassObject<Example>,
14 ~ zval: &'a Zval,
15 ~ ) -> &'a mut ZendClassObject<Example> {
|