about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2024-06-11Fixed `_mm256_cvtsd_f64`sayantn-19/+19
This intrinsic should have `target_feature` AVX, (according to Intel Intrinsics Guide) but had AVX2
2024-06-10Simplify provider api to improve llvm irJane Losare-Lusby-26/+23
2024-06-10Rollup merge of #126212 - SteveLauC:fix/haiku, r=joboetMatthias Krüger-2/+2
fix: build on haiku ## What does this PR do The std is broken on haiku, this PR fixes it. ## To reproduce the issue ```sh $ cargo +nightly --version cargo 1.81.0-nightly (b1feb75d0 2024-06-07) $ cargo new hello $ cd hello $ cargo +nightly check -Zbuild-std --target x86_64-unknown-haiku -q error[E0433]: failed to resolve: use of undeclared crate or module `std` --> ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/os.rs:468:13 | 468 | std::ptr::null_mut(), | ^^^ use of undeclared crate or module `std` | help: consider importing one of these items | 8 + use core::ptr; | 8 + use crate::ptr; | help: if you import `ptr`, refer to it directly | 468 - std::ptr::null_mut(), 468 + ptr::null_mut(), | error[E0433]: failed to resolve: use of undeclared crate or module `std` --> ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/os.rs:470:13 | 470 | std::ptr::null_mut(), | ^^^ use of undeclared crate or module `std` | help: consider importing one of these items | 8 + use core::ptr; ```
2024-06-10Rollup merge of #126191 - ivan-shrimp:nonzero_doc, r=scottmcmMatthias Krüger-10/+32
Fix `NonZero` doctest inconsistencies <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> --> `NonZero`'s doctests contain both `?` and `.unwrap()` with no obvious reason for the difference, so this changes all of them to `?`. Also removes an explicit `std::num::NonZero`.
2024-06-10Bump windows-bindgen to 0.57Chris Denton-417/+66
2024-06-10Clarify `Command::new` behavior if passed programs with arguments许杰友 Jieyou Xu (Joe)-0/+19
2024-06-10Remove some unused crate dependencies.Nicholas Nethercote-2/+0
I found these by setting the `unused_crate_dependencies` lint temporarily to `Warn`.
2024-06-09Update docs for AtomicU8/I8.Zachary S-15/+31
Clarify that they always have the same alignment as u8/i8, (unlike other atomic types). Clarify in from_ptr that alignment is never an issue because of this.
2024-06-10fix: build on haikuSteve Lau-2/+2
2024-06-09Update safety docs for AtomicBool::from_ptr.Zachary S-2/+2
Clarify that alignment is never an issue, since `align_of::<AtomicBool>() == 1`.
2024-06-09docs(core): make more const_ptr doctests assert instead of printingbinarycat-16/+22
fixes #124669
2024-06-09Auto merge of #126205 - jieyouxu:rollup-s64z5ng, r=jieyouxubors-30/+69
Rollup of 4 pull requests Successful merges: - #126172 (Weekly `cargo update`) - #126176 (rustdoc-search: use lowercase, non-normalized name for type search) - #126190 (Autolabel run-make tests, remind to update tracking issue) - #126194 (Migrate more things to `WinError`) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-09Rollup merge of #125253 - sunsided:feature/FRAC_1_SQRT_PI, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-0/+23
Add `FRAC_1_SQRT_2PI` constant to f16/f32/f64/f128 This adds the `FRAC_1_SQRT_2PI` to the `f16`, `f32`, `f64` and `f128` as [`1/√(2π)`](https://www.wolframalpha.com/input?i=1%2Fsqrt%282*pi%29). The rationale is that while `FRAC_1_SQRT_PI` already exists, [Gaussian calculations](https://en.wikipedia.org/wiki/Gaussian_function) for random normal distributions require a `1/(σ√(2π))` term, which could then be directly expressed e.g. as `f32::FRAC_1_SQRT_2PI / sigma`. The actual value is approximately `1/√(2π) = 0.3989422804014326779399460599343818684758586311649346576659258296…`. Truncated/rounded forms were used for the individual types. --- ~~I did not any of the `#[unstable]` attributes since I am not aware of their implications.~~ **Edit:** I applied the stability attributes from the surrounding types according to what seemed most likely correct. I believe the `more_float_constants` feature marker is incorrectly applied, but I wasn't sure how to proceed.
2024-06-09Migrate more things to WinErrorChris Denton-30/+69
2024-06-09fix `NonZero` doctest inconsistenciesivan-shrimp-10/+32
2024-06-09Rollup merge of #126168 - devnexen:current_exe_haiku_simpl, r=ChrisDentonMatthias Krüger-10/+10
std::unix::os current_exe implementation simplification for haiku. _get_net_image_info is a bit overkill as it allows to get broader informations about the process.
2024-06-09Rollup merge of #126146 - devnexen:signal_fbsd, r=ChrisDentonMatthias Krüger-0/+4
std::unix::process adding few specific freebsd signals to be able to id.
2024-06-08std::unix::os current_exe implementation simplification for haiku.David Carlier-10/+10
_get_net_image_info is a bit overkill as it allows to get broader informations about the process.
2024-06-08Auto merge of #125966 - schvv31n:impl_os_string_pathbuf_leak, r=workingjubileebors-0/+72
Implement `os_string_pathbuf_leak` implementation of #125965 ACP: https://github.com/rust-lang/libs-team/issues/389 [ Accepted ]
2024-06-08std::unix::process adding few specific freebsd signals to be able to id.David Carlier-0/+4
2024-06-08Rollup merge of #126138 - wbk:patch-1, r=lqdLeón Orell Valerian Liehr-1/+1
Fix typo in docs for std::pin
2024-06-08Rollup merge of #125998 - devnexen:get_mode_illumos, r=NilstriebLeón Orell Valerian Liehr-0/+4
std::unix::fs::get_mode implementation for illumos/solaris. they both support the F_GETFL fctnl flag/O_ACCMODE mask to get the file descriptor access modes.
2024-06-08Rollup merge of #125951 - slanterns:error_in_core_stabilization, r=AmanieuLeón Orell Valerian Liehr-16/+3
Stabilize `error_in_core` Closes: https://github.com/rust-lang/rust/issues/103765. `@rustbot` label: +T-libs-api r? libs-api
2024-06-07Fix typo in docs for std::pinWalter Kalata-1/+1
2024-06-07add HermitOS support of vectored read/write operationsStefan Lankes-92/+181
In general, the I/O interface of hermit-abi is more POSIX-like interface. Consequently, platform abstraction layer for HermitOS has slightly adjusted and some inaccuracies remove.
2024-06-07Fix duplicated argument name in extern blockbjorn3-1/+1
While rustc accepts it just fine due to what is arguably a bug, this duplication does become an issue when generating functions from the llvm intrinsic declarations while reusing the argument names.
2024-06-07Rollup merge of #126089 - wutchzone:option_take_if, r=scottmcmMatthias Krüger-3/+1
Stabilize Option::take_if Closes #98934 ed: FCP complete in https://github.com/rust-lang/rust/issues/98934#issuecomment-2104627082
2024-06-07Rollup merge of #126030 - ChrisDenton:update-wingen-readme, r=Mark-SimulacrumMatthias Krüger-1/+1
Update `./x fmt` command in library/std/src/sys/pal/windows/c/README.md `./x fmt` no longer accepts paths so the command in the readme won't work.
2024-06-07Rollup merge of #124012 - slanterns:as_slice_stabilize, r=BurntSushiMatthias Krüger-3/+1
Stabilize `binary_heap_as_slice` This PR stabilizes `binary_heap_as_slice`: ```rust // std::collections::BinaryHeap impl BinaryHeap<T> { pub fn as_slice(&self) -> &[T] } ``` <br> Tracking issue: https://github.com/rust-lang/rust/issues/83659. Implementation PR: https://github.com/rust-lang/rust/pull/82331. FCPs already completed in the tracking issue. Closes https://github.com/rust-lang/rust/issues/83659. r? libs-api
2024-06-07Ignore int3 instructions when counting instructions in testsAmanieu d'Antras-1/+1
These are generated as padding and are not actually part of the function.
2024-06-07Auto merge of #126110 - workingjubilee:backtrace-0.3.73, r=workingjubileebors-2/+2
Update backtrace to 0.3.73 Fixes #126109 r? `@ghost`
2024-06-06Update backtrace to 0.3.73Jubilee Young-2/+2
2024-06-06Rollup merge of #125606 - diondokter:opt-size-int-fmt, r=cuviperJubilee-0/+33
Size optimize int formatting Let's use the new feature flag! This uses a simpler algorithm to format integers. It is slower, but also smaller. It also saves having to import the 200 byte rodata lookup table. In a test of mine this saves ~300 bytes total of a cortex-m binary that does integer formatting. For a 16KB device, that's almost 2%. Note though that for opt-level 3 the text size actually grows by 116 bytes. Still a win in total. I'm not sure why the generated code is bigger than the more fancy algo. Maybe the smaller algo lends itself more to inlining and duplicating?
2024-06-07fix doc comments about `error_generic_member_access`Slanterns-2/+2
2024-06-07Stabilize `error_in_core`Slanterns-14/+1
2024-06-06fixed memory leaks in PathBuf::leak & OsString::leak testsschvv31n-1/+6
2024-06-06Rollup merge of #126096 - c410-f3r:tests-tests-tests, r=jhprattJubilee-1/+6
[RFC-2011] Allow `core_intrinsics` when activated Fix #120612
2024-06-06[RFC-2011] Allow `core_intrinsics` when activatedCaio-1/+6
2024-06-06Stabilize Option::take_ifDaniel Sedlak-3/+1
2024-06-06less garbage, more examplesRalf Jung-10/+78
2024-06-05Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiBJubilee Young-4/+4
Prevent copy-paste errors from producing new starved-for-resources threaded platforms by raising `DEFAULT_MIN_STACK_SIZE` from 4096 bytes to at least 64KiB. Two platforms "affected" by this have no actual threads: - UEFI - "unsupported" Platforms that this actually affects: - wasm32-wasi with "atomics" enabled - wasm32-wasi-p1-threads Two exceptions: - SGX: a "secure code execution" platform, stays at 4096B - TEEOS: also a "secure code execution" platform, stays at 8192B I believe either of these may have sufficiently "interesting" semantics around threads, or significant external library support. Either would mean making any choices here for them is suspect.
2024-06-05Auto merge of #126038 - matthiaskrgr:rollup-h4rm3x2, r=matthiaskrgrbors-17/+11
Rollup of 9 pull requests Successful merges: - #124840 (resolve: mark it undetermined if single import is not has any bindings) - #125622 (Winnow private method candidates instead of assuming any candidate of the right name will apply) - #125648 (Remove unused(?) `~/rustsrc` folder from docker script) - #125672 (Add more ABI test cases to miri (RFC 3391)) - #125800 (Fix `mut` static task queue in SGX target) - #125871 (Orphanck[old solver]: Consider opaque types to never cover type parameters) - #125893 (Handle all GVN binops in a single place.) - #126008 (Port `tests/run-make-fulldeps/issue-19371` to ui-fulldeps) - #126032 (Update description of the `IsTerminal` example) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-05Promote `arm64ec-pc-windows-msvc` to tier 2Daniel Paoliello-1/+5
2024-06-05Rollup merge of #126032 - ChrisDenton:update-docs, r=joboetMatthias Krüger-3/+2
Update description of the `IsTerminal` example The example code prompts for input if stdin is a terminal.
2024-06-05Rollup merge of #125800 - fortanix:raoul/rte-99-fix_mut_static_task_queue, ↵Matthias Krüger-14/+9
r=jethrogb Fix `mut` static task queue in SGX target [PR 125046](https://github.com/rust-lang/rust/pull/125046) prevents mutable references to statics with `#[linkage]`. Such a construct was used with the tests for the `x86_64-fortanix-unknown-sgx` target. This PR fixes this and cleans up code a bit in 5 steps. Each step passes CI: - The `mut` static is removed, and `Task` explicitly implements `Send` - Renaming of the `task_queue::lock` function - Pass function for `Thread` as `Send` to `Thread::imp` and update when `Packet<'scope, T>` implements `Sync` - Storing `Task::p` as a type that implements `Send` - Letting the compiler auto implement `Send` for `Task` cc: ``@jethrogb``
2024-06-05Rollup merge of #125940 - devnexen:unix_fs_netbsd_get_path, r=cuviperMatthias Krüger-9/+13
std::unix::fs::get_path: using fcntl codepath for netbsd instead. on netbsd, procfs is not as central as on linux/solaris thus can be perfectly not mounted. Thus using fcntl with F_GETPATH, the kernel deals with MAXPATHLEN internally too.
2024-06-05Update description of the `IsTerminal` exampleChris Denton-3/+2
2024-06-05Update `./x fmt` commandChris Denton-1/+1
2024-06-05Rollup merge of #125995 - kpreid:const-uninit-stable, r=NilstriebJubilee-12/+5
Use inline const blocks to create arrays of `MaybeUninit`. This PR contains 2 changes enabled by the fact that [`inline_const` is now stable](https://github.com/rust-lang/rust/pull/104087), and was split out of #125082. 1. Use inline const instead of `unsafe` to construct arrays in `MaybeUninit` examples. Rationale: Demonstrate good practice of avoiding `unsafe` code where it is not strictly necessary. 4. Use inline const instead of `unsafe` to implement `MaybeUninit::uninit_array()`. This is arguably giving the compiler more work to do, in exchange for eliminating just one single internal unsafe block, so it's less certain that this is good on net. r​? `@Nilstrieb`
2024-06-05Rollup merge of #125982 - xTachyon:fix-linked-list, r=jhprattJubilee-2/+41
Make deleting on LinkedList aware of the allocator Fixed #125950