-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rollup of 8 pull requests #140360
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
Rollup of 8 pull requests #140360
Conversation
It wants an owned path, so pass an owned path
They are no longer necessary after rust-lang#139281
Inline some functions used once. Use `impl Trait` more. Tweak some comments.
Stabilise `std::ffi::c_str` This finished FCP in rust-lang#112134 but never actually got a stabilisation PR. Since the FCP in rust-lang#120048 recently passed to add the `os_str` module, it would be nice to also merge this too, to ensure that both get added in the next version. Note: The added stability attributes which *somehow* were able to be omitted before (rustc bug?) were added based on the fact that they were added in 3025513, which ended up in 1.85.0. Closes: rust-lang#112134 r? libs-api
Update safety documentation for `CString::from_ptr` and `str::from_boxed_utf8_unchecked` ## PR Description This PR addresses missing safety documentation for two APIs: **1. alloc::ffi::CStr::from_raw** - `Alias`: The pointer must not be aliased (accessed via other pointers) during the reconstructed CString's lifetime. - `Owning`: Calling this function twice on the same pointer and creating two objects with overlapping lifetimes, introduces two alive owners of the same memory. This may result in a double-free. - `Dangling`: The prior documentation required the pointer to originate from CString::into_raw, but this constraint is incomplete. A validly sourced pointer can also cause undefined behavior (UB) if it becomes dangling. A simple Poc for this situation: ``` use std::ffi::CString; use std::os::raw::c_char; fn create_dangling() -> *mut c_char { let local_ptr: *mut c_char = { let valid_data = CString::new("valid").unwrap(); valid_data.into_raw() }; unsafe { let _x = CString::from_raw(local_ptr); } local_ptr } fn main() { let dangling = create_dangling(); unsafe {let _y = CString::from_raw(dangling);} // Cause UB! } ``` **2. alloc::str::from_boxed_utf8_unchecked** - `ValidStr`: Bytes must contain a valid UTF-8 sequence.
…ss35 Use char::is_whitespace directly in str::trim* Use the method directly instead of wrapping it in a closure.
…, r=tgross35 fix docs for `Peekable::next_if{_eq}` These seem like copy-paste errors (except `saves the value of` 👉 `retains` which just sounds better to me)
Update example to use CStr::to_string_lossy
Clarified bootstrap optimization "true" argument fixes rust-lang#140328
session: Cleanup `CanonicalizedPath::new` It wants an owned path, so pass an owned path.
…errors rustc_span: Some hygiene cleanups Mostly enabled by rust-lang#139241 and rust-lang#139281.
@bors r+ rollup=never p=5 |
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 8947e16 (parent) -> 267cae5 (this PR) Test differencesShow 33174 test diffsStage 1
Stage 2
(and 16450 additional test diffs) Additionally, 16624 doctest diffs were found. These are ignored, as they are noisy. Job group index Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 267cae5bdbd602dd13f3851b9c96ce93697e59a0 --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
📌 Perf builds for each rolled up PR:
previous master: 8947e167e5 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (267cae5): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 1.2%, secondary 2.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 0.6%, secondary 3.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 763.457s -> 762.088s (-0.18%) |
Successful merges:
std::ffi::c_str
#137439 (Stabilisestd::ffi::c_str
)CString::from_ptr
andstr::from_boxed_utf8_unchecked
#137714 (Update safety documentation forCString::from_ptr
andstr::from_boxed_utf8_unchecked
)Peekable::next_if{_eq}
#139090 (fix docs forPeekable::next_if{_eq}
)CanonicalizedPath::new
#140339 (session: CleanupCanonicalizedPath::new
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup