Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #121549

Merged
merged 15 commits into from
Feb 24, 2024
Merged

Rollup of 7 pull requests #121549

merged 15 commits into from
Feb 24, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

estebank and others added 15 commits February 22, 2024 18:56
When given

```rust
trait Original {
    fn f() -> impl Fn();
}

trait Erased {
    fn f(&self) -> Box<dyn Fn()>;
}

impl<T: Original> Erased for T {
    fn f(&self) -> Box<dyn Fn()> {
        Box::new(<T as Original>::f())
    }
}
```

avoid suggestion to restrict the `Trait::{opaque}` type in a `where` clause:

```
error[E0310]: the associated type `<T as Original>::{opaque#0}` may not live long enough
  --> $DIR/missing-static-bound-from-impl.rs:11:9
   |
LL |         Box::new(<T as Original>::f())
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |         |
   |         the associated type `<T as Original>::{opaque#0}` must be valid for the static lifetime...
   |         ...so that the type `impl Fn()` will meet its required lifetime bounds
```

CC rust-lang#119773.
It makes the link easier to use in cases in which
the path of the page where it will be embedded is not
known beforehand such as when we generate impls
dynamically from `register_type_impls` method in
`main.js`

Earlier for local primitives we would generate a path
that was relative to the current page depth passed in `cx.current`
. e.g if the current page was `std::simd::prelude::Simd` the
generated path would be `../../primitive.<prim>.html`  After this
change the path will first take you to the the wesite root and add
the crate name. e.g. for `std::simd::prelude::Simd` the path now
will be `../../../std/primitive.<prim>.html`
… large move

Fixes:

    $ MAGIC_EXTRA_RUSTFLAGS=-Zmove-size-limit=4096 ./x test compiler/rustc_target
    error: moving 6216 bytes
      --> compiler/rustc_target/src/spec/base/apple/tests.rs:17:19
       |
    17 |     for target in all_sim_targets {
       |                   ^^^^^^^^^^^^^^^ value moved from here
       |
       = note: The current maximum size is 4096, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
       = note: `-D large-assignments` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(large_assignments)]`
…ompiler-errors

Account for RPITIT in E0310 explicit lifetime constraint suggestion

When given

```rust
trait Original {
    fn f() -> impl Fn();
}

trait Erased {
    fn f(&self) -> Box<dyn Fn()>;
}

impl<T: Original> Erased for T {
    fn f(&self) -> Box<dyn Fn()> {
        Box::new(<T as Original>::f())
    }
}
```

emit do not emit an invalid suggestion restricting the `Trait::{opaque}` type in a `where` clause:

```
error[E0310]: the associated type `<T as Original>::{opaque#0}` may not live long enough
  --> $DIR/missing-static-bound-from-impl.rs:11:9
   |
LL |         Box::new(<T as Original>::f())
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |         |
   |         the associated type `<T as Original>::{opaque#0}` must be valid for the static lifetime...
   |         ...so that the type `impl Fn()` will meet its required lifetime bounds
```

Partially address rust-lang#119773. Ideally we'd suggest modifying `Erased::f` instead.

r? `@compiler-errors`
…docs, r=notriddle

Rustdoc: include crate name in links for local primitives

Fixes rust-lang#121106.

This change makes links to primitives easier to use when the path of the page where they will be embedded is not known beforehand such as when we generate impls dynamically from the `register_type_impls` method in `main.js`, which is exactly what is happening in rust-lang#121106.

An example to show the effect of this change: earlier, if the current page in `cx.current` inside `primitive_link_fragment()` was `std::simd::prelude::Simd` the generated path would be `../../primitive.<prim>.html`. Now it would be `../../../std/primitive.<prim>.html` instead.

A side effect of the change is that local primitive links _everywhere_ will now contain the crate name, even outside of the dynamic situation mentioned above. I'm not sure if there are any major downsides of that other than making the links a bit longer. Ideally I wanted to restrict this behaviour change to only the dynamic cases. We could have achieved that by passing an additional bool arg to `primitive_link_fragment()`, but it felt awkward to do so. Any alternative suggestions are welcome.
…k, r=oli-obk

check that simd_insert/extract indices are in-bounds

Fixes rust-lang#77477
r? `@oli-obk`
…iler-errors

Ignore less tests in debug builds

Since rust-lang#120594 and rust-lang#120863, nearly all UB-detecting debug assertions get compiled out of code that is monomorphized by a crate built with debug assertions disabled.

Which means that if we default all our codegen tests to `-Cdebug-assertions=no`, most of them work just fine against a sysroot built with debug assertions.

I also tried to explain a bit better why some tests need to be skipped, for those that still need to be skipped.
compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid unnecessary large move

Fixes:

    $ MAGIC_EXTRA_RUSTFLAGS=-Zmove-size-limit=4096 ./x test compiler/rustc_target
    error: moving 6216 bytes
      --> compiler/rustc_target/src/spec/base/apple/tests.rs:17:19
       |
    17 |     for target in all_sim_targets {
       |                   ^^^^^^^^^^^^^^^ value moved from here
       |
       = note: The current maximum size is 4096, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
       = note: `-D large-assignments` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(large_assignments)]`

Part of rust-lang#83518

The goal is to enable the lint by default at one point. There are many cases where it needs to be allowed. But here we don't need to allow it. We can simply fix it.

I don't want to enable the lint in the file, because I don't want the "default size threshold for when a value is OK to move" to be duplicated in many places. We'll want the threshold in one central place once we enable it by default.
@rustbot rustbot added 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Feb 24, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Feb 24, 2024

📌 Commit ee23b78 has been approved by matthiaskrgr

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 Feb 24, 2024
@bors
Copy link
Contributor

bors commented Feb 24, 2024

⌛ Testing commit ee23b78 with merge 381d699...

@bors
Copy link
Contributor

bors commented Feb 24, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 381d699 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 24, 2024
@bors bors merged commit 381d699 into rust-lang:master Feb 24, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 24, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#121435 Account for RPITIT in E0310 explicit lifetime constraint su… b7bed88909ec58d7100821f5efdf00d6de5a7469 (link)
#121490 Rustdoc: include crate name in links for local primitives 0c5f4386a5e5868b1d0a012faf848386d35950e1 (link)
#121520 delay cloning of iterator items fe935d1b8ef6f01480a7c85a6b405ea3955524a7 (link)
#121522 check that simd_insert/extract indices are in-bounds 1e843a6961e0f786f5891d120d54b21ce31c8fcc (link)
#121531 Ignore less tests in debug builds 9e3e2edd069ef3b4d834c85234f2d172c827dcec (link)
#121539 compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid u… bf72bb74bf09ea9db8568afa065a9165d8fc42de (link)
#121542 update stdarch 7ed82dbe59fe003aefc7738328ecfc997e70b2a7 (link)

previous master: 6bdb8a4a96

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 (381d699): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

Max RSS (memory usage)

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

Cycles

Results

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.9% [-2.9%, -2.9%] 1

Binary size

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

Bootstrap: 649.823s -> 649.328s (-0.08%)
Artifact size: 311.02 MiB -> 311.03 MiB (0.00%)

@jackh726
Copy link
Member

jackh726 commented Mar 2, 2024

@rust-timer build fe935d1

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fe935d1): comparison URL.

Overall result: ✅ improvements - no action needed

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.2%] 3
All ❌✅ (primary) -2.6% [-2.6%, -2.6%] 1

Max RSS (memory usage)

Results

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.9% [-4.1%, -1.8%] 2
Improvements ✅
(secondary)
-4.0% [-4.0%, -4.0%] 1
All ❌✅ (primary) -2.9% [-4.1%, -1.8%] 2

Cycles

Results

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.4% [-2.4%, -2.4%] 1
Improvements ✅
(secondary)
-3.6% [-4.0%, -3.3%] 3
All ❌✅ (primary) -2.4% [-2.4%, -2.4%] 1

Binary size

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

Bootstrap: 649.823s -> 650.833s (0.16%)
Artifact size: 311.02 MiB -> 311.01 MiB (-0.00%)

@matthiaskrgr matthiaskrgr deleted the rollup-1hvu3lb branch March 16, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants