dtolnay / no-panic

Attribute macro to require that the compiler prove a function can't ever panic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strange borrow checker error

RazrFalcon opened this issue · comments

This code produces such error:

error[E0382]: use of moved value: `*self`
   --> src/stream.rs:331:26
    |
326 |     #[no_panic]
    |     ----------- value moved here
...
331 |                     vec![self.curr_byte_unchecked(), c],
    |                          ^^^^ value used here after move
    |
    = note: move occurs because `self` has type `&mut stream::Stream<'a>`, which does not implement the `Copy` trait

You can test it in this branch.

Probably the same issue as in the #1

Thanks! I released no-panic 0.1.8 with a fix. This was a bug related to self being used inside of a macro invocation like vec!.