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 #126037

Merged
merged 35 commits into from
Jun 5, 2024
Merged

Rollup of 10 pull requests #126037

merged 35 commits into from
Jun 5, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

OliverKillane and others added 30 commits May 5, 2024 13:54
Technically, wiping bootstrap builds can increase the build time.
But in practice, trying to manually resolve post-bump issues and
even accidentally removing the entire build directory will result
in a much greater loss of time. After all, the bootstrap build process
is not a particularly lengthy operation.

Signed-off-by: onur-ozkan <[email protected]>
This is the counterpart of `Span::trim_start`.
This will allow the span extractor to produce multiple separate buckets,
instead of just one flat list of spans.
This is less elegant than returning an iterator, but more flexible.
…kets

This performs the same task as the hole-carving code in the main span refiner,
but in a separate earlier pass.
Now that hole spans are handled by a separate earlier pass, this code never
sees hole spans, and therefore doesn't need to deal with them.
on netbsd, procfs is not as central as on linux/solaris thus
can be perfectly not mounted.
Thus using fcntl with F_GETPATH, the kernel deals with MAXPATHLEN
internally too.
`ct_infer` and `lower_ty` will correctly result in an error constant or type respectively, as they go through a `HirTyLowerer` method (just like `HirTyLowerer::allow_infer` is a method implemented by both implementors
…n enum that exhaustively supports all call sites
…types-improvement, r=pnkfelix

`rustc --explain E0582` additional example

## Context
*From rust-lang#124744*

Expands the example for E0582, an error ensuring that lifetime in a function's return type is sufficiently constrained (e.g. actually tied to some input type), to show an additional example where one sees the lifetime occurring syntactically among the relevant function input types, but is nonetheless rejected by rustc because a syntactic occurrence is not always sufficient.
…elix

Detect when user is trying to create a lending `Iterator` and give a custom explanation

The scope for this diagnostic is to detect lending iterators specifically and it's main goal is to help beginners to understand that what they are trying to implement might not be possible for `Iterator` trait specifically.

I ended up to changing the wording from originally proposed in the ticket because it might be misleading otherwise: `Data` might have a lifetime parameter but it can be unrelated to items user is planning to return.

Fixes rust-lang#125337
Add intra-doc-links to rustc_middle crate-level docs.

Makes it slightly faster to find these modules, as you don't need to hunt for them in the big list.
…and, r=lcnr

Don't drop `Unsize` candidate in intercrate mode

Fixes rust-lang#125767
Various `HirTyLowerer` cleanups

Previously there was some ad-hoc specialization going on, because you could call `allows_infer`, which basically was deciding between whether the trait object was backed by `FnCtxt` or by `ItemCtxt`. I moved all the different logic into dedicated methods on `HirTyLowerer` and removed `allows_infer`

best reviewed commit-by-commit
…ichaelwoerister

rustc_codegen_ssa: fix `get_rpath_relative_to_output` panic when lib only contains file name

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->

When compiles program with `-C rpath=yes` but with no output filename specified, or with filename ONLY, we will get an ICE for now. Fix it by treat empty `output` path in `get_rpath_relative_to_output`  as current dir.

Before this patch:

```bash
rustc -C prefer_dynamic=yes -C rpath=yes -O h.rs  # ICE, no output filename specified
rustc -o hello -C prefer_dynamic=yes -C rpath=yes -O h.rs # ICE, output filename has no path
rustc -o ./hello -C prefer_dynamic=yes -C rpath=yes -O h.rs # Works
```

All those examples work after the patch.

Close rust-lang#119571.
Close rust-lang#125785.
…bertlarsan68

delete bootstrap build before switching to bumped rustc

Technically, wiping bootstrap builds can increase the build time. But in practice, trying to manually resolve post-bump issues and even accidentally removing the entire build directory will result in a much greater loss of time. After all, the bootstrap build process is not a particularly lengthy operation.

Workaround for rust-lang#125578
coverage: Carve out hole spans in a separate early pass

When extracting spans from MIR for use in coverage instrumentation, we sometimes need to identify *hole spans* (currently just closures), and carve up the other spans so that they don't overlap with holes.

This PR simplifies the main coverage-span-refiner by extracting the hole-carving process into a separate early pass. That pass produces a series of independent buckets, and we run the span-refiner on each bucket separately.

There is almost no difference in the resulting mappings, other than in some edge cases involving macros.
…r=cuviper

std::unix::fs::get_path: using fcntl codepath for netbsd instead.

on netbsd, procfs is not as central as on linux/solaris thus can be perfectly not mounted.
Thus using fcntl with F_GETPATH, the kernel deals with MAXPATHLEN internally too.
…=compiler-errors

set `has_unconstrained_ty_var` when generalizing aliases in bivariant contexts

this previously prevented the `regression-31157` benchmark from building

r? `@compiler-errors`
@rustbot rustbot added O-unix Operating system: Unix-like 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jun 5, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=10

@bors
Copy link
Contributor

bors commented Jun 5, 2024

📌 Commit dd2e1a3 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 Jun 5, 2024
@bors
Copy link
Contributor

bors commented Jun 5, 2024

⌛ Testing commit dd2e1a3 with merge 7ebd2bd...

@bors
Copy link
Contributor

bors commented Jun 5, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 7ebd2bd to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 5, 2024
@bors bors merged commit 7ebd2bd into rust-lang:master Jun 5, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone Jun 5, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#124746 rustc --explain E0582 additional example 73642e2b7a0e9a10ba540b912f4cfce05a4c8307 (link)
#125407 Detect when user is trying to create a lending Iterator a… 752dc56f4a6d6778546bdbcd7a765380a8784103 (link)
#125505 Add intra-doc-links to rustc_middle crate-level docs. 39c3a53961275bc7b4484b57baaca6f5755fc8a1 (link)
#125792 Don't drop Unsize candidate in intercrate mode ac65e3ce311e43cdc428ca9e01840dedcb8b1625 (link)
#125819 Various HirTyLowerer cleanups 80f72788f34a7cbee394c16de58d1dfff48fda92 (link)
#125861 rustc_codegen_ssa: fix get_rpath_relative_to_output panic… 1032944341551b52efe69969c603d9e49fb2fbfb (link)
#125911 delete bootstrap build before switching to bumped rustc fedb7add061c37a6f496ad7e0ff9ef6d136e2a9b (link)
#125921 coverage: Carve out hole spans in a separate early pass 2c511809a4077fdc742af2bdea5e190f0d6f0646 (link)
#125940 std::unix::fs::get_path: using fcntl codepath for netbsd in… a02a49d069ec9e3d5325b92faa36d4cc05519a19 (link)
#126022 set has_unconstrained_ty_var when generalizing aliases in… 3a8455fa7f6c82622adb9b6cc1ef139f078e9742 (link)

previous master: c1dba09f26

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 (7ebd2bd): 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 1.8%, secondary 2.3%)

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

Cycles

Results (primary 1.2%)

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

Binary size

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

Bootstrap: 670.626s -> 666.821s (-0.57%)
Artifact size: 319.00 MiB -> 319.02 MiB (0.01%)

@matthiaskrgr matthiaskrgr deleted the rollup-7pz1nhr branch September 1, 2024 17:35
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. O-unix Operating system: Unix-like 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.