-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 7 pull requests #120336
Rollup of 7 pull requests #120336
Commits on Nov 23, 2023
-
Rewrite the BTreeMap cursor API using gaps
Tracking issue: rust-lang#107540 Currently, a `Cursor` points to a single element in the tree, and allows moving to the next or previous element while mutating the tree. However this was found to be confusing and hard to use. This PR completely refactors cursors to instead point to a gap between two elements in the tree. This eliminates the need for a "ghost" element that exists after the last element and before the first one. Additionally, `upper_bound` and `lower_bound` now have a much clearer meaning. The ability to mutate keys is also factored out into a separate `CursorMutKey` type which is unsafe to create. This makes the API easier to use since it avoids duplicated versions of each method with and without key mutation. API summary: ```rust impl<K, V> BTreeMap<K, V> { fn lower_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V> where K: Borrow<Q> + Ord, Q: Ord; fn lower_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V> where K: Borrow<Q> + Ord, Q: Ord; fn upper_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V> where K: Borrow<Q> + Ord, Q: Ord; fn upper_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V> where K: Borrow<Q> + Ord, Q: Ord; } struct Cursor<'a, K: 'a, V: 'a>; impl<'a, K, V> Cursor<'a, K, V> { fn next(&mut self) -> Option<(&'a K, &'a V)>; fn prev(&mut self) -> Option<(&'a K, &'a V)>; fn peek_next(&self) -> Option<(&'a K, &'a V)>; fn peek_prev(&self) -> Option<(&'a K, &'a V)>; } struct CursorMut<'a, K: 'a, V: 'a>; impl<'a, K, V> CursorMut<'a, K, V> { fn next(&mut self) -> Option<(&K, &mut V)>; fn prev(&mut self) -> Option<(&K, &mut V)>; fn peek_next(&mut self) -> Option<(&K, &mut V)>; fn peek_prev(&mut self) -> Option<(&K, &mut V)>; unsafe fn insert_after_unchecked(&mut self, key: K, value: V); unsafe fn insert_before_unchecked(&mut self, key: K, value: V); fn insert_after(&mut self, key: K, value: V); fn insert_before(&mut self, key: K, value: V); fn remove_next(&mut self) -> Option<(K, V)>; fn remove_prev(&mut self) -> Option<(K, V)>; fn as_cursor(&self) -> Cursor<'_, K, V>; unsafe fn with_mutable_key(self) -> CursorMutKey<'a, K, V, A>; } struct CursorMutKey<'a, K: 'a, V: 'a>; impl<'a, K, V> CursorMut<'a, K, V> { fn next(&mut self) -> Option<(&mut K, &mut V)>; fn prev(&mut self) -> Option<(&mut K, &mut V)>; fn peek_next(&mut self) -> Option<(&mut K, &mut V)>; fn peek_prev(&mut self) -> Option<(&mut K, &mut V)>; unsafe fn insert_after_unchecked(&mut self, key: K, value: V); unsafe fn insert_before_unchecked(&mut self, key: K, value: V); fn insert_after(&mut self, key: K, value: V); fn insert_before(&mut self, key: K, value: V); fn remove_next(&mut self) -> Option<(K, V)>; fn remove_prev(&mut self) -> Option<(K, V)>; fn as_cursor(&self) -> Cursor<'_, K, V>; unsafe fn with_mutable_key(self) -> CursorMutKey<'a, K, V, A>; } ```
Configuration menu - View commit details
-
Copy full SHA for 8ee9693 - Browse repository at this point
Copy the full SHA 8ee9693View commit details -
Update library/alloc/src/collections/btree/map.rs
Co-authored-by: Joe ST <joe@fbstj.net>
Configuration menu - View commit details
-
Copy full SHA for 166e348 - Browse repository at this point
Copy the full SHA 166e348View commit details -
Configuration menu - View commit details
-
Copy full SHA for d085f34 - Browse repository at this point
Copy the full SHA d085f34View commit details
Commits on Jan 23, 2024
-
linker: Refactor APIs for linking dynamic libraries
Rename `link_(dylib,framework)`, remove `link_rust_dylib`.
Configuration menu - View commit details
-
Copy full SHA for 50501c6 - Browse repository at this point
Copy the full SHA 50501c6View commit details -
linker: Refactor APIs for linking static libraries
Rename `link(_whole)(staticlib,rlib)` to something more suitable.
Configuration menu - View commit details
-
Copy full SHA for 0e38a65 - Browse repository at this point
Copy the full SHA 0e38a65View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14cd3fd - Browse repository at this point
Copy the full SHA 14cd3fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 859f37a - Browse repository at this point
Copy the full SHA 859f37aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d15db6b - Browse repository at this point
Copy the full SHA d15db6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b8e871 - Browse repository at this point
Copy the full SHA 1b8e871View commit details -
Configuration menu - View commit details
-
Copy full SHA for 03f23c1 - Browse repository at this point
Copy the full SHA 03f23c1View commit details
Commits on Jan 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for da33619 - Browse repository at this point
Copy the full SHA da33619View commit details -
This commit is part of clone3 clean up. As part of clean up we will
remove tests/ui/command/command-create-pidfd.rs . But it contains very useful comment, so let's move the comment to library/std/src/sys/pal/unix/rand.rs , which contains another instance of the same Docker problem
Askar Safin committedJan 24, 2024 Configuration menu - View commit details
-
Copy full SHA for 57f9d1f - Browse repository at this point
Copy the full SHA 57f9d1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9890c66 - Browse repository at this point
Copy the full SHA 9890c66View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35fffbb - Browse repository at this point
Copy the full SHA 35fffbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 94a14e7 - Browse repository at this point
Copy the full SHA 94a14e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d3699e - Browse repository at this point
Copy the full SHA 5d3699eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f99dd4d - Browse repository at this point
Copy the full SHA f99dd4dView commit details -
This commit is part of clone3 clean up. Merge tests from tests/ui/com…
…mand/command-create-pidfd.rs to library/std/src/sys/pal/unix/process/process_unix/tests.rs to remove code duplication
Askar Safin committedJan 24, 2024 Configuration menu - View commit details
-
Copy full SHA for 1ee773e - Browse repository at this point
Copy the full SHA 1ee773eView commit details -
Askar Safin committed
Jan 24, 2024 Configuration menu - View commit details
-
Copy full SHA for df0c9c3 - Browse repository at this point
Copy the full SHA df0c9c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for bdc9ce0 - Browse repository at this point
Copy the full SHA bdc9ce0View commit details
Commits on Jan 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 3004e8c - Browse repository at this point
Copy the full SHA 3004e8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 07b7c77 - Browse repository at this point
Copy the full SHA 07b7c77View commit details -
Rollup merge of rust-lang#118208 - Amanieu:btree_cursor2, r=dtolnay
Rewrite the BTreeMap cursor API using gaps Tracking issue: rust-lang#107540 Currently, a `Cursor` points to a single element in the tree, and allows moving to the next or previous element while mutating the tree. However this was found to be confusing and hard to use. This PR completely refactors cursors to instead point to a gap between two elements in the tree. This eliminates the need for a "ghost" element that exists after the last element and before the first one. Additionally, `upper_bound` and `lower_bound` now have a much clearer meaning. The ability to mutate keys is also factored out into a separate `CursorMutKey` type which is unsafe to create. This makes the API easier to use since it avoids duplicated versions of each method with and without key mutation. API summary: ```rust impl<K, V> BTreeMap<K, V> { fn lower_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V> where K: Borrow<Q> + Ord, Q: Ord; fn lower_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V> where K: Borrow<Q> + Ord, Q: Ord; fn upper_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V> where K: Borrow<Q> + Ord, Q: Ord; fn upper_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V> where K: Borrow<Q> + Ord, Q: Ord; } struct Cursor<'a, K: 'a, V: 'a>; impl<'a, K, V> Cursor<'a, K, V> { fn next(&mut self) -> Option<(&'a K, &'a V)>; fn prev(&mut self) -> Option<(&'a K, &'a V)>; fn peek_next(&self) -> Option<(&'a K, &'a V)>; fn peek_prev(&self) -> Option<(&'a K, &'a V)>; } struct CursorMut<'a, K: 'a, V: 'a>; impl<'a, K, V> CursorMut<'a, K, V> { fn next(&mut self) -> Option<(&K, &mut V)>; fn prev(&mut self) -> Option<(&K, &mut V)>; fn peek_next(&mut self) -> Option<(&K, &mut V)>; fn peek_prev(&mut self) -> Option<(&K, &mut V)>; unsafe fn insert_after_unchecked(&mut self, key: K, value: V); unsafe fn insert_before_unchecked(&mut self, key: K, value: V); fn insert_after(&mut self, key: K, value: V) -> Result<(), UnorderedKeyError>; fn insert_before(&mut self, key: K, value: V) -> Result<(), UnorderedKeyError>; fn remove_next(&mut self) -> Option<(K, V)>; fn remove_prev(&mut self) -> Option<(K, V)>; fn as_cursor(&self) -> Cursor<'_, K, V>; unsafe fn with_mutable_key(self) -> CursorMutKey<'a, K, V, A>; } struct CursorMutKey<'a, K: 'a, V: 'a>; impl<'a, K, V> CursorMut<'a, K, V> { fn next(&mut self) -> Option<(&mut K, &mut V)>; fn prev(&mut self) -> Option<(&mut K, &mut V)>; fn peek_next(&mut self) -> Option<(&mut K, &mut V)>; fn peek_prev(&mut self) -> Option<(&mut K, &mut V)>; unsafe fn insert_after_unchecked(&mut self, key: K, value: V); unsafe fn insert_before_unchecked(&mut self, key: K, value: V); fn insert_after(&mut self, key: K, value: V) -> Result<(), UnorderedKeyError>; fn insert_before(&mut self, key: K, value: V) -> Result<(), UnorderedKeyError>; fn remove_next(&mut self) -> Option<(K, V)>; fn remove_prev(&mut self) -> Option<(K, V)>; fn as_cursor(&self) -> Cursor<'_, K, V>; unsafe fn with_mutable_key(self) -> CursorMutKey<'a, K, V, A>; } struct UnorderedKeyError; ```
Configuration menu - View commit details
-
Copy full SHA for d32f495 - Browse repository at this point
Copy the full SHA d32f495View commit details -
Rollup merge of rust-lang#120099 - petrochenkov:linkapi, r=WaffleLapkin
linker: Refactor library linking methods in `trait Linker` Linkers are not aware of Rust libraries, they look like regular static or dynamic libraries to them, so Rust-specific methods in `trait Linker` do not make much sense. They can be either removed or renamed to something more suitable. Commits after the second one are cleanups.
Configuration menu - View commit details
-
Copy full SHA for a87ffe1 - Browse repository at this point
Copy the full SHA a87ffe1View commit details -
Rollup merge of rust-lang#120165 - reitermarkus:nonzero-switch-alias-…
…direction, r=dtolnay Switch `NonZero` alias direction. Step 4 mentioned in rust-lang#100428 (review). Depends on rust-lang#120160. r? `@dtolnay`
Configuration menu - View commit details
-
Copy full SHA for c4850d7 - Browse repository at this point
Copy the full SHA c4850d7View commit details -
Rollup merge of rust-lang#120288 - clubby789:bump-askama, r=Guillaume…
…Gomez Bump `askama` version Ran into this while looking at rust-lang#112865 and thought it would be useful to fix it now. Some more details in [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/Askama.20parser.20changes)
Configuration menu - View commit details
-
Copy full SHA for 89719eb - Browse repository at this point
Copy the full SHA 89719ebView commit details -
Rollup merge of rust-lang#120306 - safinaskar:clone3-clean-up, r=petr…
…ochenkov Clean up after clone3 removal from pidfd code (docs and tests) rust-lang#113939 removed clone3 from pidfd code. This patchset does necessary clean up: fixes docs and tests
Configuration menu - View commit details
-
Copy full SHA for 3c651fd - Browse repository at this point
Copy the full SHA 3c651fdView commit details -
Rollup merge of rust-lang#120316 - GuillaumeGomez:fix-ast-visitor, r=…
…compiler-errors Don't call `walk_` functions directly if there is an equivalent `visit_` method I was working on rust-lang#77773 and realized in one of my experiments that the `visit_path` method was not always called whereas it should have. This fixes it. r? `@davidtwco`
Configuration menu - View commit details
-
Copy full SHA for e47ba63 - Browse repository at this point
Copy the full SHA e47ba63View commit details -
Rollup merge of rust-lang#120330 - compiler-errors:no-coroutine-info-…
…in-coroutine-drop-body, r=nnethercote Remove coroutine info when building coroutine drop body Coroutine drop shims are not themselves coroutines, so erase the "`coroutine`" field from the body so that helper fns like `yield_ty` and `coroutine_kind` properly return `None` for the drop shim.
Configuration menu - View commit details
-
Copy full SHA for 8d3d3a8 - Browse repository at this point
Copy the full SHA 8d3d3a8View commit details