Skip to content

slicing with comptime start and end indexes results in pointer-to-array #4752

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

Merged
merged 20 commits into from
Mar 19, 2020

Conversation

andrewrk
Copy link
Member

@andrewrk andrewrk commented Mar 17, 2020

This implements #863. Big checklist before this can be merged.

Unify slices and single-item-pointer-to-array

Add Behavioral Tests

  • @ptrCast slice to pointer
  • slice array
  • slice array, array is 0 bits
  • slice array, sentinel
  • slice array, array is 0 len, sentinel
  • slice pointer
  • slice pointer, pointer is 0 bits
  • slice pointer, sentinel
  • slice slice
  • comptime slice array
  • comptime slice array, elem is 0 bits
  • comptime slice array, elem is 0 bits, sentinel
  • comptime slice pointer
  • comptime slice pointer, elem is 0 bits
  • comptime slice pointer, elem is 0 bits, sentinel
  • comptime slice slice
  • comptime slice slice, elem is 0 bits
  • comptime slice slice, elem is 0 bits, sentinel
  • slice array, preserve alignment
  • slice pointer, preserve alignment
  • slice slice, preserve alignment
  • slice with comptime start and end and a sentinel

Follow-up Items

  • grep for "863" and do all the fixups that are now possible
  • var hack: usize = 0; // TODO remove this hack
  • fix regressed compile error test "reading past end of pointer casted array"

@andrewrk andrewrk added the breaking Implementing this issue could cause existing code to no longer compile or have different behavior. label Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant