Skip to content

Compiler warning for "condition is always true" #342

Closed
@pcwalton

Description

@pcwalton
Contributor

while (i >= 0u) cost a morning. We should add a warning for this.

Activity

brson

brson commented on Mar 5, 2012

@brson
Contributor

We have some functions for evaluating const expressions, I believe in ast_util that could be used for this.

catamorphism

catamorphism commented on Mar 15, 2012

@catamorphism
Contributor

Also see #1417

veddan

veddan commented on Oct 24, 2012

@veddan
Contributor

Some simple cases can be handled by #3833.

graydon

graydon commented on Nov 21, 2012

@graydon
Contributor

Type limits catches this case. If others show up we're not catching, we can look at them as they arise. Closing.

added a commit that references this issue on Sep 19, 2017

Merge pull request rust-lang#342 from RalfJung/mir-validate

added a commit that references this issue on Dec 12, 2017
added a commit that references this issue on May 10, 2023

Merge pull request rust-lang#342 from rust-lang/load-store

195d4ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @graydon@brson@pcwalton@veddan@catamorphism

        Issue actions

          Compiler warning for "condition is always true" · Issue #342 · rust-lang/rust