about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
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 #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-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-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>
2022-12-19Implement va_list and va_arg for s390x FFIUlrich Weigand-5/+50
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-19Rollup merge of #105915 - andrewpollack:revert-105250-async-rm-resumety, ↵Matthias Krüger-9/+2
r=tmandry Revert "Replace usage of `ResumeTy` in async lowering with `Context`" Reverts rust-lang/rust#105250 Fixes: #105501 Following instructions from [forge](https://forge.rust-lang.org/compiler/reviews.html#reverts). This change introduced a breaking change that is not actionable nor relevant, and is blocking updates to our toolchain. Along with other comments on the CL marking issues that are fixed by reverts, reverting is best until these issues can be resolved cc. `@Swatinem`
2022-12-19Rollup merge of #105902 - vincenzopalazzo:macros/pin_docs, r=eholkMatthias Krüger-1/+35
docs: improve pin docs Override https://github.com/rust-lang/rust/pull/104195 with a full cleanup of the git history, now it should be ready to be merged. r? ``@eholk`` ``@rustbot`` label +A-async-await
2022-12-19Rollup merge of #105801 - zertosh:path_mut_os_str_doc_test, r=dtolnayMatthias Krüger-3/+3
Realistic `Path::as_mut_os_str` doctest With "Implement DerefMut for PathBuf" (#105018) now merged, it's possible to exercise `Path::as_mut_os_str` (#105002) without going through `into_boxed_path`.
2022-12-19Revert "Replace usage of `ResumeTy` in async lowering with `Context`"Andrew Pollack-9/+2
2022-12-19Auto merge of #105698 - joboet:unsupported_threads_once, r=thomccbors-18/+103
Use a more efficient `Once` on platforms without threads The current implementation uses an atomic queue and spins rather than panicking when calling `call_once` recursively. Since concurrency is not supported on platforms like WASM, `Once` can be implemented much more efficiently using just a single non-atomic state variable.
2022-12-19docs: improve pin docsch-iv-1/+35
Co-authored-by: <@ch-iv>
2022-12-19Rollup merge of #105889 - Nilstrieb:fmt-libtest, r=thomccDylan DPC-24/+15
Fix `uninlined_format_args` in libtest Done using clippy with a quick manual review.
2022-12-19Rollup merge of #105682 - thomcc:expose-ptr-fmt, r=RalfJungDylan DPC-2/+2
Use `expose_addr()` in `fmt::Pointer` Discussion in https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/Should.20.60fmt.3A.3APointer.60.20expose.20the.20argument.3F on whether or not we should do this (still undecided). CC `@RalfJung`
2022-12-19Fix `uninlined_format_args` in libtestnils-24/+15
2022-12-18Rollup merge of #105858 - scottmcm:extra-as-chunks-example, r=the8472Matthias Krüger-0/+11
Another `as_chunks` example I really liked this structure that dtolney brought up in #105316, so wanted to put it in the docs to help others use it.
2022-12-18Auto merge of #105638 - tavianator:fix-50619-again, r=Mark-Simulacrumbors-38/+47
fs: Fix #50619 (again) and add a regression test Bug #50619 was fixed by adding an end_of_stream flag in #50630. Unfortunately, that fix only applied to the readdir_r() path. When I switched Linux to use readdir() in #92778, I inadvertently reintroduced the bug on that platform. Other platforms that had always used readdir() were presumably never fixed. This patch enables end_of_stream for all platforms, and adds a Linux-specific regression test that should hopefully prevent the bug from being reintroduced again.
2022-12-17Another `as_chunks` exampleScott McMurray-0/+11
I really liked this structure that dtolney brought up in #105316, so wanted to put it in the docs to help others use it.
2022-12-17Rollup merge of #105836 - evanj:fmt-doc-use-variables, r=Mark-SimulacrumMatthias Krüger-2/+2
std::fmt: Use args directly in example code The lint "clippy::uninlined_format_args" recommends inline variables in format strings. Fix two places in the docs that do not do this. I noticed this because I copy/pasted one example in to my project, then noticed this lint error. This fixes: ``` error: variables can be used directly in the `format!` string --> src/main.rs:30:22 | 30 | let string = format!("{:.*}", decimals, magnitude); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: variables can be used directly in the `format!` string --> src/main.rs:39:2 | 39 | write!(&mut io::stdout(), "{}", args).unwrap(); ```
2022-12-17Rollup merge of #105814 - JakobDegen:custom-mir-terms, r=oli-obkMatthias Krüger-2/+37
Support call and drop terminators in custom mir The only caveat with this change is that cleanup blocks are not supported. I would like to add them, but it's not quite clear to me what the best way to do that is, so I'll have to think about it some more. r? ``@oli-obk``
2022-12-17Rollup merge of #105458 - Ayush1325:blocking_spawn, r=Mark-SimulacrumMatthias Krüger-6/+77
Allow blocking `Command::output` ### Problem Currently, `Command::output` is internally implemented using `Command::spawn`. This is problematic because some targets (like UEFI) do not actually support multitasking and thus block while the program is executing. This coupling does not make much sense as `Command::output` is supposed to block until the execution is complete anyway and thus does not need to rely on a non-blocking `Child` or any other intermediate. ### Solution This PR moves the implementation of `Command::output` to `std::sys`. This means targets can choose to implement only `Command::output` without having to implement `Command::spawn`. ### Additional Information This was originally conceived when working on https://github.com/rust-lang/rust/pull/100316. Currently, the only target I know about that will benefit from this change is UEFI. This PR can also be used to implement more efficient `Command::output` since the intermediate `Process` is not actually needed anymore, but that is outside the scope of this PR. Since this is not a public API change, I'm not sure if an RFC is needed or not.
2022-12-17std::fmt: Use args directly in example codeEvan Jones-2/+2
The lint "clippy::uninlined_format_args" recommends inline variables in format strings. Fix two places in the docs that do not do this. I noticed this because I copy/pasted one example in to my project, then noticed this lint error. This fixes: error: variables can be used directly in the `format!` string --> src/main.rs:30:22 | 30 | let string = format!("{:.*}", decimals, magnitude); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: variables can be used directly in the `format!` string --> src/main.rs:39:2 | 39 | write!(&mut io::stdout(), "{}", args).unwrap();
2022-12-17str.lines() docstring: clarify that line endings are not returnedStefano Zacchiroli-2/+4
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-17Auto merge of #105794 - ChrisDenton:internal-doc, r=jyn514bors-1/+1
Add CI test for documentation of hidden items in std Fixes #87844 r? `@jyn514`
2022-12-16Support call and drop terminators in custom mirJakob Degen-2/+37
2022-12-16Realistic `Path::as_mut_os_str` doctestAndres Suarez-3/+3
2022-12-16Fix intra-doc linkChris Denton-1/+1
2022-12-16Auto merge of #105018 - zertosh:path_buf_deref_mut, r=dtolnaybors-0/+14
Implement DerefMut for PathBuf Without this, there's no way to get a `&mut Path` from `PathBuf` without going through `into_boxed_path`. This is relevant now that #105002 adds `PathBuf::as_mut_os_string` and `Path::as_mut_os_str`.
2022-12-16Rollup merge of #105748 - hakoerber:master, r=Dylan-DPCMatthias Krüger-5/+5
doc: Fix a few small issues Hey, while reading through the (awesome) stdlib docs, I found a few minor typos. * A few typos around generic types (`;` vs `,`) * Use inline code formatting for code fragments * One instance of wrong wording
2022-12-15Auto merge of #105356 - JakobDegen:more-custom-mir, r=oli-obkbors-22/+240
Custom MIR: Many more improvements Commits are each atomic changes, best reviewed one at a time, with the exception that the last commit includes all the documentation. ### First commit Unsafetyck was not correctly disabled before for `dialect = "built"` custom MIR. This is fixed and a regression test is added. ### Second commit Implements `Discriminant`, `SetDiscriminant`, and `SwitchInt`. ### Third commit Implements indexing, field, and variant projections. ### Fourth commit Documents the previous commits and everything else. There is some amount of weirdness here due to having to beat Rust syntax into cooperating with MIR concepts, but it hopefully should not be too much. All of it is documented. r? `@oli-obk`
2022-12-15doc: Fix a few small issuesHannes Körber-5/+5
* A few typos around generic types (`;` vs `,`) * Use inline code formatting for code fragments * One instance of wrong wording
2022-12-15Implement `From<bool>` for f32, f64Jacob Pratt-0/+20
2022-12-14Rollup merge of #105598 - RalfJung:more-comments, r=the8472Matthias Krüger-3/+4
explain mem::forget(env_lock) in fork/exec I stumbled upon this while doing triage for https://github.com/rust-lang/rust/issues/64718.
2022-12-14Rollup merge of #105399 - mikebenfield:lfs, r=thomccMatthias Krüger-8/+31
Use more LFS functions. On Linux, use mmap64, open64, openat64, and sendfile64 in place of their non-LFS counterparts. This is relevant to #94173. With these changes (together with rust-lang/backtrace-rs#501), the simple binaries I produce with rustc seem to have no non-LFS functions, so maybe #94173 is fixed. But I can't be sure if I've missed something and maybe some non-LFS functions could sneak in somehow.
2022-12-14fs/tests: Fail fast on duplicate errors rather than looping indefinitelyTavian Barnes-2/+2
2022-12-14fs/tests: Explicitly kill the zombie rather than sleeping until it diesTavian Barnes-7/+9
2022-12-14std: use a more efficient `Once` on platforms without threadsjoboet-18/+103
2022-12-14Auto merge of #105690 - matthiaskrgr:rollup-khtq97k, r=matthiaskrgrbors-1/+1
Rollup of 6 pull requests Successful merges: - #105642 (Minor grammar nit.) - #105658 (Remove ..X from RELEASES.md) - #105663 (Adjust log line in `fuchsia-test-runner.py`) - #105664 (rustdoc: apply `pre-wrap` CSS to code-wrapped links) - #105665 (rustdoc: simplify popover CSS) - #105676 (rustdoc: add CSS margin between `impl` docblock and its items) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-14Rollup merge of #105642 - uberFoo:master, r=Dylan-DPCMatthias Krüger-1/+1
Minor grammar nit. I was browsing the documentation and noticed that this should be an adverb.
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-0/+1
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-14Address documentation suggestionsJakob Degen-11/+13
2022-12-14Add documentation for custom mirJakob Degen-36/+224
2022-12-14Support more projections in custom mirJakob Degen-0/+22
2022-12-14Support common enum operations in custom mirJakob Degen-0/+6
2022-12-13Use `expose_addr()` in `fmt::Pointer`Thom Chiovoloni-2/+2
2022-12-13Improve wording for Option and ResultChris AtLee-8/+6
2022-12-13Add docs for question mark operator for OptionChris AtLee-0/+45