summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | | | | Rollup merge of #95594 - the8472:raw_slice_methods, r=yaahcYuki Okushi2022-06-021-1/+118
| |\ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Additional `*mut [T]` methods Split out from #94247 This adds the following methods to raw slices that already exist on regular slices * `*mut [T]::is_empty` * `*mut [T]::split_at_mut` * `*mut [T]::split_at_mut_unchecked` These methods reduce the amount of unsafe code needed to migrate `ChunksMut` and related iterators to raw slices (#94247) r? `@m-ou-se`
| | * | | | | | | | | | | Update safety comments, make `split_at_mut` unsafeThe 84722022-04-031-22/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `&mut [T]` implies validity which automatically makes `ptr::add` ok within its bounds. But `*mut [T]` does not. Since we still want the benefits of in-bounds pointer arithmetic `split_at_must` must require the caller to pass valid pointers and therefore it is `unsafe`.
| | * | | | | | | | | | | add tracking issueThe 84722022-04-021-2/+2
| | | | | | | | | | | | |
| | * | | | | | | | | | | Additional `*mut [T]` methodsBen Kimock2022-04-021-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split out from #94247 This adds the following methods to raw slices that already exist on regular slices * `*mut [T]::is_empty` * `*mut [T]::split_at_mut` * `*mut [T]::split_at_unchecked` These methods reduce the amount of unsafe code needed to migrate ChunksMut and related iterators to raw slices (#94247) Co-authored-by:: The 8472 <git@infinite-source.de>
* | | | | | | | | | | | | Auto merge of #97612 - ehuss:update-cargo, r=ehussbors2022-06-011-0/+0
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update cargo 5 commits in 39ad1039d9e3e1746177bf5d134af4c164f95528..38472bc19f2f76e245eba54a6e97ee6821b3c1db 2022-05-25 00:50:02 +0000 to 2022-05-31 02:03:24 +0000 - Emit warning upon encountering multiple packages with the same name (rust-lang/cargo#10701) - Guide new users to add use `super::*;` to `mod test` (rust-lang/cargo#10706) - Document how to debug change detection events (rust-lang/cargo#10708) - fix(publish): add more check when use `publish -p &lt;SPEC&gt;` (rust-lang/cargo#10677) - fix key formatting when switching to a dotted `WorkspaceSource` (rust-lang/cargo#10705)
| * | | | | | | | | | | | Update cargoEric Huss2022-05-311-0/+0
| | | | | | | | | | | | |
* | | | | | | | | | | | | Auto merge of #97624 - matthiaskrgr:rollup-rtcqjx9, r=matthiaskrgrbors2022-06-0138-78/+655
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rollup of 4 pull requests Successful merges: - #96271 (suggest `?` when method is missing on `Result<T, _>` but found on `T`) - #97264 (Suggest `extern crate foo` when failing to resolve `use foo`) - #97592 (rustdoc: also index impl trait and raw pointers) - #97621 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
| * \ \ \ \ \ \ \ \ \ \ \ \ Rollup merge of #97621 - RalfJung:miri, r=RalfJungMatthias Krüger2022-06-012-10/+11
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | update Miri Fixes https://github.com/rust-lang/rust/issues/97563 Cc ``@rust-lang/miri`` r? ``@ghost``
| | * | | | | | | | | | | | | update MiriRalf Jung2022-06-012-10/+11
| | | |_|_|_|_|_|/ / / / / / | | |/| | | | | | | | | | |
| * | | | | | | | | | | | | Rollup merge of #97592 - notriddle:notriddle/impl-trait, r=GuillaumeGomezMatthias Krüger2022-06-016-8/+182
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rustdoc: also index impl trait and raw pointers Revives #92339
| | * | | | | | | | | | | | | rustdoc: also index raw pointersMichael Howell2022-05-313-2/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Noah Lev <camelidcamel@gmail.com>
| | * | | | | | | | | | | | | rustdoc: also index impl traitMichael Howell2022-05-314-6/+100
| | | |_|_|_|_|_|_|_|_|/ / / | | |/| | | | | | | | | | |
| * | | | | | | | | | | | | Rollup merge of #97264 - ↵Matthias Krüger2022-06-0126-8/+94
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TaKO8Ki:suggest-extern-crate-when-failing-to-resolve-use-crate, r=estebank Suggest `extern crate foo` when failing to resolve `use foo` closes #97095 r? ``@estebank``
| | * | | | | | | | | | | | | suggest `extern crate foo` when failing to resolve `use foo`Takayuki Maeda2022-05-2526-8/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix ci error
| * | | | | | | | | | | | | | Rollup merge of #96271 - compiler-errors:suggest-question-mark, r=estebankMatthias Krüger2022-06-014-52/+368
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|/ / / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | suggest `?` when method is missing on `Result<T, _>` but found on `T` The wording needs help, I think. Fixes #95729
| | * | | | | | | | | | | | | address commentsMichael Goulet2022-05-304-55/+109
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | better enum suggestionsMichael Goulet2022-05-304-52/+314
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Auto merge of #97622 - JohnTitor:rollup-4qoxrjn, r=JohnTitorbors2022-06-0115-59/+257
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rollup of 9 pull requests Successful merges: - #94647 (Expose `get_many_mut` and `get_many_unchecked_mut` to HashMap) - #97216 (Ensure we never consider the null pointer dereferencable) - #97399 (simplify code of finding arg index in `opt_const_param_of`) - #97470 (rustdoc: add more test coverage) - #97498 (Corrected EBNF grammar for from_str) - #97562 (Fix comment in `poly_project_and_unify_type`) - #97580 (Add regression test for #71546) - #97611 (Tweak insert docs) - #97616 (Remove an unnecessary `Option`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
| * | | | | | | | | | | | | | Rollup merge of #97616 - TaKO8Ki:remove-unnecessary-option, r=Dylan-DPCYuki Okushi2022-06-012-4/+11
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove an unnecessary `Option`
| | * | | | | | | | | | | | | | remove an unnecessary `Option`Takayuki Maeda2022-06-012-4/+11
| |/ / / / / / / / / / / / / / |/| | | | | | | | | | | | | |
| * | | | | | | | | | | | | | Rollup merge of #97611 - azdavis:master, r=Dylan-DPCYuki Okushi2022-06-013-7/+13
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tweak insert docs For `{Hash, BTree}Map::insert`, I always have to take a few extra seconds to think about the slight weirdness about the fact that if we "did not" insert (which "sounds" false), we return true, and if we "did" insert, (which "sounds" true), we return false. This tweaks the doc comments for the `insert` methods of those types (as well as what looks like a rustc internal data structure that I found just by searching the codebase for "If the set did") to first use the "Returns whether _something_" pattern used in e.g. `remove`, where we say that `remove` "returns whether the value was present".
| | * | | | | | | | | | | | | | Tweak insert docsAriel Davis2022-05-313-7/+13
| | | |_|_|/ / / / / / / / / / | | |/| | | | | | | | | | | |
| * | | | | | | | | | | | | | Rollup merge of #97580 - JohnTitor:issue-71546, r=compiler-errorsYuki Okushi2022-06-012-0/+39
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add regression test for #71546 Closes #71546 r? `@compiler-errors`
| | * | | | | | | | | | | | | | Add regression test for #71546Yuki Okushi2022-06-012-0/+39
| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Rollup merge of #97562 - ↵Yuki Okushi2022-06-011-14/+14
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compiler-errors:comment-poly_project_and_unify_type, r=lcnr Fix comment in `poly_project_and_unify_type` Renamed some variants to match `ProjectAndUnifyResult`
| | * | | | | | | | | | | | | | | Fix comment in poly_project_and_unify_typeMichael Goulet2022-05-311-14/+14
| | | |_|/ / / / / / / / / / / / | | |/| | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Rollup merge of #97498 - ijchen:master, r=Mark-SimulacrumYuki Okushi2022-06-011-1/+0
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrected EBNF grammar for from_str Hello! This is my first time contributing to an open-source project. I'm excited to have the chance to contribute to the rust community 🥳 I noticed an issue with the documentation for `from_str` in `f32` and `f64`. It states that "All strings that adhere to the following [EBNF](https://www.w3.org/TR/REC-xml/#sec-notation) grammar when lowercased will result in an `Ok` being returned. I believe this is incorrect for the string `"."`, which is valid for the given EBNF grammar, but does not result in an `Ok` being returned ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=09f891aa87963a56d3b0d715d8cbc2b4)). I have simplified the grammar in a way which fixes that, but is otherwise identical. Previously, the `Number` part of the EBNF grammar had an option for `'.' Digit*`, which would include the string `"."`. This is not valid, and does not return an Ok as stated. The corrected version removes this, and still allows for the `'.' Digit+` case with the already existing `Digit* '.' Digit+` case.
| | * | | | | | | | | | | | | | | Corrected EBNF grammar for from_strIsaac Chen2022-05-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the `Number` part of the EBNF grammar had an option for `'.' Digit*`, which would include the string "." (a single decimal point). This is not valid, and does not return an Ok as stated. The corrected version removes this, and still allows for the `'.' Digit+` case with the already existing `Digit* '.' Digit+` case.
| * | | | | | | | | | | | | | | | Rollup merge of #97470 - notriddle:notriddle/test-cases, r=GuillaumeGomezYuki Okushi2022-06-013-2/+47
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rustdoc: add more test coverage https://github.com/rust-lang/rust/issues/91113
| | * | | | | | | | | | | | | | | | rustdoc: add test case for the implementors JS file placementMichael Howell2022-05-272-0/+43
| | | | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | | | rustdoc: add test case for email that looks like intra-doc linkMichael Howell2022-05-271-2/+4
| | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | Rollup merge of #97399 - SparrowLii:arg_index, r=oli-obkYuki Okushi2022-06-011-31/+16
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | simplify code of finding arg index in `opt_const_param_of` From the FIXME in the impl of `opt_const_param_of`. Part of the code is simplified by blending two iterator statements and using `let...else` statement.
| | * | | | | | | | | | | | | | | | | simplify code of finding arg indexSparrowLii2022-05-251-31/+16
| | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | Rollup merge of #97216 - RalfJung:null-ptr-check, r=oli-obkYuki Okushi2022-06-011-0/+4
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure we never consider the null pointer dereferencable This replaces the checks that are being removed in https://github.com/rust-lang/rust/pull/97188. Those checks were too early and hence incorrect.
| | * | | | | | | | | | | | | | | | | | Ensure we never consider the null pointer dereferencableRalf Jung2022-05-201-0/+4
| | | | | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | | | | Rollup merge of #94647 - Urgau:hash-map-many-mut, r=AmanieuYuki Okushi2022-06-011-0/+113
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ |/ / / / / / / / / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expose `get_many_mut` and `get_many_unchecked_mut` to HashMap This pull-request expose the function [`get_many_mut`](https://docs.rs/hashbrown/0.12.0/hashbrown/struct.HashMap.html#method.get_many_mut) and [`get_many_unchecked_mut`](https://docs.rs/hashbrown/0.12.0/hashbrown/struct.HashMap.html#method.get_many_unchecked_mut) from `hashbrown` to the standard library `HashMap` type. They obviously keep the same API and are added under the (new) `map_many_mut` feature. - `get_many_mut`: Attempts to get mutable references to `N` values in the map at once. - `get_many_unchecked_mut`: Attempts to get mutable references to `N` values in the map at once, without validating that the values are unique.
| * | | | | | | | | | | | | | | | | | | Expose get_many_mut and get_many_unchecked_mut to HashMapLoïc BRANSTETT2022-06-011-0/+113
| | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | Auto merge of #97553 - nbdd0121:lib, r=Mark-Simulacrumbors2022-06-011-0/+2
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|/ / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `#[inline]` to `Vec`'s `Deref/DerefMut` This should help #97552 (although I haven't verified).
| * | | | | | | | | | | | | | | | | | | Add `#[inline]` to `Vec`'s `Deref/DerefMut`Gary Guo2022-05-301-0/+2
| | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | Auto merge of #97435 - Patryk27:bump-compiler-builtins, r=Dylan-DPCbors2022-06-012-3/+3
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | library/std: Bump compiler_builtins Some neat changes include faster float conversions & fixes for AVR 🙂 (note that's it's my first time upgrading `compiler_builtins`, so I'm not 100% sure if bumping `library/std/Cargo.toml` is enough; certainly seems to be so, though.)
| * | | | | | | | | | | | | | | | | | | library/std: Bump compiler_builtinsPatryk Wychowaniec2022-05-262-3/+3
| | | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | | Auto merge of #97600 - matthiaskrgr:rollup-yivyeu5, r=matthiaskrgrbors2022-05-318-26/+46
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rollup of 4 pull requests Successful merges: - #97316 (Put a bound on collection misbehavior) - #97578 (alloc: remove repeated word in comment) - #97593 (:arrow_up: rust-analyzer) - #97596 (Fixup feature name to be more consistent with others) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Rollup merge of #97596 - WaffleLapkin:fixup_feature_name, r=compiler-errorsMatthias Krüger2022-05-311-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixup feature name to be more consistent with others `slice_from_mut_ptr_range_const` -> `const_slice_from_mut_ptr_range`, we usually have `const` in the front. I've made a typo in #97419
| | * | | | | | | | | | | | | | | | | | | | Fixup feature name to be more consistent with othersMaybe Waffle2022-05-311-1/+1
| | | |_|_|_|_|_|_|_|_|_|_|_|_|_|/ / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `slice_from_mut_ptr_range_const` -> `const_slice_from_mut_ptr_range`, we usually have `const` in the front.
| * | | | | | | | | | | | | | | | | | | | Rollup merge of #97593 - lnicola:rust-analyzer-2022-05-31, r=lnicolaMatthias Krüger2022-05-311-7/+24
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :arrow_up: rust-analyzer r? `@ghost`
| | * | | | | | | | | | | | | | | | | | | | :arrow_up: rust-analyzerLaurențiu Nicola2022-05-311-7/+24
| | |/ / / / / / / / / / / / / / / / / / /
| * | | | | | | | | | | | | | | | | | | | Rollup merge of #97578 - ojeda:checkpatch, r=JohnTitorMatthias Krüger2022-05-311-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alloc: remove repeated word in comment Linux's `checkpatch.pl` reports: ```txt #42544: FILE: rust/alloc/vec/mod.rs:2692: WARNING: Possible repeated word: 'to' + // - Elements are :Copy so it's OK to to copy them, without doing ``` Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
| | * | | | | | | | | | | | | | | | | | | | alloc: remove repeated word in commentMiguel Ojeda2022-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux's `checkpatch.pl` reports: ```txt #42544: FILE: rust/alloc/vec/mod.rs:2692: WARNING: Possible repeated word: 'to' + // - Elements are :Copy so it's OK to to copy them, without doing ``` Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
| * | | | | | | | | | | | | | | | | | | | | Rollup merge of #97316 - CAD97:bound-misbehavior, r=dtolnayMatthias Krüger2022-05-315-17/+20
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Put a bound on collection misbehavior As currently written, when a logic error occurs in a collection's trait parameters, this allows *completely arbitrary* misbehavior, so long as it does not cause undefined behavior in std. However, because the extent of misbehavior is not specified, it is allowed for *any* code in std to start misbehaving in arbitrary ways which are not formally UB; consider the theoretical example of a global which gets set on an observed logic error. Because the misbehavior is only bound by not resulting in UB from safe APIs and the crate-level encapsulation boundary of all of std, this makes writing user unsafe code that utilizes std theoretically impossible, as it now relies on undocumented QOI (quality of implementation) that unrelated parts of std cannot be caused to misbehave by a misuse of std::collections APIs. In practice, this is a nonconcern, because std has reasonable QOI and an implementation that takes advantage of this freedom is essentially a malicious implementation and only compliant by the most langauage-lawyer reading of the documentation. To close this hole, we just add a small clause to the existing logic error paragraph that ensures that any misbehavior is limited to the collection which observed the logic error, making it more plausible to prove the soundness of user unsafe code. This is not meant to be formal; a formal refinement would likely need to mention that values derived from the collection can also misbehave after a logic error is observed, as well as define what it means to "observe" a logic error in the first place. This fix errs on the side of informality in order to close the hole without complicating a normal reading which can assume a reasonable nonmalicious QOI. See also [discussion on IRLO][1]. [1]: https://internals.rust-lang.org/t/using-std-collections-and-unsafe-anything-can-happen/16640 r? rust-lang/libs-api ```@rustbot``` label +T-libs-api -T-libs This technically adds a new guarantee to the documentation, though I argue as written it's one already implicitly provided.
| | * | | | | | | | | | | | | | | | | | | | BTreeSet->BTreeMap (fix copy/paste mistake in documentation)David Tolnay2022-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: lcnr <rust@lcnr.de>