Skip to content

Commit

Permalink
Merge pull request #475 from FStarLang/afromher_rust
Browse files Browse the repository at this point in the history
Prevent move-out on pointer holding structs
  • Loading branch information
msprotz authored Aug 30, 2024
2 parents fa19d37 + cd568f8 commit c96fb69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/AstToMiniRust.ml
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ and translate_expr_with_type (env: env) (e: Ast.expr) (t_ret: MiniRust.typ): env
let t = translate_type env b.typ in
let is_owned_struct =
match b.typ with
| TQualified lid when Idents.LidSet.mem lid env.heap_structs -> true
| TQualified lid when Idents.LidSet.mem lid env.heap_structs || Idents.LidSet.mem lid env.pointer_holding_structs -> true
| _ -> false
in
(* TODO how does this play out with the new "translate as non-mut by
Expand Down
2 changes: 1 addition & 1 deletion lib/OptimizeMiniRust.ml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ let rec infer (env: env) (expected: typ) (known: known) (e: expr): known * expr
known, e

| Deref _ ->
failwith "TODO: Deref"
known, e

(* We store here a list of builtins, with the types of their arguments.
Type substitutions are currently not supported, functions with generic
Expand Down

0 comments on commit c96fb69

Please sign in to comment.