-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Float parsing regression (repeated panic, basically a crash) #12211
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
Comments
Hmm, I only get "expected identifier or integer" with the code you posted, which does seem like a bug, but it didn't crash. When I remove the space after |
Here is what I see in vscode. Maybe my {
"rust-analyzer.inlayHints.chainingHints": false,
"rust-analyzer.inlayHints.closureReturnTypeHints": true,
"rust-analyzer.inlayHints.maxLength": 10,
"rust-analyzer.inlayHints.parameterHints": false,
"rust-analyzer.inlayHints.reborrowHints": true,
"rust-analyzer.inlayHints.typeHints": false,
"rust-analyzer.assist.importGranularity": "module",
"rust-analyzer.assist.importGroup": true,
"rust-analyzer.cargo.allFeatures": true,
"rust-analyzer.cargo.runBuildScripts": true,
"rust-analyzer.completion.addCallParenthesis": false,
"rust-analyzer.completion.postfix.enable": false,
"rust-analyzer.diagnostics.enable": true,
"rust-analyzer.experimental.procAttrMacros": true,
"rust-analyzer.highlightRelated.breakPoints": true,
"rust-analyzer.highlightRelated.exitPoints": true,
"rust-analyzer.highlightRelated.references": true,
"rust-analyzer.highlightRelated.yieldPoints": true,
"rust-analyzer.lruCapacity": 200000,
"rust-analyzer.procMacro.enable": true,
"rust-analyzer.trace.extension": true,
"rust-analyzer.trace.server": "off",
"rust-analyzer.server.extraEnv": {
"CARGO_TARGET_DIR": "/home/veetaha/junk/ra-target-dir-cache"
},
"rust-analyzer.procMacro.ignored": {
"async-recursion": ["async_recursion"],
"async-trait": ["async_trait"],
"tokio-macros": ["test"],
"tracing-attributes": ["instrument"],
"trix-test-macros": ["test"],
// This is not exactly right, because this macro changes the signature
// of the function from async to non-async, but it is mostly used in
// `Drop::drop()` methods
"tokiox-macros": ["block_in_place"],
"serial_test": ["serial"],
"cucumber_rust_codegen": ["given", "when", "then"],
},
} I've also pushed the exact code used to a reproduction repo. |
Yup, with that I can reproduce, thanks! |
rust-analyzer version: 5d5bbec 2022-05-09 stable
rustc version: 1.60.0 (7737e0b5c 2022-04-04)
When vscode automatically upgraded me to
2022-05-09
stable I started seeing RA crashing constantly with this in the logs:Verbose backtrace
Debugging the cause
I tried to debug the cause by manually modifying RA's code and compiling it.
I changed this line
rust-analyzer/crates/mbe/src/to_parser_input.rs
Lines 59 to 66 in 4d94cf3
this way:
It allowed me to identify where in the whole world of a project I get the crash. It definitely helped, and I was able to minimize it to the following reproduction steps.
Reproduction
It requires two files. The first file with the following code
included.rs
:and the second one
lib.rs
You also obviously need to add
async-trait = "0.1"
to the dependencies.I think the regression was introduced in #12149. Previous versions of RA (i.e.
2022-05-02
and older) should work fine.For that reason, @jonas-schievink please take a look at this issue. I think you can tell where the root problem is.
Workaround
As a temporary workaround I added parentheses around
self.0
in generated code that weinclude!()
in our projectThe text was updated successfully, but these errors were encountered: