Skip to content

Fix UB in as_ptr_cast_mut documentation #10629

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
Apr 12, 2023

Conversation

Alexendoo
Copy link
Member

changelog: none

Fixes #10628

There's no String::as_mut_ptr surprisingly, so the example is actually calling str::as_mut_ptr on an empty str

@rustbot
Copy link
Collaborator

rustbot commented Apr 11, 2023

r? @Jarcho

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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 11, 2023
@Jarcho
Copy link
Contributor

Jarcho commented Apr 11, 2023

While there isn't an issue with using Vec, this really should be considered a bug in std.

@bors r+

@Jarcho
Copy link
Contributor

Jarcho commented Apr 12, 2023

Uhmm... one more time. @bors r+

@bors
Copy link
Contributor

bors commented Apr 12, 2023

📌 Commit 8f979af has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Apr 12, 2023

⌛ Testing commit 8f979af with merge d9c2957...

@bors
Copy link
Contributor

bors commented Apr 12, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing d9c2957 to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Apr 12, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing d9c2957 to master...

@bors bors merged commit d9c2957 into rust-lang:master Apr 12, 2023
@Alexendoo Alexendoo deleted the as-ptr-cast-mut-docs-ub branch April 12, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Use instead" example for as_ptr_cast_mut has undefined behavior
4 participants