Skip to content

"while(i!=-1)" causes "Unsatisfied precondition constraint" #122

Closed

Description

@jyasskin
$ cat ~/tmp/test.rs
fn main() {
  let int i = -1;
  while (i != -1) {
    ret;
  }
}
$ ./rustboot -L . ~/tmp/test.rs -o ~/tmp/test
~/tmp/test.rs:3:2 - 6:0:E:Error: Unsatisfied precondition constraint <init #14 = .t0> at stmt 23:
while ({
           auto .t0;
           .t0 = -1;
    }i != .t0) {
    ret;
}
$

Interestingly, changing the literal to "1" avoids the error.

Activity

  1. graydon commented on Aug 24, 2010

    @graydon
    Contributor

    Closed by b34cb1b.

  2. added a commit that references this issue on Jul 19, 2017
  3. added a commit that references this issue on Dec 12, 2017
  4. added a commit that references this issue on Oct 23, 2018
  5. added a commit that references this issue on Nov 29, 2018
  6. added a commit that references this issue on Jun 30, 2020
  7. added a commit that references this issue on Oct 1, 2021
  8. added a commit that references this issue on Feb 1, 2022
  9. added a commit that references this issue on Aug 21, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions