Skip to content

Avoid unbounded O(n^2) when parsing nested type args - #117143

Merged
bors merged 2 commits into
rust-lang:masterfrom
estebank:issue-117080
Oct 26, 2023
Merged

Avoid unbounded O(n^2) when parsing nested type args#117143
bors merged 2 commits into
rust-lang:masterfrom
estebank:issue-117080

Conversation

@estebank

@estebank estebank commented Oct 24, 2023

Copy link
Copy Markdown
Contributor

When encountering code like f::<f::<f::<f::<f::<f::<f::<f::<... with unmatched closing angle brackets, add a linear check that avoids the exponential behavior of the parse recovery mechanism.

Fix #117080, fix #115414.

@rustbot

rustbot commented Oct 24, 2023

Copy link
Copy Markdown
Collaborator

r? @b-naber

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 24, 2023
@estebank

Copy link
Copy Markdown
Contributor Author

@bors try

@bors

bors commented Oct 24, 2023

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 54dffa1 with merge bbebabf...

@rust-log-analyzer

This comment has been minimized.

@matthiaskrgr

Copy link
Copy Markdown
Member

Might also fix #115414 perhaps? ^^

@estebank

Copy link
Copy Markdown
Contributor Author

@matthiaskrgr it does! 😀

@estebank estebank added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 24, 2023
Comment thread compiler/rustc_parse/src/parser/path.rs Outdated
When encountering code like `f::<f::<f::<f::<f::<f::<f::<f::<...` with
unmatched closing angle brackets, add a linear check that avoids the
exponential behavior of the parse recovery mechanism.

Fix rust-lang#117080.
@wesleywiser

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Oct 26, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 2dec1bc has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 26, 2023
@apiraino

Copy link
Copy Markdown
Contributor

Beta backport declined as per compiler team on Zulip.

This is a stable-to-stable regression for code (admittely strange) that does not compile anyway, so we are inclined to let this patch ride the trains.

@rustbot label -beta-nominated

@rustbot rustbot removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 26, 2023
@bors
bors merged commit 7eb0548 into rust-lang:master Oct 26, 2023
@rustbot rustbot added this to the 1.75.0 milestone Oct 26, 2023
@estebank
estebank deleted the issue-117080 branch November 9, 2023 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation Exhausts Memory Instead of Detecting Potential Syntax Error out of memory

9 participants