Skip to content

Rollup of 9 pull requests #131887

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 23 commits into from
Oct 18, 2024
Merged

Rollup of 9 pull requests #131887

merged 23 commits into from
Oct 18, 2024

Conversation

jieyouxu
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

jfrimmel and others added 23 commits October 15, 2024 12:22
This commit introduces a minimal `![no_core]`-test case running on AVR,
that contains the MCWE mentioned in [129301]. The test case itself does
not have any assertions yet, but it shows the minimal set an language
items necessary within the test case.

[129301]: rust-lang#129301 (comment)
The issue was, that the disassembled label was placed one instruction
further down than expected. Therefore the test annotations check, that
the label is placed above the loop-contents (writing the one value, then
writing the other one).
Since the `tests/assembly` use `emit=asm`, the issue is not observable
as reported in the linked issue. Therefore the existing test case is
converted and a simple `rmake`-test is added. The test only checks, if
the correct `rjmp`-offset is used.
The new `rmake`-content asserts the exact assembly sequence for the loop
preventing false-negatives if some instructions would change and thus
the label offset might need to change.
This fixes the [build error] caused by the `avr-gcc` (used as linker)
not being available in the Rust CI. This is a viable solution, which
shows the wrong/right behavior and, since no functions from `libgcc` are
called, does not produce errors. This was discussed [here]. Another
small problem is, that `lld` doesn't link the correct startup-code by
default. This is not a problem for this test (since it does not actually
use anything the startup code is needed for (no variables, no stack, no
interrupts)), but this causes the `main`-function to be removed by the
default flag `--gc-sections`. Therefore the `rmake`-driver also adds the
linker flag `--entry=main` to mark the `main`-function as the entry
point and thus preventing it from getting removed. The code would work
on a real AVR device.

[build error]: rust-lang#131755 (comment)
[here]: rust-lang#131755 (comment)
After rust/rust-lang#106943 the part about `ExactSizeIterator` is no longer valid
By using qualified imports, i.e. `$crate::...::LocalKey`.
The context for this is rust-lang#130266: setting the medium code model for the
'loongarch64-linux-ohos' target.
Partially stabilize const_pin

Tracking issue rust-lang#76654.

Eight of these methods can be made const-stable. The remainder are blocked on rust-lang#73255.
…n-test, r=jieyouxu

Regression test for AVR `rjmp` offset

This adds a regression test for rust-lang#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](rust-lang#131755 (comment)) [below](rust-lang#131755 (comment)).
Closes rust-lang#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 rust-lang#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
…joboet

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 rust-lang/libc#3975).
…=Zalathar

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 rust-lang#131190
…pratt

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.
…s-not-that-special-anymore, r=jhpratt

Remove outdated documentation for `repeat_n`

After rust-lang#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
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 rust-lang#131863.
Default to the medium code model on OpenHarmony LoongArch target

The context for this is rust-lang#130266: setting the medium code model for the `loongarch64-linux-ohos` target.

r? ```@jieyouxu```
…isDenton

checktools.sh: add link to issue for more context about disabled Miri tests

Adds some context for the changes made in rust-lang#130072.
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Oct 18, 2024
@jieyouxu
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Oct 18, 2024

📌 Commit 80a8f7b has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 18, 2024
@bors
Copy link
Collaborator

bors commented Oct 18, 2024

⌛ Testing commit 80a8f7b with merge 1350eea...

@bors
Copy link
Collaborator

bors commented Oct 18, 2024

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing 1350eea to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 18, 2024
@bors bors merged commit 1350eea into rust-lang:master Oct 18, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 18, 2024
@jieyouxu jieyouxu deleted the rollup-ftik4ni branch October 18, 2024 13:40
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#130136 Partially stabilize const_pin 9415a3d9179ae8b7538287d2828032ff919140c8 (link)
#131755 Regression test for AVR rjmp offset d64a68fc70126ec5d18b3b6e7f64e3fda4db758d (link)
#131774 Add getentropy for RTEMS 441a2c6772493224c71f7bac011cb0346cd9cb4f (link)
#131802 Dont ICE when computing coverage of synthetic async closure… 19fdbc460e87e7dc001c85abe2fbd42b705ad4ee (link)
#131809 Fix predicate signatures in retain_mut docs 5ea222202b3b230b21ff73f215dd86c69b9f5e12 (link)
#131858 Remove outdated documentation for repeat_n 34c2c38ac831a1bcdcdf747a83a83c26f69e206b (link)
#131866 Avoid use imports in thread_local_inner! adf5d4a111c7b00b05265fc2446d3b26cad0067a (link)
#131874 Default to the medium code model on OpenHarmony LoongArch t… fddeca9d393477ee0528dbaf49d9e7e8d99f2e2e (link)
#131877 checktools.sh: add link to issue for more context about dis… c58284735d32f59f356626c69d93449a8e6dbadc (link)

previous master: acfdb8dd1f

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1350eea): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 6.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
6.0% [6.0%, 6.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 6.0% [6.0%, 6.0%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 780.68s -> 782.585s (0.24%)
Artifact size: 333.76 MiB -> 333.84 MiB (0.02%)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.