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

Relational binops on unit type are nonsensical #576

Closed
brson opened this issue Jun 25, 2011 · 5 comments
Closed

Relational binops on unit type are nonsensical #576

brson opened this issue Jun 25, 2011 · 5 comments

Comments

@brson
Copy link
Contributor

brson commented Jun 25, 2011

The following is currently what holds for relational binops on ()

  assert (() < ());
  assert (() <= ());
  assert (!(() > ()));
  assert (!(() >= ()));

Now, because we have relational binops over structural types, we have to either have relational binops over all types, or make structural comparisons much more complicated. But the implementation for unit is arbitrary. Suggest the following

  assert (!(() < ()));
  assert (() <= ());
  assert (!(() > ()));
  assert (() >= ());
@msullivan
Copy link
Contributor

It looks like it just considers every relational operation over unit to be true.

@brson
Copy link
Contributor Author

brson commented Jul 11, 2011

() > () and () >= () are false

@msullivan
Copy link
Contributor

Oh. Oops. The cmp glue considers everything to be true, and there is cmp glue for ==, <, <=.

@brson
Copy link
Contributor Author

brson commented Jul 11, 2011

So maybe the compare glue should consider < to be false.

@msullivan
Copy link
Contributor

Closed by #663.

keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
Solaris: Add ports support, correct some types, add some errnos

This should benefit Illumos too...
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
 - Support to --lib-c is not well tested. Keep it as experiemental.
 - Change how CBMC behaves when a function that is not defined is
   reachable. This mitigates issues rust-lang#576. We should still add an
   unimplemented assertion so we can flip the results of other checks to
   undetermined.
antoyo pushed a commit to antoyo/rust that referenced this issue Jan 13, 2025
stabilize `lang_tests_common` config parsing logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants