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

Merged
merged 18 commits into from
Mar 24, 2024
Merged

Rollup of 7 pull requests #122980

merged 18 commits into from
Mar 24, 2024

Conversation

workingjubilee
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

veera-sivarajan and others added 18 commits March 3, 2024 09:24
- Implement current_exe()
- Cache device_path_to_text protocol

Signed-off-by: Ayush Singh <[email protected]>
This target is a Tier 3 target so it's not tested on CI, and it's broken
since last used so this commit fixes a small unwind-related issue that
cropped up in the meantime.
Current `transform_ty` attempts to avoid cycles when normalizing
`#[repr(transparent)]` types to their interior, but runs afoul of this
pattern used in `self_cell`:

```
struct X<T> {
  x: u8,
  p: PhantomData<T>,
}

 #[repr(transparent)]
struct Y(X<Y>);
```

When attempting to normalize Y, it will still cycle indefinitely. By
using a types-visited list, this will instead get expanded exactly
one layer deep to X<Y>, and then stop, not attempting to normalize `Y`
any further.
We already use `Instance` at declaration sites when available to glean
additional information about possible abstractions of the type in use.
This does the same when possible at callsites as well.

The primary purpose of this change is to allow CFI to alter how it
generates type information for indirect calls through `Virtual`
instances.
Additional trait bounds beyond the principal trait and its implications
are not possible in the vtable. This means that if a receiver is
`&dyn Foo + Send`, the function will only be expecting `&dyn Foo`.

This strips those auto traits off before CFI encoding.
Rather than `.into_iter().rev().find_position(...)`, this case can
simply call `.iter().rposition(...)`.
…ishop,workingjubilee

Expand sys/os for UEFI

- Implement current_exe() and getcwd()
…mease

Mention Register Size in `#[warn(asm_sub_register)]`

Fixes rust-lang#121593

Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
…rkingjubilee

fix typo of endianness

fix typo
endianess -> endianness
…=Mark-Simulacrum

Fix compile of wasm64-unknown-unknown target

This target is a Tier 3 target so it's not tested on CI, and it's broken since last used so this commit fixes a small unwind-related issue that cropped up in the meantime.
…, r=workingjubilee

CFI: Support self_cell-like recursion

Current `transform_ty` attempts to avoid cycles when normalizing `#[repr(transparent)]` types to their interior, but runs afoul of this pattern used in `self_cell`:

```
struct X<T> {
  x: u8,
  p: PhantomData<T>,
}

 #[repr(transparent)]
struct Y(X<Y>);
```

When attempting to normalize Y, it will still cycle indefinitely. By using a types-visited list, this will instead get expanded exactly one layer deep to X<Y>, and then stop, not attempting to normalize `Y` any further.

This PR was split off from rust-lang#121962 as part of fixing the larger vtable compatibility issues.

r? ``````@workingjubilee``````
…ngjubilee

CFI: Strip auto traits off Virtual calls

We already use `Instance` at declaration sites when available to glean additional information about possible abstractions of the type in use. This does the same when possible at callsites as well.

The primary purpose of this change is to allow CFI to alter how it generates type information for indirect calls through `Virtual` instances.

This is needed for the "separate machinery" version of my approach to the vtable issues (rust-lang#122573), because we need to respond differently to a `Virtual` call to the same type as a non-virtual call, specifically [stripping auto traits off the receiver's `Self`](rust-lang@54b15b0) because there isn't a separate vtable for `Foo` vs `Foo + Send`.

This would also make a more general underlying mechanism that could be used by rcvalle's [proposed drop detection / encoding](rust-lang@edcd1e2) if we end up using his approach, as we could condition out on the `def_id` in the CFI code rather than requiring the generating code to explicitly note whether it was calling drop.
…hewjasper

Simplify an iterator search in borrowck diag

Rather than `.into_iter().rev().find_position(...)`, this case can
simply call `.iter().rposition(...)`.
@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations 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. rollup A PR which is a rollup labels Mar 24, 2024
@workingjubilee
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Mar 24, 2024

📌 Commit c94d229 has been approved by workingjubilee

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

bors commented Mar 24, 2024

⌛ Testing commit c94d229 with merge 4a52e9c...

@bors
Copy link
Contributor

bors commented Mar 24, 2024

☀️ Test successful - checks-actions
Approved by: workingjubilee
Pushing 4a52e9c to master...

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#120419 Expand sys/os for UEFI 44ddd0f2c0b59a94189701c1bfd0317c3e5ed0c0 (link)
#121940 Mention Register Size in #[warn(asm_sub_register)] 72c14e3d9e6118c9240349a1ba66ba8b573ba9d4 (link)
#122762 fix typo of endianness a0a454e40a5b3f086a64623ae45e01441b80e9bc (link)
#122797 Fix compile of wasm64-unknown-unknown target c77c0d032e3ad2b39b5f99ce4fc58ff7130e81f3 (link)
#122875 CFI: Support self_cell-like recursion d5e7899d652f0a3f5c391b5f12db914d7e92ff86 (link)
#122879 CFI: Strip auto traits off Virtual calls b143c5d96cbfdd232d2f4393859b75f391fe239d (link)
#122969 Simplify an iterator search in borrowck diag 4a56487ae2ab8f4afe277dd52688d47efe7b8a35 (link)

previous master: 548e14b439

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 (4a52e9c): 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)

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

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: 669.812s -> 669.922s (0.02%)
Artifact size: 315.05 MiB -> 315.00 MiB (-0.01%)

@workingjubilee workingjubilee deleted the rollup-r5i1rke branch March 24, 2024 20:15
RenjiSann pushed a commit to RenjiSann/rust that referenced this pull request Mar 25, 2024
…kingjubilee

Rollup of 7 pull requests

Successful merges:

 - rust-lang#120419 (Expand sys/os for UEFI)
 - rust-lang#121940 (Mention Register Size in `#[warn(asm_sub_register)]`)
 - rust-lang#122762 (fix typo of endianness)
 - rust-lang#122797 (Fix compile of wasm64-unknown-unknown target)
 - rust-lang#122875 (CFI: Support self_cell-like recursion)
 - rust-lang#122879 (CFI: Strip auto traits off Virtual calls)
 - rust-lang#122969 (Simplify an iterator search in borrowck diag)

r? `@ghost`
`@rustbot` modify labels: rollup
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. PG-exploit-mitigations Project group: Exploit mitigations 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants