Skip to content

Feat rust operators#5380

Merged
MikaelMayer merged 4 commits into
masterfrom
feat-rust-operators
Apr 29, 2024
Merged

Feat rust operators#5380
MikaelMayer merged 4 commits into
masterfrom
feat-rust-operators

Conversation

@MikaelMayer

@MikaelMayer MikaelMayer commented Apr 29, 2024

Copy link
Copy Markdown
Member

This PR is a replay of #5081 after fixing the issue with the paths too long for Windows, so it should no longer break the CI.

Description

This PR implements most immutable types in Dafny (Sequence, Set, Multiset, Map) and implements most if not all operators on them. It also sets an architecture that can now be relied on.
List of features in this PR:

  • More comprehensive Rust AST, precedence and associativity to render parentheses
  • The Rust compiler no longer crash when not in /runAllTests, but emits invalid code. It makes it possible to see which features are missing by searching for <i> in the generated code.
  • Made verification of GenExpr less brittle
  • Previous PR review comments
  • Ability to use shadowed identifiers to avoid numbers in names. Rust has the same rules as Dafny for shadowing, and I will continue to monitor cases where semantics might differ.

How has this been tested?

I added an integration test for compiling Dafny to Rust, and I added unit tests for the runtime in Rust
All tests for each compiler now have a .rs.check if they fail..

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

MikaelMayer and others added 2 commits April 29, 2024 09:22
### Description
This PR implements most immutable types in Dafny (Sequence, Set,
Multiset, Map) and implements most if not all operators on them. It also
sets an architecture that can now be relied on.
List of features in this PR:
- More comprehensive Rust AST, precedence and associativity to render
parentheses
- The Rust compiler no longer crash when not in /runAllTests, but emits
invalid code. It makes it possible to see which features are missing by
searching for `<i>` in the generated code.
- Made verification of GenExpr less brittle
- Previous PR review comments
- Ability to use shadowed identifiers to avoid numbers in names. Rust
has the same rules as Dafny for shadowing, and I will continue to
monitor cases where semantics might differ.

### How has this been tested?
I added an integration test for compiling Dafny to Rust, and I added
unit tests for the runtime in Rust
*All tests for each compiler now have a `.rs.check` if they fail.*.

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>

---------

Co-authored-by: Robin Salkeld <salkeldr@amazon.com>
@MikaelMayer MikaelMayer added the run-deep-tests Tells CI to run all tests label Apr 29, 2024
Comment thread Source/TestDafny/MultiBackendTest.cs
@MikaelMayer MikaelMayer enabled auto-merge (squash) April 29, 2024 20:58
@MikaelMayer MikaelMayer merged commit 0b629ea into master Apr 29, 2024
@MikaelMayer MikaelMayer deleted the feat-rust-operators branch April 29, 2024 21:53
robin-aws added a commit to robin-aws/dafny that referenced this pull request Apr 30, 2024
robin-aws added a commit that referenced this pull request May 1, 2024
This reverts commit 0b629ea to fix
failing nightly:
https://github.com/dafny-lang/dafny/actions/runs/8896634004/job/24436389955

Unfortunately I approved #5380
before all of the deep tests had run, and because the extra checks
aren't normally run for a PR unless it has the `run-deep-tests` label,
they can't be required checks, so the PR was auto-merged even though
several Windows runs timed out after 2 hours.
@MikaelMayer MikaelMayer mentioned this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-deep-tests Tells CI to run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants