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

rust-analyzer hangs with too many #[test_case]s #18274

Open
darichey opened this issue Oct 10, 2024 · 5 comments · May be fixed by #18275
Open

rust-analyzer hangs with too many #[test_case]s #18274

darichey opened this issue Oct 10, 2024 · 5 comments · May be fixed by #18275
Labels
C-bug Category: bug I-hang Issue: The analysis never terminates, due to infinite loops, deadlock, livelock, etc.

Comments

@darichey
Copy link
Contributor

rust-analyzer version: master

code snippet to reproduce:

#[test_case]
#[test_case]
#[test_case]
#[test_case]
#[test_case]
#[test_case]
#[test_case]
#[test_case]
fn test() {}

rust-analyzer will hang while trying to analyze this file. I think it's exponential, so if it doesn't for you, just add more #[test_case] :)

@darichey darichey added the C-bug Category: bug label Oct 10, 2024
@alibektas
Copy link
Member

I am way over the recursion_limit as we speak, but I get no such behavior. 😄 Could you maybe share a recording where you restart the server and show how it hangs?

@alibektas
Copy link
Member

and your rust-analyzer config would also be nice to see.

@darichey
Copy link
Contributor Author

Sure! https://github.com/user-attachments/assets/be5d6316-2df1-482c-9aa8-129ea49222c0
As you can see, completion and inlay hints do not get responses.

I bisected to #18085

@darichey darichey linked a pull request Oct 10, 2024 that will close this issue
@ChayimFriedman2
Copy link
Contributor

Weird. That PR does not do anything exponential. Do you experience the same issue with #[test]?

@darichey
Copy link
Contributor Author

Do you experience the same issue with #[test]?

Not by default, but if I remove the expander.is_test() condition so we always expand #[test] in the same place I added the check for #[test_case] in #18275, then I do experience the same behavior.

@ShoyuVanilla ShoyuVanilla added the I-hang Issue: The analysis never terminates, due to infinite loops, deadlock, livelock, etc. label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug I-hang Issue: The analysis never terminates, due to infinite loops, deadlock, livelock, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants