This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit afa78a7
authored
Unrolled build for rust-lang#130046
Rollup merge of rust-lang#130046 - RalfJung:const_str_as_mut, r=dtolnay
str: make as_mut_ptr and as_bytes_mut unstably const
`@rust-lang/libs-api` the corresponding non-mutable methods are already const fn, so this seems pretty trivial. I hope this is small enough that it does not need an ACP? :)
I would like to get these stabilized ASAP because I want to avoid people doing `s.as_ptr().cast_mut()`, which is UB if they ever write to it, but is already const-stable.
TODO: create a tracking issue.1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
341 | 342 | | |
342 | 343 | | |
343 | | - | |
| 344 | + | |
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| |||
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
| 387 | + | |
386 | 388 | | |
387 | 389 | | |
388 | 390 | | |
389 | | - | |
| 391 | + | |
390 | 392 | | |
391 | 393 | | |
392 | 394 | | |
| |||
0 commit comments