-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Macro using expr non-terminal can cause incorrect borrowck error #8754
Comments
Same error happens if I use a
|
There's a few other open issues about this iirc, I can't find them while on my phone though. I think a work-around is assigning the |
@huonw That won't work for me, though. The real macro that hit this needs
|
Looks like this might be the same as #7971, although that macro has both repetitions of the expression in the same block of code (and, in fact, on the same line). |
…node has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two representative tests. Fixes rust-lang#7971 Fixes rust-lang#6304 Fixes rust-lang#8367 Fixes rust-lang#8754 Fixes rust-lang#8852
New lint `no_effect_replace` Closes rust-lang#1595 Signed-off-by: Federico Guerinoni <guerinoni.federico@gmail.com> changelog: Add [`no_effect_replace`] lint.
A macro that uses an
expr
non-terminal that's used in both arms of anif
statement, where the expression given to the macro expression involves borrowing*self
as mutable, triggers an incorrect borrowck warning where it claims*self
is being borrowed as mutable twice.Code:
Errors:
The text was updated successfully, but these errors were encountered: