Skip to content

Commit

Permalink
test(hax-lib/macros): handle correctly &mut Self arguments in `ensu…
Browse files Browse the repository at this point in the history
…res`
  • Loading branch information
W95Psp committed Jan 22, 2025
1 parent 6ef83cf commit e384b95
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
12 changes: 12 additions & 0 deletions test-harness/src/snapshots/toolchain__attributes into-fstar.snap
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ unfold instance impl: Core.Ops.Arith.t_Sub t_Int t_Int =

unfold let add x y = x + y
'''
"Attributes.Issue_1266_.fst" = '''
module Attributes.Issue_1266_
#set-options "--fuel 0 --ifuel 1 --z3rlimit 15"
open Core
open FStar.Mul

class t_T (v_Self: Type0) = {
f_v_pre:v_Self -> Type0;
f_v_post:x: v_Self -> x_future: v_Self -> pred: Type0{pred ==> true};
f_v:x0: v_Self -> Prims.Pure v_Self (f_v_pre x0) (fun result -> f_v_post x0 result)
}
'''
"Attributes.Nested_refinement_elim.fst" = '''
module Attributes.Nested_refinement_elim
#set-options "--fuel 0 --ifuel 1 --z3rlimit 15"
Expand Down
10 changes: 5 additions & 5 deletions tests/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions tests/attributes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,11 @@ mod requires_mut {
}
}
}

mod issue_1266 {
#[hax_lib::attributes]
trait T {
#[hax_lib::ensures(|_|true)]
fn v(x: &mut Self);
}
}

0 comments on commit e384b95

Please sign in to comment.