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 10 pull requests #114852

Merged
merged 23 commits into from
Aug 15, 2023
Merged

Rollup of 10 pull requests #114852

merged 23 commits into from
Aug 15, 2023

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

lqd and others added 23 commits August 10, 2023 20:35
This allows for better type safety in the compiler and also improves the
documentation for many things, making it clear that they expect modules.
Infer `Lld::No` linker hint when the linker stem is a generic compiler driver

This PR basically reverts the temporary solution in rust-lang#113631 to a more long-term solution.

r? ``@petrochenkov``

In [this comment](rust-lang#113631 (comment)), you had ideas about a long-term solution:

> I wonder what a good non-temporary solution for the inference would look like.
>
>     * If the default is `(Cc::No, Lld::Yes)` (e.g. `rust-lld`)
>
>       * and we switch to some specific platform compiler (e.g. `-C linker=arm-none-eabi-gcc`), should we change to `Lld::No`? Maybe yes?
>       * and we switch to some non-default but generic compiler `-C linker=clang`? Then maybe not?
>
>     * If the default is `(Cc::Yes, Lld::Yes)` (e.g. future x86_64 linux with default LLD)
>
>       * and we switch to some specific platform compiler (e.g. `-C linker=arm-none-eabi-gcc`), should we change to `Lld::No`? Maybe yes?
>       * and we switch to some non-default but generic compiler `-C linker=clang`? Then maybe not?
>

I believe that we should infer the `Lld::No` linker hint for any `-Clinker` override, and all the cases above:
- the linker drivers have their own defaults, so in my mind `-Clinker` is a signal to use its default linker / flavor, rather than ours or the target's. In the case of generic compilers, it's more likely than not going to be `Lld::No`. I would expect this to be the case in general, even when including platform-specific compilers.
- the guess will be wrong if the linker driver uses lld by default (and we also don't want to search for `-fuse-ld` link args), but will work in the more common cases. And the minority of other cases can fix the wrong guess by opting into the precise linker flavor.
- this also ensures backwards-compatibility: today, even on targets with an lld default and overriding the linker, rustc will not use lld. That includes `thumbv6m-none-eabi` where issue rust-lang#113597 happened.

It looks like the simplest option, and the one with least churn: we maintain the current behavior in ambiguous cases.

I've tested that this works on rust-lang#113597, as expected from the failure.

(I also have a no-std `run-make` test using a custom target json spec: basically simulating a future `x86_64-unknown-linux-gnu` using an lld flavor by default, to check that  e.g. `-Clinker=clang` doesn't use lld. I could add that test to this PR, but IIUC such a custom target requires `cargo -Z build-std` and we have no tests depending on this cargo feature yet. Let me know if you want to add this test of the linker inference for such targets.)

What do you think ?
…aber

Add `{Local}ModDefId` to more strongly type DefIds`

Based on rust-lang#110862 by `@Nilstrieb`
std: add some missing repr(transparent)

For some types we don't want to stably guarantee this, so hide the `repr` from rustdoc. This nice approach was suggested by `@thomcc.`
…compiler-errors

Add test for unknown_lints from another file.

This adds a test for rust-lang#84936 which was incidentally fixed via rust-lang#97266. It is a strange issue where `#![allow(unknown_lints)]` at the crate root was not applying to unknown lints that fired in a non-inline-module. I did not dig further into how rust-lang#97266 fixed it, but I did verify it. I couldn't find any existing tests which did anything similar.

Closes rust-lang#84936
Upgrade std to gimli 0.28.0

Gimli 0.28 removed its `From<EndianSlice> for &[u8]` that was the root cause of rust-lang#113238.

This dependency update mirrors rust-lang/backtrace-rs#557, but since that doesn't require any code changes in `backtrace`, we can also apply that right away for our nested `std/backtrace` feature.
…fe-candidates, r=lcnr

Only consider object candidates for object-safe dyn types in new solver

We apparently allow this per RFC2027 💀

r? lcnr
…upcasting, r=lcnr

Probe when assembling upcast candidates so they don't step on eachother's toes in new solver

Lack of a probe causes one candidate to disqualify the other due to inference side-effects.

r? lcnr
…nsize-to-dyn-once, r=lcnr

Separate `consider_unsize_to_dyn_candidate` from other unsize candidates

Move the unsize candidate assembly *just for* `T -> dyn Trait` out of `assemble_candidates_via_self_ty` so that we only consider it once, instead of for every normalization step of the self ty. This makes sure that we don't assemble several candidates that are equal modulo normalization when we really don't care about normalizing the self type of an `T: Unsize<dyn Trait>` goal anyways.

Fixes rust-lang/trait-system-refactor-initiative#57

r? lcnr
…s, r=petrochenkov

Clean up some bad UI testing annotations

These annotations do nothing 😅
…tion-subst-compat, r=lcnr

Check projection args before substitution in new solver

Don't ICE when an impl has the wrong kind of GAT arguments

r? lcnr
@rustbot rustbot added 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-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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative rollup A PR which is a rollup labels Aug 15, 2023
@GuillaumeGomez
Copy link
Member Author

@bors r+ rollup=never p=10

@bors
Copy link
Contributor

bors commented Aug 15, 2023

📌 Commit 31a4131 has been approved by GuillaumeGomez

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 Aug 15, 2023
@bors
Copy link
Contributor

bors commented Aug 15, 2023

⌛ Testing commit 31a4131 with merge d7c3c28d4619a4bbf97824564955dc72a9c59706...

@bors
Copy link
Contributor

bors commented Aug 15, 2023

💔 Test failed - checks-actions

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

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@GuillaumeGomez
Copy link
Member Author

@bors retry

@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 Aug 15, 2023
@bors
Copy link
Contributor

bors commented Aug 15, 2023

⌛ Testing commit 31a4131 with merge c57393e...

@bors
Copy link
Contributor

bors commented Aug 15, 2023

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing c57393e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 15, 2023
@bors bors merged commit c57393e into rust-lang:master Aug 15, 2023
12 checks passed
@GuillaumeGomez GuillaumeGomez deleted the rollup-vjagxjr branch August 15, 2023 18:25
@rustbot rustbot added this to the 1.73.0 milestone Aug 15, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#114711 Infer Lld::No linker hint when the linker stem is a gener… 74b28c833eeb3399a088111a9e61d6f4c4bf2510 (link)
#114772 Add {Local}ModDefId to more strongly type DefIds` 4191a49cff6e2af5b0793f1f4a0fe62f45a86517 (link)
#114800 std: add some missing repr(transparent) c09ab8347b75d81bd41ed7d0311ec4b7d51dbac2 (link)
#114820 Add test for unknown_lints from another file. 6e5f0e272c1398629606d735c13b68aee4ef6acd (link)
#114825 Upgrade std to gimli 0.28.0 5ce02a24472d82a1619f5143f8678a3c00c3768c (link)
#114827 Only consider object candidates for object-safe dyn types i… 399b0b784ba5c2391fce240edfa3d7a098a93491 (link)
#114828 Probe when assembling upcast candidates so they don't step … 23eca1b44e97b649d9fbc8c54a9ba92fb0694d84 (link)
#114829 Separate consider_unsize_to_dyn_candidate from other unsi… 588d224b4a854d9bfd15cefe5b1511579eb08927 (link)
#114830 Clean up some bad UI testing annotations d9fbec72b3bc1668ea072bcfb7994889d681aa16 (link)
#114831 Check projection args before substitution in new solver 9d9efba0cd3f7c81f21f841b0c5e7fb0fbcf2d2d (link)

previous master: 4f4dae055b

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

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.5% [0.5%, 0.6%] 4
Regressions ❌
(secondary)
1.0% [1.0%, 1.0%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) 0.5% [0.5%, 0.6%] 4

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.6% [-4.3%, -0.7%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.6% [-4.3%, -0.7%] 3

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

Binary size

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

Bootstrap: 632.472s -> 632.833s (0.06%)
Artifact size: 346.76 MiB -> 346.79 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Aug 15, 2023
@rylev
Copy link
Member

rylev commented Aug 22, 2023

This is the start of a big uptick in noise in the unicode-normalization benchmarks.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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-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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet