Skip to content

Return a slice when querying contents of a typed array#705

Open
simonwuelker wants to merge 1 commit intoservo:mainfrom
simonwuelker:typedarray-slice
Open

Return a slice when querying contents of a typed array#705
simonwuelker wants to merge 1 commit intoservo:mainfrom
simonwuelker:typedarray-slice

Conversation

@simonwuelker
Copy link
Contributor

@simonwuelker simonwuelker commented Feb 15, 2026

In rust there is no need to pass (*mut T, usize) around, as that is just a *mut [T]. This makes out-of-bounds access to typed arrays harder to do by accident.

Testing: Behaviour should be unchanged, no new tests are written

This makes out-of-bounds access to typed arrays harder to do by
accident.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Copy link
Member

@sagudev sagudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but such change should get companion PR in servo before landing (so we do not land something that borks servo).

CI is blocked by jidicula/clang-format-action#267

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

Successfully merging this pull request may close these issues.

2 participants