Skip to content
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

Unboxed closure upvars are sometimes not marked as used mutably #18336

Closed
bkoropoff opened this issue Oct 26, 2014 · 0 comments · Fixed by #18337
Closed

Unboxed closure upvars are sometimes not marked as used mutably #18336

bkoropoff opened this issue Oct 26, 2014 · 0 comments · Fixed by #18337

Comments

@bkoropoff
Copy link
Contributor

This causes spurious warnings that a variable did not need to be declared mutable. Example:

#![feature(unboxed_closures)]

fn main() {
    let mut x = 0u;
    move |&mut:| x = 1;
}

Note that this current ICEs due to #18238, but becomes a problem once that is fixed.

bkoropoff added a commit to bkoropoff/rust that referenced this issue Oct 26, 2014
bkoropoff added a commit to bkoropoff/rust that referenced this issue Oct 26, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Oct 22, 2024
Fix: Increase TOKEN_LIMIT in hir-expand

Due to the `TOKEN_LIMIT`, rust-analyzer failed to expand macro for `web-sys::WebGl2RenderingContext` https://github.com/rustwasm/wasm-bindgen/blob/main/crates/web-sys/src/features/gen_WebGl2RenderingContext.rs

<img width="780" alt="image" src="https://github.com/user-attachments/assets/3a39f18e-656e-43df-9994-0a0179fa42ac">
<img width="403" alt="image" src="https://github.com/user-attachments/assets/7ae8dcf9-a40a-4070-8623-dd3a953bbf45">

After increasing the `TOKEN_LIMIT`, the `web-sys::WebGl2RenderingContext` can be expanded successfully:
<img width="459" alt="image" src="https://github.com/user-attachments/assets/76a71763-05a5-4f14-a5c9-61fc190c668f">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant