Skip to content

Invalid slice reference syntax causes Rust language server to crash 🦀 #15437

Closed
@pcgeek86

Description

@pcgeek86

Summary

When specifying an invalid syntax for Rust slices, the Rust Analyze Language Server repeatedly crashes.

Specifically, this bit of code seems to consistently cause crashes:

println!("{:?}", &myages[0 2]);

Notice how the &myages[0 2] uses incorrect syntax to create a slice from an array.

image

Expected Result

Rust Analyzer catches the syntax error and reports it accordingly.

Actual Result

Rust Language Server repeatedly crashes.

[Info  - 2:43:24 AM] Connection to server got closed. Server will restart.
true
[Info  - 2:43:30 AM] Connection to server got closed. Server will restart.
true
[Info  - 2:43:36 AM] Connection to server got closed. Server will restart.
true
[Info  - 2:43:42 AM] Connection to server got closed. Server will restart.
true
[Error - 2:43:48 AM] The Rust Analyzer Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Details

rust-analyzer version: rust-analyzer version: 0.3.1615-standalone

rustc version: rustc 1.71.1 (eb26296b5 2023-08-03)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

VSCode 1.81.0
Windows 11 Client
Remote SSH Extension
Remote SSH Host: Ubuntu Linux Server 22.04 LTS

Metadata

Metadata

Assignees

Labels

C-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions