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

Merged
merged 15 commits into from
May 16, 2023
Merged

Rollup of 7 pull requests #111650

merged 15 commits into from
May 16, 2023

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

clubby789 and others added 15 commits May 13, 2023 16:45
Hide repr attribute from doc of types without guaranteed repr

Rustdoc has an undesirable behavior of blindly copying `repr` into the documentation of structs and enums, even when there is no particular repr that the type guarantees to its users. This is a source of confusion for standard library users who assume the fact that a repr is documented means it must be something the standard library promises they can rely on (in transmutes, or FFI).

Some issues on the topic of rustdoc's incorrect handling of `repr`:

- rust-lang#66401
- rust-lang#90435

In places, the standard library currently works around this confusing rustdoc behavior by just omitting `repr(transparent)` altogether even where it should be required if equivalent code were being written outside of the standard library. See rust-lang#61969.

IMO that is even more confusing, even for standard library maintainers — see rust-lang#105018 (comment). It's also not something that works for other reprs like `C` or `u8` which cannot just be omitted even in standard library code.

This PR tries a different approach for some types that are being currently incorrectly documented with a repr.

> **Warning**
> This PR does not imply that every type that still has a `repr` attribute in its docs after this PR is now public for users to rely on. This PR only tries to reduce harm from this longstanding rustdoc issue.
Use error term in projection if missing associated item in new solver

We were previously delaying a bug but not bailing, leading to an ICE in the `tcx.type_of(assoc_def.item.def_id)` call below.
…li-obk

Handle error body in generator layout

Fixes rust-lang#111468

I feel like making this query return `Option<GeneratorLayout>` might be better but had some issues with that approach
…WaffleLapkin

Erase `ReError` properly

Fixes rust-lang#111341

Since we check whether a type has free regions before erasing (to short circuit unnecesary folding), we need to consider `ReError` as a free region, or else we'll skip it when erasing a type that only mentions `ReError`.

cc `@nnethercote`
… r=joshtriplett

Change Vec examples to not assert exact capacity except where it is guaranteed

It was [brought up on discord](https://discord.com/channels/273534239310479360/818964227783262209/1107633959329878077) that the `Vec::into_boxed_slice` example contradicted the `Vec::with_capacity` docs in that the returned `Vec` might have _more_ capacity than requested.

So, to reduce confusion change all the `assert_eq!(vec.capacity(), _)` to `assert!(vec.capacity() >= _)`, except in 4 examples that have guaranteed capacities: `Vec::from_raw_parts`, `Vec::from_raw_parts_in`, `Vec::<()>::with_capacity`,`Vec::<(), _>::with_capacity_in`.
fix(diagnostic): wrap parens for ref impl trait param

Fixes rust-lang#99597

When parameters are an `impl_trait` which it needed to add trait, and it is a reference, add parentheses to the type of the parameter in the suggestion
…es, r=notriddle

[rustdoc] Only keep impl blocks from bodies

Fixes rust-lang#111415.

The problem was that we kept everything inside bodies whereas only impl blocks are actually accessible from outside bodies.

r? `@notriddle`
@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 May 16, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented May 16, 2023

📌 Commit 54a4976 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 16, 2023
@bors
Copy link
Contributor

bors commented May 16, 2023

⌛ Testing commit 54a4976 with merge e77366b...

@bors
Copy link
Contributor

bors commented May 16, 2023

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

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

📌 Perf builds for each rolled up PR:

PR# Perf Build Sha
#111642 1765802a9472e947a8306d2b11f776b7a94fb245
#111610 503a5451c15ef844688e907dec91c738e09acf00
#111592 75d326dc5ff731d562766545f5854b810fc9b0ff
#111573 87d1579bcabd3211b1cbbbd03a4cc0a00e521f85
#111533 d63034dbac4690f2eddd49b751463f26e3dc00b0
#111488 83ba8e383be53b694adbffaabc9649c38c01f94b
#107680 3bfd6ef3d254e5c1b539bf763261f0c22ad4a932

previous master: b652d9a0fd

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 (e77366b): 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.3% [-4.4%, -0.6%] 3
Improvements ✅
(secondary)
-2.2% [-2.5%, -2.0%] 2
All ❌✅ (primary) -2.3% [-4.4%, -0.6%] 3

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)
-1.8% [-1.8%, -1.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.8% [-1.8%, -1.8%] 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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.9% [-3.9%, -3.9%] 1
Improvements ✅
(secondary)
-2.6% [-3.1%, -2.4%] 3
All ❌✅ (primary) -3.9% [-3.9%, -3.9%] 1

Binary size

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

Bootstrap: 644.057s -> 644.432s (0.06%)

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. 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

10 participants