-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Ability to emit sync-compatible Rust code. (#6040)
Fixes #5969 ### What was changed? - I added a new Rust-specific option `--rust-sync`, set to `false` by default. When turned on, all the generated code uses `std::sync::Arc` instead of `std::rc::Rc`. Nothing else is normally needed for generated code. - The option `--include-runtime=true` now emits the runtime when translating to Rust. - I added a new feature for the dafny runtime which is `feature = "sync"`, enabling or disabling some functions via `#[cfg(feature = "sync")]` and `#[cfg(not(feature = "sync"))]`. Regular tests don't use this feature. - I ran `cargo fmt` on the runtime. ### How has this been tested? - A test `comp/rust/arc/tokiouser.dfy` uses this option and the runtime with the sync feature, compiled with `--rust-sync` <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: Andrew Jewell <[email protected]>
- Loading branch information
1 parent
76a7caa
commit 18c538a
Showing
21 changed files
with
1,506 additions
and
1,052 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
Source/DafnyCore.Test/GeneratedFromDafny/FactorPathsOptimizationTest.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.