Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutable slices with ranges #14

Open
franziskuskiefer opened this issue May 27, 2024 · 3 comments
Open

Mutable slices with ranges #14

franziskuskiefer opened this issue May 27, 2024 · 3 comments

Comments

@franziskuskiefer
Copy link
Collaborator

Eurydice fails when trying to extract something like fun(&mut buf[0..8]).

See for example this change cryspen/libcrux@a84d517#diff-cac793f2bb8c1229c9c3bbd71a681b9daf1cecd9646ed3e2a5ab208f47c9fc48R38

@msprotz
Copy link
Contributor

msprotz commented May 28, 2024

Looking at the commit the issue appears to be with [..] specifically, correct?

@franziskuskiefer
Copy link
Collaborator Author

Full range is definitely an issue. But I think I the others, like [0..8] failed as well. But only when mutable. We should do small reproducers for these.

@msprotz
Copy link
Contributor

msprotz commented Dec 4, 2024

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

fn main() {
    let x = [0; 1u8];
    f(&mut x[..]);
}

this is a minimal repro (bumped into this again) -- the way to fix it is probably to recognize this as a distinguished pattern and emit a call to array_to_subslice, by written a pattern against the name matching facility of Charon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants