Repository navigation
Clean revert of recent String::retain changes - #166011
Conversation
|
|
This comment has been minimized.
This comment has been minimized.
10169fa to
a633ce8
Compare
|
addressed rustbot's comment about the commit messages. |
This comment has been minimized.
This comment has been minimized.
| unsafe { self.s.vec.set_len(self.write) } | ||
| let new_len = self.idx - self.del_bytes; | ||
| debug_assert!(new_len <= self.s.len()); | ||
| unsafe { self.s.vec.set_len(new_len) }; |
There was a problem hiding this comment.
This needs a safety comment. I forgot to mention that I introduced that in my reversion since it didn't have one before and tidy complained about it.
There was a problem hiding this comment.
For the purpose of the revert, I would also accept // ignore-tidy-undocumented-unsafe. Not worth spending much time writing an actually good safety comment if this line will soon be replaced again.
There was a problem hiding this comment.
I bothered to reapply the same safety comment verbatim with proper attribution and everything.
|
The reverts themselves LGTM. It's a bit annoying that rustbot won't let us follow our usual guidance about commit messages in reverts. I guess you could write the PR references as "PR NNNN" or as r=me after fixing tidy |
|
Ah, undoc unsafe. |
a633ce8 to
191e1c3
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
...ah, that won't allow working around it. |
Co-authored-by: Jubilee Young <workingjubilee@gmail.com>
191e1c3 to
08e44b1
Compare
|
Briefly tried to squirm around rustbot's demands before giving up and going back on the revert commits. New commit is just the same SAFETY doc as was previously introduced in the reverted commits. |
|
@bors r+ rollup |
|
Briefly hesitated about rollup because this revert is aimed at fixing a perf regression, but it wasn't a rustc-perf regression, so should be fine. But maybe @bors rollup=maybe is more sensible. |
|
nowadays we're more eager about rolling up perf changes anyways. |
|
I will remain perfectly neutral about that and leave it to the judgement of the people creating rollups :) |
|
@bors r=hanna-kruppe rollup=iffy note="perf-sensitive, but not rustc-perf sensitive" (mostly just because I know otherwise it might not show up on the queue correctly) |
…-retain, r=hanna-kruppe Clean revert of recent `String::retain` changes Cleanly revert `String::retain` changes introduced in rust-lang#150067 by also rolling back rust-lang#163624's safety hygiene changes in order to address a performance regression in this function that was reported to us in rust-lang#165988. While we desire the safety-improving code, that code does not affect the risk of "actual" undefined behavior in the library code. It merely reduces the amount of implementation details we internally rely on and thus whether that code is resilient to changes around it. r? @hanna-kruppe
…-retain, r=hanna-kruppe Clean revert of recent `String::retain` changes Cleanly revert `String::retain` changes introduced in rust-lang#150067 by also rolling back rust-lang#163624's safety hygiene changes in order to address a performance regression in this function that was reported to us in rust-lang#165988. While we desire the safety-improving code, that code does not affect the risk of "actual" undefined behavior in the library code. It merely reduces the amount of implementation details we internally rely on and thus whether that code is resilient to changes around it. r? @hanna-kruppe
…-retain, r=hanna-kruppe Clean revert of recent `String::retain` changes Cleanly revert `String::retain` changes introduced in rust-lang#150067 by also rolling back rust-lang#163624's safety hygiene changes in order to address a performance regression in this function that was reported to us in rust-lang#165988. While we desire the safety-improving code, that code does not affect the risk of "actual" undefined behavior in the library code. It merely reduces the amount of implementation details we internally rely on and thus whether that code is resilient to changes around it. r? @hanna-kruppe
…-retain, r=hanna-kruppe Clean revert of recent `String::retain` changes Cleanly revert `String::retain` changes introduced in rust-lang#150067 by also rolling back rust-lang#163624's safety hygiene changes in order to address a performance regression in this function that was reported to us in rust-lang#165988. While we desire the safety-improving code, that code does not affect the risk of "actual" undefined behavior in the library code. It merely reduces the amount of implementation details we internally rely on and thus whether that code is resilient to changes around it. r? @hanna-kruppe
…-retain, r=hanna-kruppe Clean revert of recent `String::retain` changes Cleanly revert `String::retain` changes introduced in rust-lang#150067 by also rolling back rust-lang#163624's safety hygiene changes in order to address a performance regression in this function that was reported to us in rust-lang#165988. While we desire the safety-improving code, that code does not affect the risk of "actual" undefined behavior in the library code. It merely reduces the amount of implementation details we internally rely on and thus whether that code is resilient to changes around it. r? @hanna-kruppe
…uwer Rollup of 24 pull requests Successful merges: - #165819 (Avoid redundant scans when extracting stage0 archives) - #166011 (Clean revert of recent `String::retain` changes) - #159805 (Implemented different with_native_path conversion methods, refactoring fs functions to utilize with_native_path, and move exists to use with_native_path) - #162414 (Make min/max and copysign intrinsics generic) - #163891 (Do not include context span when source is unavailable to render) - #164156 (Improve collapsed suggestions for trait impls tuples) - #165900 ([tiny] Tweak wording of missing `core` note) - #165978 (Mention `#![doc = include_str!(...)]` trick in intro page) - #165979 (Improve index inference diagnostics) - #165983 (Update `minifier-rs` dependency version to `0.5.0`) - #165999 (Update TPDE submodule) - #166005 (add ABI compat checks for new float types) - #165406 (Do not suggest `as_deref` for a slice pattern on `Err`) - #165792 (prevent optimization for input in ascii benchmarks) - #165936 (Enhance documentation for try_clone File implementation) - #165938 (`rustc_hir_typeck::upvar`: replace for loop with `.any()`) - #165941 (Merge `type_bf16()` with `type_f16b()`) - #165942 (windows: use io::const_error in get_access_mode) - #165946 (PassWrapper: adapt for latest round of LLVM codegen flag refactor) - #165956 (Document wide pointers in core::ptr module) - #165987 (Fix panic on non-UTF-8 command-line arguments when `RUST_BACKTRACE` is unset) - #165993 (pipe_subprocess test: use libtest harness) - #165996 (Fix(docs): Correct discard behavior in datagram peek docs) - #165998 (Cleanup borrowck)
…-retain, r=hanna-kruppe Clean revert of recent `String::retain` changes Cleanly revert `String::retain` changes introduced in rust-lang#150067 by also rolling back rust-lang#163624's safety hygiene changes in order to address a performance regression in this function that was reported to us in rust-lang#165988. While we desire the safety-improving code, that code does not affect the risk of "actual" undefined behavior in the library code. It merely reduces the amount of implementation details we internally rely on and thus whether that code is resilient to changes around it. r? @hanna-kruppe
…-retain, r=hanna-kruppe Clean revert of recent `String::retain` changes Cleanly revert `String::retain` changes introduced in rust-lang#150067 by also rolling back rust-lang#163624's safety hygiene changes in order to address a performance regression in this function that was reported to us in rust-lang#165988. While we desire the safety-improving code, that code does not affect the risk of "actual" undefined behavior in the library code. It merely reduces the amount of implementation details we internally rely on and thus whether that code is resilient to changes around it. r? @hanna-kruppe
…uwer Rollup of 21 pull requests Successful merges: - #166011 (Clean revert of recent `String::retain` changes) - #165475 (Add a `!type` annotation to a vtable for every supertrait that is a prefix of the vtable) - #165881 (fix MSVC calling convention byte counts) - #165882 (Add a separate feature gate for EIIs with default impls) - #165922 (Prevent inlining of foreign items through glob reexports named `_`) - #165979 (Improve index inference diagnostics) - #165983 (Update `minifier-rs` dependency version to `0.5.0`) - #165613 (Handle trait default values in `mir_for_direct_const`) - #165677 (Rewrite relaxed bound policy code) - #165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes) - #165990 (gca fixed issue regression tests) - #165993 (pipe_subprocess test: use libtest harness) - #165998 (Cleanup borrowck) - #166005 (add ABI compat checks for new float types) - #166009 (Improve `String::insert{,_str}` safety comments) - #166021 (Correct and expand E0225 error explanation.) - #166029 (rustc-dev-guide subtree update) - #166031 (Split packed structs out of `const_struct`) - #166032 (Normalize the simd field type before reading its length) - #166034 (Three LLVM-type-related cleanups) - #166047 (Document AltiVec requirement for powerpc64-unknown-linux-gnuelfv2)
Rollup merge of #166011 - workingjubilee:clean-revert-string-retain, r=hanna-kruppe Clean revert of recent `String::retain` changes Cleanly revert `String::retain` changes introduced in #150067 by also rolling back #163624's safety hygiene changes in order to address a performance regression in this function that was reported to us in #165988. While we desire the safety-improving code, that code does not affect the risk of "actual" undefined behavior in the library code. It merely reduces the amount of implementation details we internally rely on and thus whether that code is resilient to changes around it. r? @hanna-kruppe
…uwer Rollup of 21 pull requests Successful merges: - rust-lang/rust#166011 (Clean revert of recent `String::retain` changes) - rust-lang/rust#165475 (Add a `!type` annotation to a vtable for every supertrait that is a prefix of the vtable) - rust-lang/rust#165881 (fix MSVC calling convention byte counts) - rust-lang/rust#165882 (Add a separate feature gate for EIIs with default impls) - rust-lang/rust#165922 (Prevent inlining of foreign items through glob reexports named `_`) - rust-lang/rust#165979 (Improve index inference diagnostics) - rust-lang/rust#165983 (Update `minifier-rs` dependency version to `0.5.0`) - rust-lang/rust#165613 (Handle trait default values in `mir_for_direct_const`) - rust-lang/rust#165677 (Rewrite relaxed bound policy code) - rust-lang/rust#165861 (cg_llvm: Use an invariant lifetime brand for LLVM attributes) - rust-lang/rust#165990 (gca fixed issue regression tests) - rust-lang/rust#165993 (pipe_subprocess test: use libtest harness) - rust-lang/rust#165998 (Cleanup borrowck) - rust-lang/rust#166005 (add ABI compat checks for new float types) - rust-lang/rust#166009 (Improve `String::insert{,_str}` safety comments) - rust-lang/rust#166021 (Correct and expand E0225 error explanation.) - rust-lang/rust#166029 (rustc-dev-guide subtree update) - rust-lang/rust#166031 (Split packed structs out of `const_struct`) - rust-lang/rust#166032 (Normalize the simd field type before reading its length) - rust-lang/rust#166034 (Three LLVM-type-related cleanups) - rust-lang/rust#166047 (Document AltiVec requirement for powerpc64-unknown-linux-gnuelfv2)
|
beta backport approved as per libs team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle. Backport labels are handled by them. |
View all comments
Cleanly revert
String::retainchanges introduced in #150067 by also rolling back #163624's safety hygiene changes in order to address a performance regression in this function that was reported to us in #165988.While we desire the safety-improving code, that code does not affect the risk of "actual" undefined behavior in the library code. It merely reduces the amount of implementation details we internally rely on and thus whether that code is resilient to changes around it.
r? @hanna-kruppe