memflow / memflow

physical memory introspection framework

Home Page:https://memflow.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bumpalo breaks compilation

cybergrind opened this issue · comments

I'm not sure if you actually want to fix this, posting it to save time for someone who get the same error
If you add memflow 0.2.0-beta7 to the fresh crate it doesn't compile and give this error:

error[E0500]: closure requires unique access to `self` but it is already borrowed                                                                                                                                                     
   --> /home/kpi/.cargo/registry/src/github.com-1ecc6299db9ec823/memflow-0.2.0-beta7/src/mem/virt_mem/virtual_dma.rs:216:66
    |
203 |         let mut translation = BumpVec::with_capacity_in(inp.size_hint().0, &self.arena);
    |                                                                            ----------- borrow occurs here
...
216 |         MemOps::with_raw(translation.into_iter(), out, out_fail, |data| {
    |         ---------------- first borrow later used by call         ^^^^^^ closure construction occurs here
217 |             self.phys_mem.phys_read_raw_iter(data)
    |             ------------- second borrow occurs due to use of `self` in closure


error[E0500]: closure requires unique access to `self` but it is already borrowed                                                                                                                                                     
   --> /home/kpi/.cargo/registry/src/github.com-1ecc6299db9ec823/memflow-0.2.0-beta7/src/mem/virt_mem/virtual_dma.rs:243:66
    |
230 |         let mut translation = BumpVec::with_capacity_in(inp.size_hint().0, &self.arena);
    |                                                                            ----------- borrow occurs here
...
243 |         MemOps::with_raw(translation.into_iter(), out, out_fail, |data| {
    |         ---------------- first borrow later used by call         ^^^^^^ closure construction occurs here
244 |             self.phys_mem.phys_write_raw_iter(data)
    |             ------------- second borrow occurs due to use of `self` in closure

Fixed with: bumpalo = "=3.10.0"

commented

Thanks for the report, totally happens here for me as well after i ran cargo update. So this is something that broke through semver. I'll have a look and report back when i updated it accordingly.

commented

Alright, i yanked the 0.2.0-beta7 version and released 0.2.0-beta8 as a drop-in replacement (no feature changes). Can you please try with the new version?

@ko1N it works! 👍🏿