about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2022-12-28Rollup merge of #104708 - ↵fee1-dead-1/+1
jonasspinner:fix-backoff-doc-to-match-implementation, r=compiler-errors Fix backoff doc to match implementation The commit 8dddb2294310ad3e8ce0b2af735a702ad72a9a99 in the crossbeam-channel PR (#93563) changed the backoff strategy to be quadratic instead of exponential. This updates the doc to prevent confusion.
2022-12-28Rollup merge of #104024 - noeddl:unused-must-use, r=compiler-errorsfee1-dead-1/+1
Fix `unused_must_use` warning for `Box::from_raw`
2022-12-28Rollup merge of #103945 - H4x5:remove-iter-empty-hack, r=compiler-errorsfee1-dead-6/+1
Remove `iter::Empty` hack `iter::Empty` uses a newtype to work around `#![feature(const_fn_fn_ptr_basics)]`, which has been stable since 1.61.0.
2022-12-28Rollup merge of #94145 - ssomers:binary_heap_tests, r=jyn514fee1-dead-60/+109
Test leaking of BinaryHeap Drain iterators Add test cases about forgetting the `BinaryHeap::Drain` iterator, and slightly fortifies some other test cases. Consists of separate commits that I don't think are relevant on their own (but I'll happily turn these into more PRs if desired).
2022-12-28Auto merge of #103881 - ChayimFriedman2:patch-2, r=compiler-errorsbors-8/+9
Clarify docs of `RefCell` Comparison operators only panic if the `RefCell` is mutably borrowed, and `RefCell::swap()` can also panic if swapping a `RefCell` with itself.
2022-12-28Auto merge of #100539 - joboet:horizon_timeout_clock, r=thomccbors-2/+4
Use correct clock in `park_timeout` on Horizon Horizon does not support using `CLOCK_MONOTONIC` with condition variables, so use the system time instead.
2022-12-27Auto merge of #106193 - compiler-errors:rollup-0l54wka, r=compiler-errorsbors-10/+17
Rollup of 9 pull requests Successful merges: - #103718 (More inference-friendly API for lazy) - #105765 (Detect likely `.` -> `..` typo in method calls) - #105852 (Suggest rewriting a malformed hex literal if we expect a float) - #105965 (Provide local extern function arg names) - #106064 (Partially fix `explicit_outlives_requirements` lint in macros) - #106179 (Fix a formatting error in Iterator::for_each docs) - #106181 (Fix doc comment parsing description in book) - #106187 (Update the documentation of `Vec` to use `extend(array)` instead of `extend(array.iter().copied())`) - #106189 (Fix UnsafeCell Documentation Spelling Error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-27Fix `core::any` mod-level docsAlbert Larsan-1/+1
2022-12-27Rollup merge of #106189 - alexhrao:master, r=NilstriebMichael Goulet-1/+1
Fix UnsafeCell Documentation Spelling Error This fixes the spelling of "deallocated" (instead of the original "deallocted") In the `cell.rs` source file. Honestly probably not worth the time to evaluate, but since it doesn't involve any code change, I figure why not?
2022-12-27Rollup merge of #106187 - ChayimFriedman2:patch-4, r=compiler-errorsMichael Goulet-1/+1
Update the documentation of `Vec` to use `extend(array)` instead of `extend(array.iter().copied())` Another option is to use `extend_from_slice()` (that may be faster), but I find this approach cleaner.
2022-12-27Rollup merge of #106179 - RetroSeven:typo_fix, r=compiler-errorsMichael Goulet-1/+1
Fix a formatting error in Iterator::for_each docs There is a formatting error (extra space in an assignment) in the documentation of `core::iter::Iterator::for_each`, which I have fixed in this pull request.
2022-12-27Rollup merge of #103718 - matklad:infer-lazy, r=dtolnayMichael Goulet-7/+14
More inference-friendly API for lazy The signature for new was ``` fn new<F>(f: F) -> Lazy<T, F> ``` Notably, with `F` unconstrained, `T` can be literally anything, and just `let _ = Lazy::new(|| 92)` would not typecheck. This historiacally was a necessity -- `new` is a `const` function, it couldn't have any bounds. Today though, we can move `new` under the `F: FnOnce() -> T` bound, which gives the compiler enough data to infer the type of T from closure.
2022-12-27Fix UnsafeCell Documentation Spelling ErrorAlex Rao-1/+1
This fixes the spelling of "deallocated" (instead of the original "deallocted") In the `cell.rs` source file
2022-12-27Auto merge of #97176 - kraktus:cmd_debug, r=the8472bors-8/+173
More verbose `Debug` implementation of `std::process:Command` Mainly based on commit: https://github.com/zackmdavis/rust/commit/ccc019aabfdd550944c049625e66c92c815ea1d0 from https://github.com/zackmdavis close https://github.com/rust-lang/rust/issues/42200
2022-12-27Update the documentation of `Vec` to use `extend(array)` instead of ↵Chayim Refael Friedman-1/+1
`extend(array.iter().copied())`
2022-12-27Fix a formatting errorRetroSeven-1/+1
2022-12-27More verbose `Debug` implementation of `std::process:Command`kraktus-8/+173
based on commit: https://github.com/zackmdavis/rust/commit/ccc019aabfdd550944c049625e66c92c815ea1d0 from https://github.com/zackmdavis close https://github.com/rust-lang/rust/issues/42200 Add env variables and cwd to the shell-like debug output. Also use the alternate syntax to display a more verbose display, while not showing internal fields and hiding fields when they have their default value.
2022-12-26Suggest `impl Iterator` when possible for `_` return typeEsteban Küber-0/+1
Address #106096.
2022-12-26Iterator::find: link to Iterator::position in docs for discoverabilityMaja Kądziołka-0/+3
2022-12-25Auto merge of #105997 - RalfJung:immediate-abort, r=eholkbors-7/+9
abort immediately on bad mem::zeroed/uninit Now that we have non-unwinding panics, let's use them for these assertions. This re-establishes the property that `mem::uninitialized` and `mem::zeroed` will never unwind -- the earlier approach of causing panics here sometimes led to hard-to-debug segfaults when the surrounding code was not able to cope with the unexpected unwinding. Cc `@bjorn3` I did not touch cranelift but I assume it needs a similar patch. However it has a `codegen_panic` abstraction that I did not want to touch since I didn't know how else it is used.
2022-12-25Auto merge of #106112 - RalfJung:into-iter, r=thomccbors-2/+27
add lib tests for vec::IntoIter alignment issues This adds non-Miri tests for the issue fixed in https://github.com/rust-lang/rust/pull/106084 r? `@thomcc`
2022-12-24Auto merge of #104977 - RalfJung:ptr-from-ref, r=dtolnaybors-15/+37
add ptr::from_{ref,mut} We have methods to avoid almost all `as` casts around raw pointer handling, except for the initial cast from reference to raw pointer. These new methods close that gap. (I also moved `null_mut` next to `null` to keep the file consistently organized.) r? libs-api Tracking issue: https://github.com/rust-lang/rust/issues/106116
2022-12-24Auto merge of #106111 - matthiaskrgr:rollup-nnpoe5h, r=matthiaskrgrbors-12/+12
Rollup of 6 pull requests Successful merges: - #105465 (Improve top-level docs) - #105872 (Suggest remove last method call when type coerce with expected type) - #106032 (std: only use LFS function on glibc) - #106078 (Provide more context on FileCheck failures) - #106100 (Codegen test for derived `<` on trivial newtype [TEST ONLY]) - #106109 (rustdoc: make line number CSS for doc comment and scraped the same) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-24add tracking issue, fix typoRalf Jung-3/+3
2022-12-24add lib tests for vec::IntoIter alignment issuesRalf Jung-2/+27
2022-12-24Rollup merge of #106032 - mcha-forks:lfs-musl-fix, r=thomccMatthias Krüger-12/+12
std: only use LFS function on glibc see #94173 and commit 27011b4185f5341e579d2a02cabd3dc7d7aa7149.
2022-12-24Auto merge of #106081 - mina86:c, r=Mark-Simulacrumbors-1/+5
char: µoptimise UTF-16 surrogates decoding According to Godbolt¹, on x86_64 using binary and produces slightly better code than using subtraction. Readability of both is pretty much equivalent so might just as well use the shorter option. ¹ https://rust.godbolt.org/z/9jM3ejbMx
2022-12-23fix one more unaligned self.ptr, and add testsRalf Jung-1/+1
2022-12-23fix IntoIter::drop on high-alignment ZSTRalf Jung-10/+11
2022-12-23char: µoptimise UTF-16 surrogates decodingMichal Nazarewicz-1/+5
According to Godbolt¹, on x86_64 using binary and produces slightly better code than using subtraction. Readability of both is pretty much equivalent so might just as well use the shorter option. ¹ https://rust.godbolt.org/z/9jM3ejbMx
2022-12-23Stop at the first `NULL` argument when iterating `argv`Sebastian Dröge-6/+22
Some C commandline parsers (e.g. GLib and Qt) are replacing already handled arguments in `argv` with `NULL` and move them to the end. That means that `argc` might be bigger than the actual number of non-`NULL` pointers in `argv` at this point. To handle this we simply stop iterating at the first `NULL` argument. `argv` is also guaranteed to be `NULL`-terminated so any non-`NULL` arguments after the first `NULL` can safely be ignored. Fixes https://github.com/rust-lang/rust/issues/105999
2022-12-22abort immediately on bad mem::zeroed/uninitRalf Jung-7/+9
2022-12-22std: only use LFS function on glibcmochaaP-12/+12
see #94173 and commit 27011b4185f5341e579d2a02cabd3dc7d7aa7149.
2022-12-22Auto merge of #106025 - matthiaskrgr:rollup-vz5rqah, r=matthiaskrgrbors-6/+5
Rollup of 6 pull requests Successful merges: - #105837 (Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity) - #105932 (Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15) - #105960 (Various cleanups) - #105985 (Method chain nitpicks) - #105996 (Test that async blocks are `UnwindSafe`) - #106012 (Clarify that raw retags are not permitted in Mir) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-22Auto merge of #106023 - JohnTitor:rollup-k8mettz, r=JohnTitorbors-13/+15
Rollup of 8 pull requests Successful merges: - #105584 (add assert messages if chunks/windows are length 0) - #105602 (interpret: add read_machine_[ui]size convenience methods) - #105824 (str.lines() docstring: clarify that line endings are not returned) - #105980 (Refer to "Waker" rather than "RawWaker" in `drop` comment) - #105986 (Fix typo in reading_half_a_pointer.rs) - #105995 (Add regression test for #96530) - #106008 (Sort lint_groups in no_lint_suggestion) - #106014 (Add comment explaining what the scrape-examples-toggle.goml GUI test is about) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-22Rollup merge of #106012 - JakobDegen:retag-raw, r=RalfJungMatthias Krüger-1/+0
Clarify that raw retags are not permitted in Mir Not sure when this changed, but documentation and the validator needed to be updated. This also removes raw retags from custom mir. cc rust-lang/miri#2735 r? `@RalfJung`
2022-12-22Rollup merge of #105960 - oli-obk:effect_cleanup, r=fee1-deadMatthias Krüger-5/+5
Various cleanups This PR pulls changes out of https://github.com/rust-lang/rust/pull/101900 that can land on master immediately r? ``@fee1-dead``
2022-12-22Rollup merge of #105980 - goffrie:waker-drop, r=thomccYuki Okushi-2/+2
Refer to "Waker" rather than "RawWaker" in `drop` comment In my view this is technically more correct as `Waker` actually implements `Drop` (which calls the `drop` method) whereas `RawWaker` does not.
2022-12-22Rollup merge of #105824 - zacchiro:patch-1, r=JohnTitorYuki Okushi-2/+4
str.lines() docstring: clarify that line endings are not returned Previously, the str.lines() docstring stated that lines are split at line endings, but not whether those were returned or not. This new version of the docstring states this explicitly, avoiding the need of getting to doctests to get an answer to this FAQ.
2022-12-22Rollup merge of #105584 - raffimolero:patch-1, r=JohnTitorYuki Okushi-9/+9
add assert messages if chunks/windows are length 0
2022-12-21Auto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJungbors-4/+5
Rename `assert_uninit_valid` intrinsic It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that. This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager. r? `@RalfJung`
2022-12-21Clarify that raw retags are not permitted in MirJakob Degen-1/+0
2022-12-21Auto merge of #100390 - jhpratt:float-from-bool, r=dtolnaybors-0/+20
Implement `From<bool>` for f32, f64 As is required for trait implementations, these are insta-stable. Given there is a release tomorrow and this needs FCP, I set 1.65 as the stable version. `@rustbot` label +A-floating-point +C-feature-request +needs-fcp +relnotes +S-waiting-on-review +T-libs-api -T-libs
2022-12-21less specific wordingRalf Jung-2/+1
2022-12-20Refer to "Waker" rather than "RawWaker" in `drop` commentGeoffry Song-2/+2
2022-12-20Auto merge of #105127 - Sp00ph:const_new, r=dtolnaybors-3/+4
Make `VecDeque::new` const (See #105072)
2022-12-20Auto merge of #105381 - uweigand:s390x-ffi-vaarg, r=nikicbors-5/+50
Implement va_list and va_arg for s390x FFI Following the s390x ELF ABI and based on the clang implementation, provide appropriate definitions of va_list in library/core/src/ffi/mod.rs and va_arg handling in compiler/rustc_codegen_llvm/src/va_arg.rs. Fixes the following test cases on s390x: src/test/run-make-fulldeps/c-link-to-rust-va-list-fn src/test/ui/abi/variadic-ffi.rs Fixes https://github.com/rust-lang/rust/issues/84628.
2022-12-20Stabilize path_as_mut_os_strAndres Suarez-4/+2
Closes #105021
2022-12-20Fix some `~const` usage in libcoreOli Scherer-5/+5
2022-12-19Update coerce_unsized tracking issue from #27732 to #18598Anders Kaseorg-24/+24
Issue #27732 was closed as a duplicate of #18598. Signed-off-by: Anders Kaseorg <andersk@mit.edu>