-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
ICE with new borrowck and macros #6304
Comments
As I'm bringing one of my projects up to date, I'm getting this error a lot. Pretty much anything which uses macros and somehow uses some mutability inside causes this ICE. |
I'll take a look. |
Backtrace
|
Obviously I failed to take a look. |
I ran into this as well and didn't find this issue until I'd already come up with code to reproduce it. In case its helpful, here is the code I ended up with: fn test(x: &[u8]) {
}
macro_rules! impl_buffer( ($name:ident, $size:expr) => (
impl $name {
fn run(&mut self, in: &[u8]) {
let mut i = 0;
while in.len() - i >= $size {
test(in.slice(i, i + $size));
i += $size;
}
}
}
))
pub struct Buffer;
impl_buffer!(Buffer, 64) At least in my case, there is an easy workaround. The following works fine: fn test(x: &[u8]) {
}
macro_rules! impl_buffer( ($name:ident, $size:expr) => (
impl $name {
fn run(&mut self, in: &[u8]) {
let size = $size;
let mut i = 0;
while in.len() - i >= size {
test(in.slice(i, i + size));
i += $size;
}
}
}
))
pub struct Buffer;
impl_buffer!(Buffer, 64) |
…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
FROM_ITER_INSTEAD_OF_COLLECT: avoid unwrapping unconditionally Fixes rust-lang#6302 changelog: fix unwrap of None when checking libcore with clippy
This code (attempted to whittle down as much as possible) yields an ICE:
The text was updated successfully, but these errors were encountered: