about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2024-11-02Rollup merge of #132455 - RalfJung:const_alloc_layout, r=dtolnayGuillaume Gomez-6/+5
make const_alloc_layout feature gate only about functions that are already stable The const_alloc_layout feature gate has two kinds of functions: those that are stable, but not yet const-stable, and those that are fully unstable. I think we should split that up. So this PR makes const_alloc_layout just about functions that are already stable but waiting for const-stability; all the other functions now have their constness guarded by the gate that also guards their regular stability. Cc https://github.com/rust-lang/rust/issues/67521
2024-11-02Rollup merge of #132451 - RalfJung:less-rustc_allow_const_fn_unstable, ↵Guillaume Gomez-8/+0
r=tgross35 remove some unnecessary rustc_allow_const_fn_unstable These are either unstable functions that don't need the attribute, or the attribute refers to a feature that is already stable.
2024-11-02Rollup merge of #132445 - RalfJung:const-unchecked-shifts, r=tgross35Guillaume Gomez-20/+16
Cleanup attributes around unchecked shifts and unchecked negation in const The underlying intrinsic is marked as "safe to expose on stable", so we shouldn't need any `rustc_allow_const_fn_unstable(unchecked_shifts)` anywhere. However, bootstrap rustc doesn't yet have the new const stability checks, so these changes only apply under `cfg(not(bootstrap))`.
2024-11-02Rollup merge of #132413 - lolbinarycat:offset_of_nested-docs, r=workingjubileeGuillaume Gomez-5/+3
update offset_of! docs to reflect the stabilization of nesting this seems to have been missed.
2024-11-01remove no-longer-needed attributeRalf Jung-12/+0
2024-11-01add missing safety commentsRalf Jung-0/+6
2024-11-01adjust test gating for f16/f128Ralf Jung-6/+6
2024-11-01float types: move copysign, abs, signum to libcoreRalf Jung-363/+363
2024-11-01offset_from / sub_ptr docs: emphasize that pointers must be in the same ↵Ralf Jung-12/+12
allocation
2024-11-01feat(byte_sub_ptr): add ptr::byte_sub_ptrAria Beingessner-0/+57
This is an API that naturally should exist as a combination of byte_offset_from and sub_ptr both existing (they showed up at similar times so this union was never made). Adding these is a logical (and perhaps final) precondition of stabilizing ptr_sub_ptr (#95892).
2024-11-01make const_alloc_layout feature gate only about functions that are already ↵Ralf Jung-6/+5
stable the rest has their constness guarded by their usual feature gate
2024-11-01Add some more basic docstrings (#352)Johanna Sörngård-0/+14
* Add docstrings to the tgamma functions * Add docstrings to the lgamma functions * Add docstrings to trunc * Add docstrings to exp10 functions
2024-11-01Use C-unwind abi for the llvm.wasm.throw intrinsicNoa-1/+1
2024-11-01Introduce `hf32!` and `hf64!` macros for hex float supportTrevor Gross-26/+430
Rust does not have any native way to parse hex floats, but they are heavily used in the C algorithms that we derive from. Introduce a const function that can parse these, as well as macros `hf32!` and `hf64!` that ensure the string literals get handled at compiler time. These are currently not used but making everything available now will ease future development. Co-authored-by: quaternic <57393910+quaternic@users.noreply.github.com>
2024-11-01Enable clippy for `libm` in CITrevor Gross-2/+9
2024-11-01Fix errors reported by Clippy in `libm`Trevor Gross-305/+306
2024-11-01chore: release v0.1.138github-actions[bot]-1/+16
2024-11-01Enable the changelog for `release-plz`Trevor Gross-1/+0
This crate isn't meant for direct use, but having an easy way to see what changed between versions would still be helpful when this crate is updated in rust-lang/rust.
2024-11-01unchecked_shifts, unchecked_neg are safe-to-const-expose-on-stable, so we ↵Ralf Jung-20/+16
can get rid of a bunch of attributes
2024-11-01ci: add support for loongarch64-unknown-linux-gnuWANG Rui-0/+16
2024-11-01remove some unnecessary rustc_allow_const_fn_unstableRalf Jung-8/+0
2024-11-01Use `f16_enabled`/`f128_enabled` in `examples/intrinsics.rs` (#724)hev-16/+106
Enable conditional compilation for intrinsics with `f16_enabled` and `f128_enabled`
2024-11-01Disable `f16` for LoongArch64 (#722)hev-0/+2
Disable `f161` for LoongArch64 due to incorrect code generation on LLVM 19, which causes failures in `testcrate/tests/conv.rs`. This workaround will remain in place until llvm/llvm-project#109093 is merged or we upgrade to LLVM 20.
2024-11-01Replace `libm_test::{Float, Int}` with `libm::{Float, Int}`Trevor Gross-283/+199
This involves moving some things from full generic implementations (e.g. `impl<F: Float> SomeTrait for F { /* ... */ }` to generic functions and macros to implement traits that call them, due to orphan rule violations after `Float` became a not-in-crate trait. `Hex` was moved to `test_traits` so we can eliminate `num_traits`.
2024-11-01Expose the `support` module publicly with a test featureTrevor Gross-1/+12
2024-11-01Update libm `Float` and `Int` with functions from the test traitsTrevor Gross-16/+77
The test versions of `Float` and `Int` have a few more methods and constants availablee. Update the in `libm` with everything missing from `libm_test` so we will be able to merge these.
2024-11-01Change prefixes used by the `Float` traitTrevor Gross-21/+26
Change `EXPONENT_` to `EXP_` and `SIGNIFICAND_` to `SIG_`. These are pretty unambiguous, and just makes for less to type once these get used.
2024-10-31Check benchmarks in CITrevor Gross-1/+5
2024-10-31Remove `libm-bench`Trevor Gross-133/+0
This has been superseded by the benchmarks in `libm-test`.
2024-10-31Add benchmarks against musl libmTrevor Gross-0/+132
Add a benchmark for each function that checks against `musl_math_sys`.
2024-10-31chore: release v0.1.137github-actions[bot]-1/+1
2024-10-31Auto merge of #132206 - tgross35:update-builtins, r=wesleywiserbors-4/+4
Update compiler-builtins to 0.1.136 This includes: * The license change https://github.com/rust-lang/compiler-builtins/pull/717 * The `libm` submodule update, which also has a license change https://github.com/rust-lang/libm/pull/317 * Re-enabling `math` on i686 UEFI https://github.com/rust-lang/compiler-builtins/pull/715 Fixes: https://github.com/rust-lang/rust/issues/128533
2024-10-31use semantic line breaklolbinarycat-2/+2
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2024-11-01core_arch: powerpc: Fix documentation for vec_ctuJens Reidel-1/+1
Like the name suggests, this converts to unsigned integers rather than signed. I assume this was copy pasted from vec_cts. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2024-10-31update offset_of! docs to reflect the stablization of nestingbinarycat-4/+2
2024-10-31ci: add support for loongarch64-unknown-linux-gnuWANG Rui-0/+15
2024-10-31Add intra-doc link in str::xxx_char_boundaryArthur Carcano-3/+5
2024-10-31Add a `collect_into` tuple test caseSebastian Hahn-0/+13
2024-10-31Don't impl Extend for 13-tuplesSebastian Hahn-1/+0
2024-10-30rustdoc-search: simplify rules for generics and type paramsMichael Howell-0/+6
This commit is a response to feedback on the displayed type signatures results, by making generics act stricter. Generics are tightened by making order significant. This means `Vec<Allocator>` now matches only with a true vector of allocators, instead of matching the second type param. It also makes unboxing within generics stricter, so `Result<A, B>` only matches if `B` is in the error type and `A` is in the success type. The top level of the function search is unaffected. Find the discussion on: * <https://rust-lang.zulipchat.com/#narrow/stream/393423-t-rustdoc.2Fmeetings/topic/meeting.202024-07-08/near/449965149> * <https://github.com/rust-lang/rust/pull/124544#issuecomment-2204272265> * <https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/deciding.20on.20semantics.20of.20generics.20in.20rustdoc.20search/near/476841363>
2024-10-30Remove do_not_const_check from Iterator methodsMichael Goulet-76/+0
2024-10-30Rename `canonical_name` to `base_name`Trevor Gross-26/+27
"Canonical" isn't really the right word here, update to "base".
2024-10-30Remove the unneeded `isqrt` feature gateTrevor Gross-1/+0
[1] has been stabilized so we no longer need to enable it. [1]: https://github.com/rust-lang/rust/issues/116226
2024-10-30Add integer to `f128` conversionsTrevor Gross-68/+348
2024-10-30Refactor integer to float conversionTrevor Gross-48/+138
Extract some common routines to separate functions in order to deduplicate code and remove some of the magic.
2024-10-30Add an apfloat fallback for int to float testsTrevor Gross-52/+77
2024-10-30Add intra-doc link in str::xxx_prefixArthur Carcano-2/+4
2024-10-30Auto merge of #132238 - Urgau:midpoint-i64-hackers-impl, r=joboetbors-2/+2
Use Hacker's Delight impl in `i64::midpoint` instead of wide `i128` impl This PR switches `i64::midpoint` and (`isize::midpoint` where `isize == i64`) to using our Hacker's Delight impl instead of wide `i128` implementation. As LLVM seems to be outperformed by the complexity of signed 128-bits number compared to our Hacker's Delight implementation.[^1] It doesn't seems like it's an improvement for the other sizes[^2], so we let them with the wide implementation. [^1]: https://rust.godbolt.org/z/ravE75EYj [^2]: https://rust.godbolt.org/z/fzr171zKh r? libs
2024-10-29Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`Eduardo Sánchez Muñoz-0/+211
2024-10-29Auto merge of #132326 - matthiaskrgr:rollup-ngyw18g, r=matthiaskrgrbors-2/+0
Rollup of 6 pull requests Successful merges: - #131984 (Stabilize if_let_rescope) - #132151 (Ensure that resume arg outlives region bound for coroutines) - #132157 (Remove detail from label/note that is already available in other note) - #132274 (Cleanup op lookup in HIR typeck) - #132319 (cg_llvm: Clean up FFI calls for setting module flags) - #132321 (xous: sync: remove `rustc_const_stable` attribute on Condvar and Mutex new()) r? `@ghost` `@rustbot` modify labels: rollup