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: Improve error handling for top-level let statements #15961

Merged
merged 1 commit into from Dec 1, 2023

Conversation

ohno418
Copy link
Contributor

@ohno418 ohno418 commented Nov 25, 2023

This commit addresses the issue of excessive and unrelated errors generated by top-level let statements. Now, only a single error is produced, indicating that let statements are invalid at the top level.


Fixes #14963.

While I'm not really sure if handling a particular case in a special manner is appropriate, it would be good to suppress the excessive number of annoying and unrelated errors.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 25, 2023
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

While I'm not really sure if handling a particular case in a special manner is appropriate, it would be good to suppress the excessive number of annoying and unrelated errors.

I'd say it is, new people might be tempted to use let for globals (and rustc also recovers specifically from this)

@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 30, 2023
@ohno418
Copy link
Contributor Author

ohno418 commented Dec 1, 2023

(and rustc also recovers specifically from this)

Ah, yeah, indeed.

This commit addresses the issue of excessive and unrelated errors
generated by top-level `let` statements. Now, only a single error is
produced, indicating that `let` statements are invalid at the top level.
@Veykril
Copy link
Member

Veykril commented Dec 1, 2023

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Dec 1, 2023

📌 Commit e076192 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Dec 1, 2023

⌛ Testing commit e076192 with merge 57e9024...

@bors
Copy link
Collaborator

bors commented Dec 1, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 57e9024 to master...

@bors bors merged commit 57e9024 into rust-lang:master Dec 1, 2023
10 checks passed
@ohno418 ohno418 deleted the top-level-let-stmt branch December 1, 2023 13:53
@ohno418 ohno418 restored the top-level-let-stmt branch December 1, 2023 13:54
@ohno418 ohno418 deleted the top-level-let-stmt branch December 2, 2023 04:46
@lnicola lnicola changed the title Improve error handling for top-level let statements fix: Improve error handling for top-level let statements Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cryptic errors for top-level let statements.
4 participants