about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2024-11-03Move some numeric trait logic to default implementationsTrevor Gross-48/+67
There are a handful of functions we can move out of the macro and to the numeric traits as default implementations; do that here. Additionally, add some bounds that make sense for completeness.
2024-11-04Fix and undeprecate home_dir()Kornel-18/+14
2024-11-03Change the `multiprec_` prefix to `mp_`Trevor Gross-5/+5
Currently there is a combination of names starting with `multiprecision_`, `mp_` and `multiprec_`. Update so `multiprecision_` is always used when a long form makes sense, `mp_` otherwise (eliminating `multiprec_`).
2024-11-03Enable `f128` tests on all non-buggy platforms 🎉Trevor Gross-7/+12
With the `compiler-builtins` update to 0.1.137 [1], we now provide symbols necessary to work with `f128` everywhere. This means that we are no longer restricted to 64-bit linux, and can enable tests by default. There are still a handful of platforms that need to remain disabled because of bugs. This patch additionally disables the following: 1. MIPS [2] 2. 32-bit x86 [3] Math support is still off by default since those symbols are not yet available. [1]: https://github.com/rust-lang/rust/pull/132433 [2]: https://github.com/llvm/llvm-project/issues/96432 [3]: https://github.com/llvm/llvm-project/issues/77401
2024-11-04Auto merge of #132581 - workingjubilee:rollup-4wj318p, r=workingjubileebors-1/+9
Rollup of 6 pull requests Successful merges: - #126136 (Call the target libdir target libdir) - #132516 (Add bad-reg inline assembly ui test for RISC-V and s390x) - #132521 (replace manual time convertions with std ones, comptime time format parsing) - #132560 (Remove outdated tidy license fixmes) - #132563 (Modify `NonZero` documentation to reference the underlying integer type) - #132574 (compiler: Directly use rustc_abi almost everywhere) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-03Update `compiler_builtins` to 0.1.138 and pin itTrevor Gross-4/+4
This updates to a new version of builtins that includes [1], which was the last blocker to us enabling `f128` tests on all platforms 🎉. With this update, also change to pinning the version with `=` rather than using the default carat versioning. This is meant to ensure that `compiler-builtins` does not get updated as part of the weekly `Cargo.lock` update, since updates to this crate need to be intentional: changes to rust-lang/rust and rust-lang/compiler-builtins sometimes need to be kept in lockstep, unlike most dependencies, and sometimes these updates can be problematic. [1]: https://github.com/rust-lang/compiler-builtins/pull/624
2024-11-03Rollup merge of #132563 - frectonz:master, r=AmanieuJubilee-1/+9
Modify `NonZero` documentation to reference the underlying integer type This change updates the documentation for `NonZero` integer types to explicitly reference the underlying integer type each `NonZero` variant wraps, instead of using a general "integer" term. **Before** ![image](https://github.com/user-attachments/assets/b13bda82-007b-459c-8b22-e27d79005271) **After** ![image](https://github.com/user-attachments/assets/1d7fadc7-dce3-4b84-9b8f-d2bb81c05eb7)
2024-11-03chore: release v0.1.139github-actions[bot]-1/+7
2024-11-03Remove incorrect `sparcv9` match pattern from `configure_f16_f128`beetrees-1/+1
2024-11-03Auto merge of #123723 - madsmtm:apple-std-os, r=dtolnaybors-15/+37
Make `std::os::darwin` public I'm not sure of the reasoning behind them not being public before, but I think they should be, just like `std::os::ios` and `std::os::macos` are public. Additionally, I've merged their source code, as it was otherwise just a bunch of unnecessary duplication. Ultimately, I've done this PR to fix `./x build library --target=aarch64-apple-tvos,aarch64-apple-watchos,aarch64-apple-visionos`, as that currently fails because of dead code warnings. Since you reviewed https://github.com/rust-lang/rust/pull/121419 r? davidtwco Fixes https://github.com/rust-lang/rust/issues/121640. `@rustbot` label O-tvos O-watchos O-visionos
2024-11-03Auto merge of #132479 - compiler-errors:fx-feat-yeet, r=fee1-deadbors-6/+6
Yeet the `effects` feature, move it onto `const_trait_impl` This PR merges the `effects` feature into the `const_trait_impl` feature. There's really no need to have two feature gates for one feature. After this PR, if `const_trait_impl` **is** enabled: * Users can use and define const traits * `HostEffect` const conditions will be enforced on the HIR * We re-check the predicates in MIR just to make sure that we don't "leak" anything during MIR lowering And if `const_trait_impl` **is not** enabled: * Users cannot use nor define const traits * `HostEffect` const conditions are not enforced on the HIR * We will raise a const validation error if we call a function that has any const conditions (i.e. const traits and functions with any `~const` in their where clasues) This should be the last step for us to be able to enable const traits in the standard library. We still need to re-constify `Drop` and `Destruct` and stuff for const traits to be particularly *useful* for some cases, but this is a good step :D r? fee1-dead cc `@rust-lang/project-const-traits`
2024-11-03Rename the FIXMEs, remove a few that dont matter anymoreMichael Goulet-6/+6
2024-11-03Auto merge of #132542 - RalfJung:const_panic, r=tgross35bors-129/+142
add const_panic macro to make it easier to fall back to non-formatting panic in const Suggested by `@tgross35` r? `@tgross35`
2024-11-03remove const-support for align_offsetRalf Jung-931/+177
Operations like is_aligned would return actively wrong results at compile-time, i.e. calling it on the same pointer at compiletime and runtime could yield different results. That's no good. Instead of having hacks to make align_offset kind-of work in const-eval, just use const_eval_select in the few places where it makes sense, which also ensures those places are all aware they need to make sure the fallback behavior is consistent.
2024-11-03Modify `NonZero` documentation to reference the underlying integer typefrectonz-1/+9
This change updates the documentation for `NonZero` integer types to explicitly reference the underlying integer type each `NonZero` variant wraps, instead of using a general "integer" term.
2024-11-03Rollup merge of #132511 - RalfJung:const_arguments_as_str, r=dtolnayMatthias Krüger-5/+2
stabilize const_arguments_as_str FCP passed in the [tracking issue](https://github.com/rust-lang/rust/issues/103900#issuecomment-2397096659).
2024-11-03Rollup merge of #132503 - RalfJung:const-hash-map, r=AmanieuMatthias Krüger-16/+29
better test for const HashMap; remove const_hash leftovers The existing `const_with_hasher` test is kind of silly since the HashMap it constructs can never contain any elements. So this adjusts the test to construct a usable HashMap, which is a bit non-trivial since the default hash builder cannot be built in `const`. `BuildHasherDefault::new()` helps but is unstable (https://github.com/rust-lang/rust/issues/123197), so we also have a test that does not involve that type. The second commit removes the last remnants of https://github.com/rust-lang/rust/issues/104061, since they aren't actually useful -- without const traits, you can't do any hashing in `const`. Cc ``@rust-lang/libs-api`` ``@rust-lang/wg-const-eval`` Closes #104061 Related to https://github.com/rust-lang/rust/issues/102575
2024-11-03Rollup merge of #132499 - RalfJung:unicode_data.rs, r=tgross35Matthias Krüger-1/+1
unicode_data.rs: show command for generating file https://github.com/rust-lang/rust/pull/131647 made this an easily runnable tool, now we just have to mention that in the comment. :) Fixes https://github.com/rust-lang/rust/issues/131640.
2024-11-03Rollup merge of #132393 - zedddie16:issue-131865-fix, r=tgross35Matthias Krüger-0/+10
Docs: added brief colon explanation https://github.com/rust-lang/rust/issues/131865 (this is my first attempt at contributing, feedback is welcome)
2024-11-03Rollup merge of #131377 - rick-de-water:nonzero-exp, r=dtolnayMatthias Krüger-16/+41
Add LowerExp and UpperExp implementations to NonZero Adds `LowerExp` and `UpperExp` trait implementations to `NonZero`, as discussed in rust-lang/libs-team#458. I had to modify the macro to mark the new impls with a different rust version. Let me know if this is the right way to do it (first timer here!)
2024-11-03Rollup merge of #129329 - eduardosm:rc-from-mut-slice, r=dtolnayMatthias Krüger-0/+211
Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>` ACP: https://github.com/rust-lang/libs-team/issues/424 New API: ```rust impl<T: Clone> From<&mut [T]> for Box<[T]> impl From<&mut str> for Box<str> impl From<&mut CStr> for Box<CStr> impl From<&mut OsStr> for Box<OsStr> impl From<&mut Path> for Box<Path> impl<T: Clone> From<&mut [T]> for Rc<[T]> impl From<&mut str> for Rc<str> impl From<&mut CStr> for Rc<CStr> impl From<&mut OsStr> for Rc<OsStr> impl From<&mut Path> for Rc<Path> impl<T: Clone> From<&mut [T]> for Arc<[T]> impl From<&mut str> for Arc<str> impl From<&mut CStr> for Arc<CStr> impl From<&mut OsStr> for Arc<OsStr> impl From<&mut Path> for Arc<Path> ``` Since they are trait implementations, I think these are insta-stable. As mentioned in https://github.com/rust-lang/libs-team/issues/424#issuecomment-2299415749, a crater run might be needed.
2024-11-03add const_panic macro to make it easier to fall back to non-formatting panic ↵Ralf Jung-129/+142
in const
2024-11-03stabilize const_arguments_as_strRalf Jung-5/+2
2024-11-02Change default ULP to use enum matchingTrevor Gross-59/+47
Migrate from string to enum matching and tie this to `CheckCtx::new`, so no tests need to explicitly set ULP.
2024-11-02Rename `Name` to `Identifier` to avoid some ambiguity of "name"Trevor Gross-38/+35
2024-11-02Change the `CheckCtx` constructor to take a `Name` enumTrevor Gross-50/+40
This prepares to eliminate some reliance on string matching but does not yet make those changes.
2024-11-03Auto merge of #132458 - RalfJung:rustc-const-unstable, r=Amanieubors-100/+0
get rid of a whole bunch of unnecessary rustc_const_unstable attributes In general, when a `const fn` is still unstable, it doesn't need a `#[rustc_const_unstable]` attribute. The only exception is functions that internally use things that can't be used in stable const fn yet. So this gets rid of a whole bunch of `#[rustc_const_unstable]` in libcore.
2024-11-02Correct the proc macro to emit `pub` functionsTrevor Gross-3/+3
2024-11-02Rework tests to make use of the new `MathOp` traitTrevor Gross-315/+278
2024-11-02Introduce a `op` module with struct representations of each routineTrevor Gross-2/+115
This contains: 1. Per-function and per-operation enums created by the proc macro 2. The `MathOp` trait which is implemented once per struct representing a function 3. Submodules for each function, each containing a `Routine` struct that implements `MathOp`
2024-11-02Rustdoc: added brief colon explanationtuturuu-0/+10
2024-11-02Add Set entry APIAlex Saveau-0/+449
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2024-11-02Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with ↵Alex Saveau-0/+20
original lifetime
2024-11-03ci: Use distro toolchain for loongarch64-unknown-linux-gnuWANG Rui-15/+10
2024-11-02Adjust how the proc macro emits types and add an enumTrevor Gross-63/+354
Currently the macro always provides `CFn`, `RustFn`, `RustArgs`, etc. Change this so that: 1. This information must be explicily requested in the invocation. 2. There is a new `FTy` field available that emits a single float type, rather than a tuple or signature. Additionally, add two new macros that create enums representing function names.
2024-11-02Fix clippy lints in `crates/` and enable this on CITrevor Gross-12/+31
2024-11-02Resolve clippy errors in `libm` tests and check this in CITrevor Gross-83/+65
2024-11-02Rollup merge of #132495 - Houtamelo:remove_unintended_link, r=jieyouxuMatthias Krüger-1/+1
Remove unintended link Since `#[link_section]` is enclosed in braces, it was being confused with a link during docs compilation. This caused compilation to fail when running `x dist` since it emitted a warning regarding broken links.
2024-11-02Rollup merge of #132493 - Houtamelo:doc_type-ref_html-tag, r=jieyouxuMatthias Krüger-1/+1
Fix type reference in documents which was being confused with html tags. Running `x dist` was failing due to it invoking commands with `-D warnings`, which emitted a warning about unclosed html tags.
2024-11-02Rollup merge of #132482 - lukas-code:stab-attrs, r=NoratriebMatthias Krüger-4/+5
library: fix some stability annotations This PR updates some stability attributes to correctly reflect when some items actually got stabilized. Found while testing https://github.com/rust-lang/rust/pull/132481. ### `core::char` / `std::char` In https://github.com/rust-lang/rust/pull/26192, the `core::char` module got "stabilized" for 1.2.0, but the `core` crate itself was still unstable until 1.6.0. In https://github.com/rust-lang/rust/pull/49698, the `std::char` module was changed to a re-export of `core::char`, making `std::char` appear as "stable since 1.2.0", even though it was already stable in 1.0.0. By marking `core::char` as stable since 1.0.0, the docs will show correct versions for both `core::char` (since 1.6.0) and `std::char` (since 1.0.0). This is also consistent with the stabilities of similar re-exported modules like `core::mem`/`std::mem` for example. ### `{core,std}::array` and `{core,std}::array::TryFromSliceError` In https://github.com/rust-lang/rust/pull/58302, the `core::array::TryFromSliceError` type got stabilized for 1.34.0, together with `TryFrom`. At that point the `core::array` module was still unstable and a `std::array` re-export didn't exist, but `core::array::TryFromSliceError` could still be named due to https://github.com/rust-lang/rust/pull/95956 to existing yet. Then, `core::array` got stabilized and `std::array` got added, first targeting 1.36.0 in https://github.com/rust-lang/rust/pull/60657, but then getting backported for 1.35.0 in https://github.com/rust-lang/rust/pull/60838. This means that `core::array` and `std::array` actually got stabilized in 1.35.0 and `core::array::TryFromSliceError` was accessible through the unstable module in 1.34.0 -- mark them as such so that the docs display the correct versions.
2024-11-02remove const_hash feature leftoversRalf Jung-13/+5
2024-11-02const_with_hasher test: actually construct a usable HashMapRalf Jung-3/+24
2024-11-02make char::is_whitespace unstably constRalf Jung-3/+4
2024-11-02unicode_data.rs: show command for generating fileRalf Jung-1/+1
2024-11-02get rid of a whole bunch of unnecessary rustc_const_unstable attributesRalf Jung-100/+0
2024-11-02Rollup merge of #132398 - krtab:add_doc_link, r=NoratriebMatthias Krüger-5/+9
Add a couple of intra-doc links to str
2024-11-02Remove unintended linkHoutamelo-1/+1
Since `#[link_section]` is enclosed in braces, it was being confused with a link during docs compilation.
2024-11-02Fix type reference in documents which was being confused with html tags.Houtamelo-1/+1
2024-11-02fix some stability annotationsLukas Markeffsky-4/+5
2024-11-02Rollup merge of #132459 - RalfJung:byte_sub_ptr, r=scottmcmGuillaume Gomez-9/+66
feat(byte_sub_ptr): unstably add ptr::byte_sub_ptr 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 (https://github.com/rust-lang/rust/issues/95892). Original PR by ``@Gankra`` (https://github.com/rust-lang/rust/pull/121919), I am just reviving it. The 2nd commit (with a small docs tweak) is by me.