You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<anon>:1:1: 3:2 note: consider using an explicit lifetime parameter as shown: fn foo<'a>(x: Option<&'a int>) -> &'a int
<anon>:1 fn foo(x: Option<&int>) -> &int {
<anon>:2 x.unwrap()
<anon>:3 }
<anon>:2:5: 2:15 error: cannot infer an appropriate lifetime due to conflicting requirements
<anon>:2 x.unwrap()
^~~~~~~~~~
<anon>:2:5: 2:15 error: mismatched types: expected `&int` but found `&int` (lifetime mismatch)
<anon>:2 x.unwrap()
^~~~~~~~~~
This could be mildly confusing when there are multiple error messages, and so someone may misinterpret some note as being attached to a previous error. This error should probably appear after the cannot infer an appropriate lifetime error or perhaps after the mismatched types error.
The text was updated successfully, but these errors were encountered:
Yields the following error:
This could be mildly confusing when there are multiple error messages, and so someone may misinterpret some note as being attached to a previous error. This error should probably appear after the
cannot infer an appropriate lifetime
error or perhaps after themismatched types
error.The text was updated successfully, but these errors were encountered: