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
I expected it to compile and both merkle and get_merkle return a variable with a static lifetime (owned variable).
Instead, get the following error:
error[E0597]: `owned_map` does not live long enough
--> src/lib.rs:12:5
|
11 | let owned_map = m.clone();
| --------- binding `owned_map` declared here
12 | owned_map.merkle()
| ^^^^^^^^^---------
| |
| borrowed value does not live long enough
| argument requires that `owned_map` is borrowed for `'static`
13 | }
| - `owned_map` dropped here while still borrowed
RUST_BACKTRACE=1 cargo build
Compiling issue v0.1.0 (/private/tmp/issue)
error[E0597]: `owned_map` does not live long enough
--> src/main.rs:9:5
|
8 | let owned_map: T = m.clone();
| --------- binding `owned_map` declared here
9 | owned_map.merkle()
| ^^^^^^^^^---------
| |
| borrowed value does not live long enough
| argument requires that `owned_map` is borrowed for `'static`
10 | }
| - `owned_map` dropped here while still borrowed
For more information about this error, try `rustc --explain E0597`.
error: could not compile `issue` (bin "issue") due to 1 previous error
The text was updated successfully, but these errors were encountered:
The references to impl Trait's are not working as expected. This might be not a compiler bug per se but rather an language ergonomics issue.
I tried this code:
I expected it to compile and both
merkle
andget_merkle
return a variable with a static lifetime (owned variable).Instead, get the following error:
Meta
Same happens on nightly and beta channels
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: