Skip to content

Use raw pointers to avoid aliasing violation in split_at_mut #27358

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 1 commit into from
Jul 29, 2015

Conversation

bluss
Copy link
Member

@bluss bluss commented Jul 28, 2015

Use raw pointers to avoid aliasing violation in split_at_mut

Fixes #27357

@rust-highfive
Copy link
Contributor

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@aturon
Copy link
Member

aturon commented Jul 28, 2015

@bors: r+

@bors
Copy link
Collaborator

bors commented Jul 28, 2015

📌 Commit 95596bb has been approved by aturon

@bluss bluss changed the title Use *mut [T] to avoid aliasing violation in split_at_mut Use raw pointers to avoid aliasing violation in split_at_mut Jul 28, 2015
@bluss
Copy link
Member Author

bluss commented Jul 28, 2015

I realized the commit log was wrong -- it reflected an earlier version. Updated commit log, pr text & title

@bluss
Copy link
Member Author

bluss commented Jul 28, 2015

@bors r=aturon

@bors
Copy link
Collaborator

bors commented Jul 28, 2015

📌 Commit 73d4330 has been approved by aturon

@bors
Copy link
Collaborator

bors commented Jul 29, 2015

⌛ Testing commit 73d4330 with merge d10ff63...

bors added a commit that referenced this pull request Jul 29, 2015
Use raw pointers to avoid aliasing violation in split_at_mut

Fixes #27357
@bors bors merged commit 73d4330 into rust-lang:master Jul 29, 2015
@bluss bluss deleted the split-at-mut branch July 29, 2015 11:38
bors added a commit that referenced this pull request Jan 21, 2016
Use raw pointers to avoid aliasing in str::split_at_mut

Introduce private functions from_raw_parts, from_raw_parts_mut for str
to factor out the logic.

We want to use raw pointers here instead of duplicating a &mut str, to
be on safer ground w.r.t rust aliasing rules.

This has already been fixed for slices in PR #27358, issue #27357
bors added a commit that referenced this pull request Jan 21, 2016
Use raw pointers to avoid aliasing in str::split_at_mut

Introduce private function  from_raw_parts_mut for str to factor out the logic.

We want to use raw pointers here instead of duplicating a &mut str, to
be on safer ground w.r.t rust aliasing rules.

This has already been fixed for slices in PR #27358, issue #27357
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.

4 participants