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

Wrong Error Message Emitted #6395

Open
IGI-111 opened this issue Aug 7, 2024 · 0 comments · May be fixed by #6758
Open

Wrong Error Message Emitted #6395

IGI-111 opened this issue Aug 7, 2024 · 0 comments · May be fixed by #6758
Assignees
Labels
audit-report Related to the audit report bug Something isn't working

Comments

@IGI-111
Copy link
Contributor

IGI-111 commented Aug 7, 2024

CS-FSSA-029
The following snippet emits a wrong/confusing error message, because a for loop only gets
type-checked in its desugared form, as a while loop:

fn main() {
 let mut v : Vec<u8> = Vec::new();
 v.push(1);
 v.push(2);
 v.push(3);
 for elem in v.iter() {
 log(elem);
 3
 };
}

The error message is the following:

A while loop's loop body cannot implicitly return a value.
Try assigning it to a mutable variable declared outside of the loop instead.
@IGI-111 IGI-111 added bug Something isn't working audit-report Related to the audit report and removed bug Something isn't working labels Aug 7, 2024
@esdrubal esdrubal linked a pull request Nov 25, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit-report Related to the audit report bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants