Skip to content

[Lean] Passing arrays as slices #1983

@abentkamp

Description

@abentkamp

We produce ill-typed Lean terms when passing arrays into (mut) slice arguments:

fn f(out: &mut [u8]) {
}

fn g(out: &mut [u8; 200]) {
    f(out);
}

Open this code snippet in the playground

@[spec]
def f (out : (RustSlice u8)) : RustM (RustSlice u8) := do (pure out)

@[spec]
def g (out : (RustArray u8 200)) : RustM (RustArray u8 200) := do
  let out : (RustArray u8 200) ← (f out);
  (pure out)

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendIssue in one of the backends (i.e. F*, Coq, EC...)leanRelated to the Lean backend or library

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions