-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1039 from hacspec/fix-914
Fix 914
- Loading branch information
Showing
9 changed files
with
131 additions
and
8 deletions.
There are no files selected for viewing
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
46 changes: 46 additions & 0 deletions
46
test-harness/src/snapshots/toolchain__constructor-as-closure into-fstar.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
source: test-harness/src/harness.rs | ||
expression: snapshot | ||
info: | ||
kind: | ||
Translate: | ||
backend: fstar | ||
info: | ||
name: constructor-as-closure | ||
manifest: constructor-as-closure/Cargo.toml | ||
description: ~ | ||
spec: | ||
optional: false | ||
broken: false | ||
issue_id: ~ | ||
positive: true | ||
snapshot: | ||
stderr: false | ||
stdout: true | ||
include_flag: ~ | ||
backend_options: ~ | ||
--- | ||
exit = 0 | ||
|
||
[stdout] | ||
diagnostics = [] | ||
|
||
[stdout.files] | ||
"Constructor_as_closure.fst" = ''' | ||
module Constructor_as_closure | ||
#set-options "--fuel 0 --ifuel 1 --z3rlimit 15" | ||
open Core | ||
open FStar.Mul | ||
|
||
type t_Context = | ||
| Context_A : i32 -> t_Context | ||
| Context_B : i32 -> t_Context | ||
|
||
type t_Test = | Test : i32 -> t_Test | ||
|
||
let impl__Test__test (x: Core.Option.t_Option i32) : Core.Option.t_Option t_Test = | ||
Core.Option.impl__map #i32 #t_Test x Test | ||
|
||
let impl__Context__test (x: Core.Option.t_Option i32) : Core.Option.t_Option t_Context = | ||
Core.Option.impl__map #i32 #t_Context x Context_B | ||
''' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,5 +35,6 @@ members = [ | |
"guards", | ||
"cyclic-modules", | ||
"unsafe", | ||
"constructor-as-closure", | ||
] | ||
resolver = "2" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "constructor-as-closure" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
||
[package.metadata.hax-tests] | ||
into."fstar" = { broken = false, snapshot = "stdout", issue_id = "914" } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
struct Test(i32); | ||
impl Test { | ||
pub fn test(x: Option<i32>) -> Option<Test> { | ||
x.map(Self) | ||
} | ||
} | ||
pub enum Context { | ||
A(i32), | ||
B(i32), | ||
} | ||
impl Context { | ||
pub fn test(x: Option<i32>) -> Option<Context> { | ||
x.map(Self::B) | ||
} | ||
} |