Skip to content

+1 constant is not allowed #3013

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

Closed
hamstergene opened this issue Jul 25, 2012 · 2 comments
Closed

+1 constant is not allowed #3013

hamstergene opened this issue Jul 25, 2012 · 2 comments

Comments

@hamstergene
Copy link

Would it be a problem to allow unary plus? It is completely unimportant, but sometimes nice for readability:

    f(self._adjust(loc, -1, 0));
    f(self._adjust(loc, +1, 0)); // rust 0.3: syntax error
    f(self._adjust(loc, 0, -1));
    f(self._adjust(loc, 0, +1)); // rust 0.3: syntax error
@bblum
Copy link
Contributor

bblum commented Jul 25, 2012

Not to decisively deny this feature or anything, but I would write it with extra spaces:

    f(self._adjust(loc, -1,  0));
    f(self._adjust(loc,  1,  0));
    f(self._adjust(loc,  0, -1));
    f(self._adjust(loc,  0,  1));

@catamorphism
Copy link
Contributor

We're trying not to add things, and @bblum 's suggestion seems sufficient. Sorry :-)

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
Fix wrong shape for last chain items for indent_style = "Visual"
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 6, 2023
…fJung

tree borrows: consider some retags as writes for the purpose of data races

Turns out not all retags can be freely reordered. Those that cannot should be considered writes for the data race model, to aid with optimizations.

Only the last commit is the actual change; the ones before that are some refactoring I couldn't stop myself from doing.
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
## What's Changed
* `modifies` Clauses for Function Contracts by @JustusAdam in
model-checking/kani#2800
* Fix ICEs due to mismatched arguments by @celinval in
model-checking/kani#2994. Resolves the following
issues:
  * model-checking/kani#2260
  * model-checking/kani#2312
* Enable powf*, exp*, log* intrinsics by @tautschnig in
model-checking/kani#2996
* Upgrade Rust toolchain to nightly-2024-01-24 by @celinval @feliperodri
@qinheping

**Full Changelog**:
model-checking/kani@kani-0.45.0...kani-0.46.0

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

---------

Signed-off-by: Felipe R. Monteiro <[email protected]>
Co-authored-by: Celina G. Val <[email protected]>
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

No branches or pull requests

3 participants