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

Fix: Increase TOKEN_LIMIT in hir-expand #18336

Merged
merged 1 commit into from
Oct 19, 2024
Merged

Conversation

xuwaters
Copy link
Contributor

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

image image

After increasing the TOKEN_LIMIT, the web-sys::WebGl2RenderingContext can be expanded successfully:
image

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 19, 2024
@lnicola
Copy link
Member

lnicola commented Oct 19, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Oct 19, 2024

📌 Commit cfa5df1 has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 19, 2024

⌛ Testing commit cfa5df1 with merge 687b72c...

@bors
Copy link
Contributor

bors commented Oct 19, 2024

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing 687b72c to master...

@bors bors merged commit 687b72c into rust-lang:master Oct 19, 2024
11 checks passed
@ChayimFriedman2
Copy link
Contributor

I think a better approach from the current token limit is to limit tokens relative to the input size.

@Veykril
Copy link
Member

Veykril commented Oct 20, 2024

That doesn't seem to make too much sense to me, input size and output size are not necessarily related, we should at some point have a way for macros to overwrite the limit imo though. The limit exists mainly to prevent accidental problems by macros so constantly bumping isn't really allowing it to do its job.

@ChayimFriedman2
Copy link
Contributor

IMO most macro output code proportionally to their input size. So it does make sense. The problem is that then many invocations with an ever increasing input (e.g. tt munchers) won't be flagged. That can be fine if they will reach the recursion limit, or we can make it depend on the size of the original input somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants