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

Merged
merged 17 commits into from
May 23, 2023
Merged

Rollup of 7 pull requests #111882

merged 17 commits into from
May 23, 2023

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

mrcnski and others added 17 commits May 18, 2023 08:44
Only updated `exploit-mitigations.md` to reflect that the option exists. Removed the alternatives
mentioned as they are not actually implemented yet.

As this is an unstable feature, should it be added to `unstable-book` also? I didn't do that because
I couldn't find the tracking issue for it. (There should be one to track stabilization of the
feature.)
…ith binary formats such as bincode or postcard
Fixes rust-lang#111515 and complements rust-lang#106547 by adding support for encoding
early bound regions and also excluding projections when transforming
trait objects' traits into their identities before emitting type checks.
…eVoid

[rustdoc][JSON] Use exclusively externally tagged enums in the JSON representation

See [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.28De.29serialization.20speed.20of.20JSON.20docs) and [this issue](rust-lang#93667) for the relevant context.
Pretty-print inherent projections correctly

Previously, we were trying to pretty-print inherent projections with `Printer::print_def_path` which is incorrect since
it expects the substitutions to be of a certain format (parents substs followed by own substs) which doesn't hold for
inherent projections (self type subst followed by own substs).
Now we print inherent projections manually.

Fixes rust-lang#111390.
Fixes rust-lang#111397.

Lacking tests! Is there a test suite / compiletest flags for the pretty-printer? In most if not all cases,
inherent projections are normalized away before they get the chance to appear in diagnostics.

If I were to create regression tests for linked issues, they would need to be `mir-opt` tests to exercise
`-Zdump-mir=all` (right?) which doesn't feel quite adequate to me.

`@rustbot` label F-inherent_associated_types
…alle

Document stack-protector option

Only updated `exploit-mitigations.md` to reflect that the option exists. Removed the alternatives mentioned as they are not actually implemented yet.

As this is an unstable feature, should it be added to `unstable-book` also? [Example](https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html). I didn't do that because I couldn't find the tracking issue for stack-protector. (There should be one to track stabilization of the feature, I think?)

cc `@rcvalle`
fix(resolve): not defined `extern crate shadow_name`

Fixes rust-lang#109148

## Why does rust-lang#109148 panic?

When resolving `use std::xx` it enters `visit_scopes` from `early_resolve_ident_in_lexical_scope`, and iters twice during the loop:

|iter| `scope` | `break_result` | result |
|-|-|-|-|
| 0 | `Module` pointed to root | binding pointed to `Undetermined`, so result is `None` | scope changed to `ExternPrelude` |
| 1 | `ExternPrelude` | binding pointed to `std` | - |

Then, the result of `maybe_resolve_path` is `Module(std)`, so `import.imported_module.set` is executed.

Finally, during the `finalize_import` of `use std::xx`, `resolve_path` returns `NonModule` because `Binding(Ident(std), Module(root)`'s binding points to `extern crate blah as std`, which causes the assertion to fail at `assert!(import.imported_module.get().is_none());`.

## Investigation

The question is why `#[a] extern crate blah as std` is not defined as a binding of `std::xxx`, which causes the iteration twice during `visit_scopes` when resolving `std::xxx`. Ideally, the value of `break_result.is_some()` should have been valid in the first iteration.

After debugging, I found that because `#[a] extern crate blah as std` had been dummied by `placeholder` during `collect_invocations`, so it had lost its attrs, span, etc..., so it will not be defined. However, `expand_invoc` added them back, then the next `build_reduced_graph`, `#[a] extern crate blah as std` would have been defined, so it makes the result of `resolved_path` unexpected, and the program panics.

## Try to solve

I think there has two-way to solve this issue:

- Expand invocations before the first `resolve_imports` during `fully_expand_fragment`. However, I do not think this is a good idea because it would mess up the current design.
- As my PR described: do not define to `extern crate blah as std` during the second `build_reduced_graph`, which is very easy and more reasonable.

r? `@petrochenkov`
Update books

## rust-embedded/book

1 commits in d9eb4c3f75435b008881062ffa77bf0d1527b37d..f2aed2fe8e9f55508c86ba3aa4b6789b18a08a22
2023-05-12 12:26:37 UTC to 2023-05-12 12:26:37 UTC

- Add link to Comprehensive Rust 🦀 (rust-embedded/book#354)

## rust-lang/nomicon

2 commits in b5f7500fc40775096c2bbd204eae096612cf9047..b5f018fb5930cb733b0a8aaf2eed975d4771e74d
2023-05-19 18:10:25 UTC to 2023-05-14 20:22:16 UTC

- Expand unbounded lifetime example code and improve wording (rust-lang/nomicon#408)
- Update to 2021 edition (rust-lang/nomicon#410)

## rust-lang/reference

5 commits in 28dc0f3576b55f5e57c5d6e65cd68ba3161e9fd5..553d99b02a53b4133a40d5bd2e19958c67487c00
2023-05-22 10:50:07 UTC to 2023-05-10 01:54:07 UTC

- Update raw-dylib documentation for stabilization (rust-lang/reference#1345)
- fix a typo (rust-lang/reference#1359)
- fixed minor error in a comment that annotated output of a proc macro (rust-lang/reference#1358)
- Fix example code in `impl` docs (rust-lang/reference#1360)
- Add documentation for debugger_visualizer attribute (rust-lang/reference#1335)

## rust-lang/rustc-dev-guide

4 commits in 28dbeaf..f1e6378
2023-05-18 02:44:05 UTC to 2023-05-11 09:59:23 UTC

- Add note about shell completion scripts (rust-lang/rustc-dev-guide#1686)
- filter out S-blocked issues in the "Getting Started" search (rust-lang/rustc-dev-guide#1687)
- Rename InstCombine to InstSimplify (rust-lang/rustc-dev-guide#1684)
- Use unpretty for debugging Hir (rust-lang/rustc-dev-guide#1685)
CFI: Fix encode_region: unexpected ReEarlyBound(0, 'a)

Fixes rust-lang#111515 and complements rust-lang#106547 by adding support for encoding early bound regions and also excluding projections when transforming trait objects' traits into their identities before emitting type checks.
…lor-5, r=notriddle

Migrate GUI colors test to original CSS color format

Follow-up of rust-lang#111459.

r? `@notriddle`
@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend 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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels May 23, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented May 23, 2023

📌 Commit f737ec4 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 May 23, 2023
@bors
Copy link
Contributor

bors commented May 23, 2023

⌛ Testing commit f737ec4 with merge d569987...

@bors
Copy link
Contributor

bors commented May 23, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 23, 2023
@bors bors merged commit d569987 into rust-lang:master May 23, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 23, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Perf Build Sha
#111871 8fbc1eaa38f81e91527ae7aca1085f7c33094dc3
#111851 b36304658ce9e620fd4fd25da9c87419bf3af003
#111845 f2474a30cf9a2399ee8beb5d56fa12b8ad4cf3c3
#111761 81346d90ffbe45d0d026123d9e1e912fb3a2c503
#111722 91c135a36cbaa6b9f12c49453c497e885fa9505e
#111486 80c19bdd993fcbb95a82947c469c9b2bfe011645
#111427 4471e01c02e991e7d312f4a48171d978e441caa5

previous master: 52dd1cde59

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 (d569987): 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.2% [0.2%, 0.3%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-0.7%, -0.2%] 18
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.2%] 9
All ❌✅ (primary) -0.2% [-0.7%, 0.3%] 23

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)
4.7% [4.7%, 4.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-2.5%, -0.9%] 2
All ❌✅ (primary) 4.7% [4.7%, 4.7%] 1

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

Binary size

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

Bootstrap: 646.927s -> 647.707s (0.12%)

@rustbot rustbot added the perf-regression Performance regression. label May 23, 2023
@pnkfelix
Copy link
Member

  • regressions are to bitmaps {{check, debug}-full, {check, debug, opt}-incr-full}.
  • improvements clearly outweigh regressions here
  • marked as triaged

@rustbot label: perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label May 30, 2023
@matthiaskrgr matthiaskrgr deleted the rollup-1xyv5mq 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-rustdoc-json Area: Rustdoc JSON backend 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-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.