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

Avoid checking control paths that will never be reached #1266

Closed
jdm opened this issue Dec 7, 2011 · 2 comments
Closed

Avoid checking control paths that will never be reached #1266

jdm opened this issue Dec 7, 2011 · 2 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@jdm
Copy link
Contributor

jdm commented Dec 7, 2011

When a loop will never terminate (ie. is conditioned on a value that is statically guaranteed to be true and the body contains no break statements), it would be nice not to throw errors about control paths following the loop that do not return a value.

@nikomatsakis
Copy link
Contributor

Example:

while true {
   alt foo {
      case1 { ret ...; }
      case2 { ... }
   }
}

will currently complain because the function is not statically guaranteed to return (though of course it is (or else loop forever)).

@catamorphism
Copy link
Contributor

Closing this because we have loop {...} now, and that should be used in these cases. If you see any limitations in that approach, please open a new bug.

bjorn3 added a commit to bjorn3/rust that referenced this issue Aug 24, 2022
Refactorings for enabling parallel compilation (part 2)
coastalwhite pushed a commit to coastalwhite/rust that referenced this issue Aug 5, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Restore `roundf*` intrinsics

* Remove negative tests

* Add tests for `roundf*`
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

3 participants