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: Avoid rust-analyzer recursion bug #734

Merged
merged 2 commits into from
Aug 27, 2020
Merged

fix: Avoid rust-analyzer recursion bug #734

merged 2 commits into from
Aug 27, 2020

Conversation

jan-auer
Copy link
Member

@jan-auer jan-auer commented Aug 27, 2020

The attribute alone triggers a parsing error which leads to an endless loop or recursion in Rust Analyzer.

#skip-changelog

@jan-auer jan-auer requested a review from a team August 27, 2020 09:08
@jan-auer jan-auer self-assigned this Aug 27, 2020
@jan-auer jan-auer requested a review from Swatinem August 27, 2020 09:09
@@ -16,8 +16,10 @@ use crate::protocol::{AsPair, IpAddr, NativeImagePath, PairList, User};
use crate::types::{Meta, ProcessingAction, ProcessingResult, Remark, RemarkType};

lazy_static! {
static ref NULL_SPLIT_RE: Regex = #[allow(clippy::trivial_regex)]
Regex::new("\x00").unwrap();
static ref NULL_SPLIT_RE: Regex = {
Copy link
Member

@untitaker untitaker Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a code comment here if we're going to merge this. it's not obvious why formatting matters here and it's easy to regress when updating rustfmt

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is even invalid syntax in Rust. Without lazy_static, this would not compile as statement and expression attributes aren't stable.

@jan-auer jan-auer merged commit 82ca0dc into master Aug 27, 2020
@jan-auer jan-auer deleted the fix/rust-analyzer branch August 27, 2020 09:43
jan-auer added a commit that referenced this pull request Aug 27, 2020
* master:
  fix: Avoid rust-analyzer recursion bug (#734)
  ref(server): Re-authenticate at regular intervals (#731)
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 this pull request may close these issues.

None yet

2 participants