about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2024-11-08Mark feature with missing corresponding target feature cfgs as suchUrgau-0/+27
Computed by diffing of: $ rg "[ ]+@FEATURE: .*: \"(.*)\";" -r '$1' --no-filename \ crates/std_detect/src/detect/ | sort | uniq With (from the main Rust repo[^1]): $ rg "target_feature" tests/ui/check-cfg/well-known-values.stderr [^1]: https://github.com/rust-lang/rust/blob/e8c698bb3bdc121ac7f65919bd16d22f6567a3f1/tests/ui/check-cfg/well-known-values.stderr#L177
2024-11-08Add ability to declare a feature without cfg checkingUrgau-1/+5
This is necessary to avoid `unexpected_cfgs` warnings for unexpected/ missing target features, in user code.
2024-11-07Initialize channel `Block`s directly on the heapJosh Stone-4/+4
The channel's `Block::new` was causing a stack overflow because it held 32 item slots, instantiated on the stack before moving to `Box::new`. The 32x multiplier made modestly-large item sizes untenable. That block is now initialized directly on the heap. Fixes #102246
2024-11-07core: move intrinsics.rs into intrinsics folderRalf Jung-0/+0
2024-11-07Auto merge of #132714 - mati865:update-memchr, r=tgross35bors-7/+2
unpin and update memchr I'm unable to build x86_64-pc-windows-gnu Rust due to some weird binutils bug, but thinlto issue seems to be no longer present. Let's give it a go on the CI. Possibly fixed by https://github.com/rust-lang/rust/pull/129079 Fixes #127890
2024-11-07Rollup merge of #132715 - tabokie:fix-lazy-lock-doc, r=NoratriebJonas Böttiger-2/+2
fix `LazyLock::get` and `LazyLock::get_mut` document
2024-11-07Rollup merge of #132665 - tyilo:nonzero-u-div-ceil, r=joboetJonas Böttiger-0/+29
Implement `div_ceil` for `NonZero<unsigned>` ACP: https://github.com/rust-lang/libs-team/issues/471
2024-11-07Separate f128 `%` operation to deal with missing `fmodl` symbolRaoul Strackx-2/+20
2024-11-07Auto merge of #132705 - kornelski:inline-repeat, r=tgross35bors-0/+1
Inline str::repeat `str` is non-generic and `str.repeat()` doesn't get inlined, which makes it use a slower algorithm in case of 1-char repetitions. Equivalent byte slice does get inlined: https://rust.godbolt.org/z/4arvh97r4
2024-11-07fix lazylock commentXinye-2/+2
Signed-off-by: Xinye <xinye.tao@metabit-trading.com>
2024-11-07Auto merge of #131888 - ChrisDenton:deopt, r=ibraheemdevbors-57/+12
Revert using `HEAP` static in Windows alloc Fixes #131468 This does the minimum to remove the `HEAP` static that was causing chromium issues. It would be worth having a more substantial look at this module but for now I think this addresses the immediate issue. cc `@danakj`
2024-11-07unpin and update memchrMateusz Mikuła-7/+2
2024-11-06optimize char::to_digit and assert radix is at least 2Jacob Lifshay-13/+31
approved by t-libs: https://github.com/rust-lang/libs-team/issues/475#issuecomment-2457858458
2024-11-07ci: fix matrix usageDavid Wood-97/+105
2024-11-07ci: add debug testingDavid Wood-14/+19
Previous changes in Rust and LLVM have caused stdarch to be broken in debug, so add testing to ensure that this is caught.
2024-11-06Inline str::repeatKornel-0/+1
2024-11-07Rollup merge of #132617 - uellenberg:fix-rendered-doc, r=cuviperGuillaume Gomez-6/+4
Fix an extra newline in rendered std doc Fixes #132564 ![17308581942254367500907812250579](https://github.com/user-attachments/assets/9e946c49-c0a6-40ba-ab69-b80fe0e085e1) (taken from the issue above) The problem with the formatting is due to that newline between `<code>` and `<svg>`. Any newlines outside of the code (i.e., within elements inside of it) are fine.
2024-11-06Auto merge of #131721 - okaneco:const_eq_ignore_ascii_case, r=m-ou-sebors-3/+25
Add new unstable feature `const_eq_ignore_ascii_case` Tracking issue - #131719 Mark `[u8]`, `str` `eq_ignore_ascii_case` functions const --- The codegen for this implementation matches the existing `iter::zip` implementation better than incrementing with a counter while loop with counter - https://rust.godbolt.org/z/h9cs5zajc while let - https://rust.godbolt.org/z/ecMeMjjEb
2024-11-06Add `is_ascii` function optimized for x86-64 for [u8]okaneco-21/+69
The new `is_ascii` function is optimized to use the `pmovmskb` vector instruction which tests the high bit in a lane. This corresponds to the same check of whether a byte is ASCII so ASCII validity checking can be vectorized. This instruction does not exist on other platforms so it is likely to regress performance and is gated to all(target_arch = "x86_64", target_feature = "sse2"). Add codegen test Remove crate::mem import for functions included in the prelude
2024-11-06Auto merge of #132500 - RalfJung:char-is-whitespace-const, r=jhprattbors-3/+4
make char::is_whitespace unstably const I am adding this to the existing https://github.com/rust-lang/rust/issues/132241 feature gate, since `is_digit` and `is_whitespace` seem similar enough that one can group them together.
2024-11-05Add new implementation benchmarkokaneco-3/+42
Add LONG benchmarks for more comparison between the methods
2024-11-05Add new unstable feature `const_eq_ignore_ascii_case`okaneco-3/+25
Mark `[u8]`, `str` `eq_ignore_ascii_case` functions const
2024-11-06Auto merge of #132664 - matthiaskrgr:rollup-i27nr7i, r=matthiaskrgrbors-2/+3
Rollup of 5 pull requests Successful merges: - #131261 (Stabilize `UnsafeCell::from_mut`) - #131405 (bootstrap/codegen_ssa: ship llvm-strip and use it for -Cstrip) - #132077 (Add a new `wide-arithmetic` feature for WebAssembly) - #132562 (Remove the `wasm32-wasi` target from rustc) - #132660 (Remove unused errs.rs file) Failed merges: - #131721 (Add new unstable feature `const_eq_ignore_ascii_case`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-05Change some code blocks to quotes in rendered std docuellenberg-6/+4
Fixes #132564
2024-11-05Rollup merge of #131261 - clarfonthey:unsafe-cell-from-mut, r=m-ou-seMatthias Krüger-2/+3
Stabilize `UnsafeCell::from_mut` Closes #111645. FCP: https://github.com/rust-lang/rust/issues/111645#issuecomment-2393893003 Note that because `const_mut_refs` and `const_refs_to_cell` was stabilized, it's okay to const-stabilize this method as well.
2024-11-05Auto merge of #132661 - matthiaskrgr:rollup-npytbl6, r=matthiaskrgrbors-456/+478
Rollup of 8 pull requests Successful merges: - #132259 (rustc_codegen_llvm: Add a new 'pc' option to branch-protection) - #132409 (CI: switch 7 linux jobs to free runners) - #132498 (Suggest fixing typos and let bindings at the same time) - #132524 (chore(style): sync submodule exclusion list between tidy and rustfmt) - #132567 (Properly suggest `E::assoc` when we encounter `E::Variant::assoc`) - #132571 (add const_eval_select macro to reduce redundancy) - #132637 (Do not filter empty lint passes & re-do CTFE pass) - #132642 (Add documentation on `ast::Attribute`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-05Implement div_ceil for NonZero<unsigned>Asger Hautop Drewsen-0/+29
2024-11-05Rollup merge of #132571 - RalfJung:const_eval_select_macro, r=oli-obkMatthias Krüger-456/+478
add const_eval_select macro to reduce redundancy I played around a bit with a macro to make const_eval_select invocations look a bit nicer and avoid repeating the argument lists. Here's what I got. What do you think? I didn't apply this everywhere yet because I wanted to gather feedback first. The second commit moves the macros from https://github.com/rust-lang/rust/pull/132542 into a more sensible place. It didn't seem worth its own PR and would conflict with this PR if done separately. Cc ``@oli-obk`` ``@saethlin`` ``@tgross35`` try-job: dist-aarch64-msvc
2024-11-05Rollup merge of #132473 - ZhekaS:core_fmt_radix_no_panic, r=joboetJubilee-1/+4
[core/fmt] Replace checked slice indexing by unchecked to support panic-free code Fixes #126425 Replace the potentially panicking `[]` indexing with `get_unchecked()` to prevent linking with panic-related code.
2024-11-05Rollup merge of #132153 - bjoernager:const-char-encode-utf16, r=dtolnayJubilee-3/+5
Stabilise `const_char_encode_utf16`. Closes: #130660 This PR stabilises the `const_char_encode_utf16` feature gate (i.e. support for `char::encode_utf16` in constant expressions). ~~Note that the linked tracking issue is as of this writing currently awaiting FCP until 2024-11-02.~~
2024-11-05Disable `f16` on platforms that have recursion problemsTrevor Gross-20/+35
CI in [1] seems to indicate that there are cases where the `f16` infinite recursion bug ([2], [3]) can make its way into what gets called during tests, even though this doesn't seem to be the usual case. In order to make sure that we avoid these completely, just unset `f16_enabled` on any platforms that have the recursion problem. This also refactors the `match` statement to be more in line with `library/std/build.rs`. [1]: https://github.com/rust-lang/compiler-builtins/pull/729 [2]: https://github.com/llvm/llvm-project/issues/97981 [3]: https://github.com/rust-lang/compiler-builtins/issues/651
2024-11-05add const_eval_select macro to reduce redundancyRalf Jung-456/+478
also move internal const_panic helpers to a better location
2024-11-04Rollup merge of #132609 - NotWearingPants:patch-1, r=AmanieuJubilee-1/+1
docs: fix grammar in doc comment at unix/process.rs Fixed the grammar of a sentence in the docs
2024-11-04Rollup merge of #132606 - eduardosm:char-slice-str-pattern-doc, r=tgross35Jubilee-2/+2
Improve example of `impl Pattern for &[char]` The previous version used `['l', 'l']` as pattern, which would suggest that it matches the `ll` of `Hello world` as a whole.
2024-11-04most const intrinsics don't need an explicit rustc_const_unstable any moreRalf Jung-43/+35
2024-11-04add new rustc_const_stable_intrinsic attribute for const-stable intrinsicsRalf Jung-57/+57
2024-11-04convert all const-callable intrinsics into the new form (without extern block)Ralf Jung-968/+1110
2024-11-04docs: fix grammar in doc comment at unix/process.rsNotWearingPants-1/+1
2024-11-04Improve example of `impl Pattern for &[char]`Eduardo Sánchez Muñoz-2/+2
The previous version used `['l', 'l']` as pattern, which would suggest that it matches the `ll` of `Hello world` as a whole.
2024-11-04Add AsyncFn* to to the prelude in all editionsMichael Goulet-0/+3
2024-11-04Fixed typo, rebasedEugene Shamis-1/+1
2024-11-04Updated SAFETY comment to address underflowEugene Shamis-2/+3
2024-11-04Replace checked slice indexing by unchecked to support panic-free codeEugene Shamis-1/+3
Fixes #126425 Replace the potentially panicking `[]` indexing with `get_unchecked()` to prevent linking with panic-related code.
2024-11-04Rollup merge of #132579 - RalfJung:rustc-std-workspace-crates, r=AmanieuMatthias Krüger-0/+3
add rustc std workspace crate sources This adds the sources for the crates listed at https://crates.io/search?q=rustc-std-workspace in this repo. The first commit adds the original sources as downloaded from crates.io (with `Cargo.toml.orig` moved back over `Cargo.toml`), and adds a README explaining what this is about. The 2nd commit updates the sources to make the core and alloc crates re-exports of the "actual" core and alloc crates, as was already the case with `std`, and also adds a `repository` link to the manifest so one can figure out where to find these crates. I bumped the version for the core and alloc crates in the hope that the new versions can be published on crates.io shortly after this PR lands. See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/rustc-std-workspace-core.20crate.20is.20empty) for a bit more context. r? `@Amanieu`
2024-11-04btree: don't leak value if destructor of key panicsLukas Markeffsky-2/+64
2024-11-04Stabilise 'const_char_encode_utf16';Gabriel Bjørnager Jensen-3/+5
2024-11-04Auto merge of #132586 - workingjubilee:rollup-qrmn49a, r=workingjubileebors-931/+177
Rollup of 4 pull requests Successful merges: - #131222 (Generate correct symbols.o for sparc-unknown-none-elf) - #132423 (remove const-support for align_offset and is_aligned) - #132565 (Reduce dependence on the target name) - #132576 (remove attribute ids from hir stats (they're simply not needed)) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-04update rustc-std-workspace cratesRalf Jung-0/+3
- make rustc-std-workspace-core/alloc re-exports of their underlying crates, like std = cleanup manifests
2024-11-03Rollup merge of #132423 - RalfJung:const-eval-align-offset, r=dtolnayJubilee-931/+177
remove const-support for align_offset and is_aligned As part of the recent discussion to stabilize `ptr.is_null()` in const context, the general vibe was that it's okay for a const function to panic when the same operation would work at runtime (that's just a case of "dynamically detecting that something is not supported as a const operation"), but it is *not* okay for a const function to just return a different result. Following that, `is_aligned` and `is_aligned_to` have their const status revoked in this PR, since they do return actively wrong results at const time. In the future we can consider having a new intrinsic or so that can check whether a pointer is "guaranteed to be aligned", but the current implementation based on `align_offset` does not have the behavior we want. In fact `align_offset` itself behaves quite strangely in const, and that support needs a bunch of special hacks. That doesn't seem worth it. Instead, the users that can fall back to a different implementation should just use const_eval_select directly, and everything else should not be made const-callable. So this PR does exactly that, and entirely removes const support for align_offset. Closes some tracking issues by removing the associated features: Closes https://github.com/rust-lang/rust/issues/90962 Closes https://github.com/rust-lang/rust/issues/104203 Cc `@rust-lang/wg-const-eval` `@rust-lang/libs-api`
2024-11-04Auto merge of #132434 - tgross35:f128-tests, r=workingjubileebors-11/+16
Update `compiler-builtins` and enable f128 tests on all non-buggy platforms Update compiler_builtins to 0.1.138 and pin it. 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 that, we now provide symbols necessary to work with `f128` everywhere. This means that we are no longer restricted to systems that provide `f128` symbols themselves, and can enable tests by default. There are still a handful of platforms that need to remain disabled because of bugs and some that had to get updated. Math support is still off by default since those symbols are not yet available. [1]: https://github.com/rust-lang/compiler-builtins/pull/624 try-job: test-various try-job: i686-gnu-nopt