about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-10-18Rollup merge of #131866 - jieyouxu:thread_local, r=jhpratt许杰友 Jieyou Xu (Joe)-22/+49
Avoid use imports in `thread_local_inner!` Previously, the use imports in `thread_local_inner!` can shadow user-provided types or type aliases of the names `Storage`, `EagerStorage`, `LocalStorage` and `LocalKey`. This PR fixes that by dropping the use imports and instead refer to the std-internal types via fully qualified paths. A basic test is added to ensure `thread_local!`s with static decls with type names that match the aforementioned std-internal type names can successfully compile. Fixes #131863.
2024-10-18Rollup merge of #131858 - ↵许杰友 Jieyou Xu (Joe)-3/+1
AnthonyMikh:AnthonyMikh/repeat_n-is-not-that-special-anymore, r=jhpratt Remove outdated documentation for `repeat_n` After #106943, which made `Take<Repeat<I>>` implement `ExactSizeIterator`, part of documentation about difference from `repeat(x).take(n)` is no longer valid. ````@rustbot```` labels: +A-docs, +A-iterators
2024-10-18Rollup merge of #131809 - collinoc:fix-retain-mut-docs, r=jhpratt许杰友 Jieyou Xu (Joe)-2/+2
Fix predicate signatures in retain_mut docs This is my first PR here so let me know if I'm doing anything wrong. The docs for `retain_mut` in `LinkedList` and `VecDeque` say the predicate takes `&e`, but it should be `&mut e` to match the actual signature. `Vec` [has it documented](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.retain_mut) correctly already.
2024-10-18Rollup merge of #131802 - compiler-errors:fnonce-coverage, r=Zalathar许杰友 Jieyou Xu (Joe)-19/+102
Dont ICE when computing coverage of synthetic async closure body I'm not totally certain if this is *right*, but at least it doesn't ICE. The issue is that we end up generating two MIR bodies for each async closure, since the `FnOnce` and `Fn`/`FnMut` implementations have different borrowing behavior of their captured variables. They should ideally both contribute to the coverage, since those MIR bodies are (*to the user*) the same code and should have no behavioral differences. This PR at least suppresses the ICEs, and then I guess worst case we can fix this the right way later. r? Zalathar or re-roll Fixes #131190
2024-10-18Rollup merge of #131774 - thesummer:rtems-add-getentropy, r=joboet许杰友 Jieyou Xu (Joe)-0/+4
Add getentropy for RTEMS RTEMS provides the `getentropy` function. Use this for providing random data. This PR enables the `getentropy` function for the RTEMS operating system to get random data. It is exposed via libc (see https://github.com/rust-lang/libc/pull/3975).
2024-10-18Rollup merge of #131755 - jfrimmel:avr-rjmp-offset-regression-test, r=jieyouxu许杰友 Jieyou Xu (Joe)-0/+107
Regression test for AVR `rjmp` offset This adds a regression test for #129301 by minimizing the code in the linked issue and putting it into a `#![no_core]`-compatible format, so that it can easily be used within an `rmake`-test. This needs to be a `rmake` test (opposed to a `tests/assembly` one), since the linked issue describes, that the problem only occurs if the code is directly compiled. Note, that `lld` is used instead of `avr-gcc`; see the [comments](https://github.com/rust-lang/rust/pull/131755#issuecomment-2416469675) [below](https://github.com/rust-lang/rust/pull/131755#issuecomment-2417160045). Closes #129301. To show, that the test actually catches the wrong behavior, this can be tested with a faulty rustc: ```bash $ rustup install nightly-2024-08-19 $ rustc +nightly-2024-08-19 -C opt-level=s -C panic=abort --target avr-unknown-gnu-atmega328 -Clinker=build/x86_64-unknown-linux-gnu/ci-llvm/bin/lld -Clink-arg='--entry=main' -o compiled tests/run-make/avr-rjmp-offset/avr-rjmp-offsets.rs $ llvm-objdump -d compiled | grep '<main>' -A 6 000110b4 <main>: 110b4: 81 e0 ldi r24, 0x1 110b6: 92 e0 ldi r25, 0x2 110b8: 85 b9 out 0x5, r24 110ba: 95 b9 out 0x5, r25 110bc: fe cf rjmp .-4 ``` One can see, that the wrong label offset (`4` instead of `6`) is produced, which would trigger an assertion in the test case. This would be a good candidate for using the `minicore` proposed in #130693. Since this is not yet merged, there is a FIXME. r? Patryk27 I think, you are the yet-to-be official target maintainer, hence I'll assign to you. `@rustbot` label +O-AVR
2024-10-18Rollup merge of #130136 - GKFX:stabilize-const-pin, r=dtolnay许杰友 Jieyou Xu (Joe)-13/+16
Partially stabilize const_pin Tracking issue #76654. Eight of these methods can be made const-stable. The remainder are blocked on #73255.
2024-10-18Dont ICE when computing coverage of synthetic async closure bodyMichael Goulet-19/+102
2024-10-18Add entropy source for RTEMSJan Sommer-0/+4
2024-10-18Auto merge of #131869 - matthiaskrgr:rollup-xrkz174, r=matthiaskrgrbors-121/+738
Rollup of 5 pull requests Successful merges: - #131654 (Various fixes for Xous) - #131743 (rustc_metadata: minor tidying) - #131823 (Bump libc to 0.2.161) - #131850 (Missing parenthesis) - #131857 (Allow dropping dyn principal) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-18Rollup merge of #131857 - WaffleLapkin:dyn-drop-principal-3, r=compiler-errorsMatthias Krüger-35/+167
Allow dropping dyn principal Revival of #126660, which was a revival of #114679. Fixes #126313. Allows dropping principal when coercing trait objects, e.g. `dyn Debug + Send` -> `dyn Send`. cc `@compiler-errors` `@Jules-Bertholet` r? `@lcnr`
2024-10-18Rollup merge of #131850 - lexeyOK:master, r=compiler-errorsMatthias Krüger-1/+1
Missing parenthesis the line was missing closing parenthesis
2024-10-18Rollup merge of #131823 - thesummer:bump-libc-0.2.160, r=workingjubileeMatthias Krüger-3/+3
Bump libc to 0.2.161 Bumps libc to the latest release version 0.2.161 which - includes libc support for the tier 3 RTEMS target - fixes segfaults on 32-bit FreeBSD targets - gets musl's `posix_spawn_file_actions_addchdir_np` for some spawn opts
2024-10-18Rollup merge of #131743 - tamird:find_commandline_library-tidy, r=lcnrMatthias Krüger-42/+49
rustc_metadata: minor tidying Cleaned up some code while investigating #131720. See individual commits.
2024-10-18Rollup merge of #131654 - betrusted-io:xous-various-fixes, r=thomccMatthias Krüger-40/+518
Various fixes for Xous This patchset includes several fixes for Xous that have crept in over the last few months: * The `adjust_process()` syscall was incorrect * Warnings have started appearing in `alloc` -- adopt the same approach as wasm, until wasm figures out a workaround * Dead code warnings have appeared in the networking code. Add `allow(dead_code)` as these structs are used as IPC values * Add support for `args` and `env`, which have been useful for running tests * Update `unwinding` to `0.2.3` which fixes the recent regression due to changes in `asm!()` code
2024-10-18Avoid shadowing user provided types or type aliases in `thread_local!`许杰友 Jieyou Xu (Joe)-22/+49
By using qualified imports, i.e. `$crate::...::LocalKey`.
2024-10-18remove outdated documentation for `repeat_n`AnthonyMikh-3/+1
After rust/#106943 the part about `ExactSizeIterator` is no longer valid
2024-10-18Add more testsJules Bertholet-1/+85
2024-10-17Auto merge of #131572 - cuviper:ub-index_range, r=thomccbors-4/+12
Avoid superfluous UB checks in `IndexRange` `IndexRange::len` is justified as an overall invariant, and `take_prefix` and `take_suffix` are justified by local branch conditions. A few more UB-checked calls remain in cases that are only supported locally by `debug_assert!`, which won't do anything in distributed builds, so those UB checks may still be useful. We generally expect core's `#![rustc_preserve_ub_checks]` to optimize away in user's release builds, but the mere presence of that extra code can sometimes inhibit optimization, as seen in #131563.
2024-10-17Bump libc to 0.2.161Jan Sommer-4/+4
2024-10-18Missing parenthesis lexx-1/+1
the line was missing closing parenthesis
2024-10-17Auto merge of #131848 - matthiaskrgr:rollup-l29a75j, r=matthiaskrgrbors-10/+157
Rollup of 7 pull requests Successful merges: - #129620 (Provide a more convinient way of developing rustc on NixOS) - #131805 (rustc_llvm: Fix flattened CLI args) - #131818 (Enable XRay instrumentation for LoongArch Linux targets) - #131825 (SolverDelegate add assoc type for Infcx) - #131833 (Add `must_use` to `CommandExt::exec`) - #131835 (Do not run test where it cannot run) - #131844 (Add mailmap entry for kobzol) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-17Rollup merge of #131844 - Kobzol:mailmap-kobzol, r=jieyouxuMatthias Krüger-0/+1
Add mailmap entry for kobzol Hopefully I got this right.
2024-10-17Rollup merge of #131835 - ferrocene:amanjeev/add-missing-attribute-unwind, ↵Matthias Krüger-0/+1
r=Noratrieb Do not run test where it cannot run This was seen on Ferrocene, where we have a custom test target that does not have unwind support
2024-10-17Rollup merge of #131833 - c-ryan747:patch-1, r=NoratriebMatthias Krüger-4/+5
Add `must_use` to `CommandExt::exec` [CommandExt::exec](https://fburl.com/0qhpo7nu) returns a `std::io::Error` in the case exec fails, but its not currently marked as `must_use` making it easy to accidentally ignore it. This PR adds the `must_use` attributed here as i think it fits the definition in the guide of [When to add #[must_use]](https://std-dev-guide.rust-lang.org/policy/must-use.html#when-to-add-must_use)
2024-10-17Rollup merge of #131825 - lcnr:probe-no-more-leak-2, r=compiler-errorsMatthias Krüger-3/+3
SolverDelegate add assoc type for Infcx makes writing trait bounds on it a lot nicer going forward. r? `@compiler-errors`
2024-10-17Rollup merge of #131818 - heiher:loong-instrument-xray, r=jieyouxuMatthias Krüger-0/+3
Enable XRay instrumentation for LoongArch Linux targets Enable XRay instrumentation for `loongarch64-unknown-linux-{gnu, musl, ohos}` targets.
2024-10-17Rollup merge of #131805 - aeubanks:flat, r=durin42Matthias Krüger-3/+3
rustc_llvm: Fix flattened CLI args Fixes string manipulation errors introduced in #130446.
2024-10-17Rollup merge of #129620 - WaffleLapkin:flake, r=NoratriebMatthias Krüger-0/+141
Provide a more convinient way of developing rustc on NixOS This PR adds envrc files which, once symlinked as `.envrc` will activates a dev shell from `src/tools/nix-dev-shell/flake.nix` or `src/tools/nix-dev-shell/shell.nix`. This is based on - [Current rustc dev guide recommendation for NixOS](https://rustc-dev-guide.rust-lang.org/building/suggested.html?highlight=nix#using-nix-shell) - https://github.com/oxalica/rust-overlay?tab=readme-ov-file#use-in-devshell-for-nix-develop - [Nora's `x` nix package](https://github.com/Noratrieb/nixos/tree/26ea68e1a0aadaab313c1b5a8c1033a9770bd138/custom-pkgs/x) - https://github.com/rust-lang/rustup/pull/2891 - [Direnv: use flake/nix according to availability](https://discourse.nixos.org/t/direnv-use-flake-nix-according-to-availability/29825) This is something that I plan to use personally, but I thought it might be worth upstreaming :) r? Noratrieb
2024-10-17Allow dropping dyn principalMichael Goulet-35/+83
2024-10-17Add mailmap entry for kobzolJakub Beránek-0/+1
2024-10-17Auto merge of #130223 - LaihoE:faster_str_replace, r=thomccbors-2/+63
optimize str.replace Adds a fast path for str.replace for the ascii to ascii case. This allows for autovectorizing the code. Also should this instead be done with specialization? This way we could remove one branch. I think it is the kind of branch that is easy to predict though. Benchmark for the fast path (replace all "a" with "b" in the rust wikipedia article, using criterion) : | N | Speedup | Time New (ns) | Time Old (ns) | |----------|---------|---------------|---------------| | 2 | 2.03 | 13.567 | 27.576 | | 8 | 1.73 | 17.478 | 30.259 | | 11 | 2.46 | 18.296 | 45.055 | | 16 | 2.71 | 17.181 | 46.526 | | 37 | 4.43 | 18.526 | 81.997 | | 64 | 8.54 | 18.670 | 159.470 | | 200 | 9.82 | 29.634 | 291.010 | | 2000 | 24.34 | 81.114 | 1974.300 | | 20000 | 30.61 | 598.520 | 18318.000 | | 1000000 | 29.31 | 33458.000 | 980540.000 |
2024-10-17rustc_metadata: reduce repetitionTamir Duberstein-15/+29
2024-10-17Enable XRay instrumentation for LoongArch Linux targetsWANG Rui-0/+3
2024-10-17Auto merge of #131832 - lnicola:sync-from-ra, r=lnicolabors-1113/+2098
Subtree update of `rust-analyzer` r? `@ghost`
2024-10-17Do not run test where it cannot runAmanjeev Sethi-0/+1
This was seen on Ferrocene, where we have a custom test target that does not have unwind support
2024-10-17Fix must_use lint for command exec testsCallum Ryan-4/+4
2024-10-17Add must_use to CommandExt::execCallum Ryan-0/+1
2024-10-17Auto merge of #18317 - lnicola:sync-from-rust, r=Veykrilbors-14121/+22801
minor: sync from downstream
2024-10-17Bump rustc cratesLaurențiu Nicola-19/+20
2024-10-17Auto merge of #131827 - matthiaskrgr:rollup-umncb57, r=matthiaskrgrbors-565/+602
Rollup of 7 pull requests Successful merges: - #128391 (Change orphan hint from "only" to "any uncovered type inside...") - #131583 (Setting up indirect access to external data for loongarch64-linux-{musl,ohos}) - #131595 (rustdoc-JSON: Rename "object safe" to "dyn compatible") - #131748 (cleanup canonical queries) - #131798 (llvm: Tolerate propagated range metadata) - #131815 (compiler: use `is_none_or` where it is clearly better) - #131822 (extract `expr_assign_expected_bool_error`) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-17Rollup merge of #131822 - lcnr:typeck-error-reporting, r=jieyouxuMatthias Krüger-78/+84
extract `expr_assign_expected_bool_error` moving diagnostics code out of the happy path makes it a lot easier to read imo
2024-10-17Rollup merge of #131815 - workingjubilee:did-you-mean-is-none-or, r=jieyouxuMatthias Krüger-3/+3
compiler: use `is_none_or` where it is clearly better heuristic was: if it easily allows removing bangs entirely? worth it. if it requires more effort or just moves the bang? not.
2024-10-17Rollup merge of #131798 - maurer:range-inlining, r=durin42Matthias Krüger-1/+1
llvm: Tolerate propagated range metadata llvm/llvm-project#91101 propagates range information across inlining, resulting in more metadata in this test. Tolerate the range metadata if it appears. ``@rustbot:`` label +llvm-main r? ``@durin42`` Please wait a moment before approving, putting the llvm-main tag on it to make sure it fixes the integration test.
2024-10-17Rollup merge of #131748 - lcnr:typing-mode, r=compiler-errorsMatthias Krüger-261/+225
cleanup canonical queries best reviewed commit by commit. adding `CanonicalQueryInput` to stop returning `defining_opaque_types` in query responses is the most involved change here. r? ``@compiler-errors``
2024-10-17Rollup merge of #131595 - fmease:rustdoc-json-mv-obj-safe-dyn-compat, ↵Matthias Krüger-24/+27
r=aDotInTheVoid rustdoc-JSON: Rename "object safe" to "dyn compatible" ~~Blocked: Sits atop #131594. Only the last commit is relevant.~~ (rebased) Part of #130852. r? aDotInTheVoid or rustdoc
2024-10-17Rollup merge of #131583 - heiher:loong-issue-118053, r=jieyouxuMatthias Krüger-0/+2
Setting up indirect access to external data for loongarch64-linux-{musl,ohos} In issue #118053, the `loongarch64-unknown-linux-gnu` target needs indirection to access external data, and so do the `loongarch64-unknown-linux-musl` and `loongarch64-unknown-linux-ohos` targets.
2024-10-17Rollup merge of #128391 - cafce25:issue-128390, r=lcnrMatthias Krüger-198/+260
Change orphan hint from "only" to "any uncovered type inside..." Fix #128390
2024-10-17SolverDelegate add assoc type for Infcxlcnr-3/+3
2024-10-17extract `expr_assign_expected_bool_error`lcnr-78/+84