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 6 pull requests #134640

Merged
merged 14 commits into from
Dec 22, 2024
Merged

Rollup of 6 pull requests #134640

merged 14 commits into from
Dec 22, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

estebank and others added 14 commits December 21, 2024 01:31
The rules were baffling when I ran in to them trying to add some impls,
so I made the compiler explain them to me.

The logic of the successful cases is unchanged, but I did rearrange it
to reverse the order of the primitive and `Adt` cases; this makes
producing the errors easier.
Use orphaned error code for the same error it belonged to before.

```
error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
  --> $DIR/macros-nonfatal-errors.rs:42:10
   |
LL |   #[derive(Default)]
   |            ^^^^^^^
LL | / enum NoDeclaredDefault {
LL | |     Foo,
LL | |     Bar,
LL | | }
   | |_- this enum needs a unit variant marked with `#[default]`
   |
   = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: make this unit variant default by placing `#[default]` on it
   |
LL |     #[default] Foo,
   |     ~~~~~~~~~~~~~~
help: make this unit variant default by placing `#[default]` on it
   |
LL |     #[default] Bar,
   |     ~~~~~~~~~~~~~~
```
Use E0665 for missing `#[default]` on enum and update doc

The docs for E0665 when doing `#[derive(Default]` on an `enum` previously didn't mention `#[default]` at all, or made a distinction between unit variants, that can be annotated, and tuple or struct variants, which cannot.

E0665 was not being emitted, we now use it for the same error it belonged to before.

```
error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
  --> $DIR/macros-nonfatal-errors.rs:42:10
   |
LL |   #[derive(Default)]
   |            ^^^^^^^
LL | / enum NoDeclaredDefault {
LL | |     Foo,
LL | |     Bar,
LL | | }
   | |_- this enum needs a unit variant marked with `#[default]`
   |
   = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: make this unit variant default by placing `#[default]` on it
   |
LL |     #[default] Foo,
   |     ++++++++++
help: make this unit variant default by placing `#[default]` on it
   |
LL |     #[default] Bar,
   |     ++++++++++
```
Support pretty-printing `dyn*` trait objects

- Tracking issue: rust-lang#102425
Explain why a type is not eligible for `impl PointerLike`.

The rules were baffling when I ran in to them trying to add some impls (to `std`, not my own code, as it happens), so I made the compiler explain them to me.

The logic of the successful cases is unchanged, but I did rearrange it to reverse the order of the primitive and `Adt` cases; this makes producing the errors easier. I'm still not very familiar with `rustc` internals, so let me know if there's a better way to do any of this.

This also adds test coverage for which impls are accepted or rejected, which I didn't see any of already.

The PR template tells me I should consider mentioning a tracking issue, but there isn't one for `pointer_like_trait`, so I'll mention `dyn_star`: rust-lang#102425
… r=lqd

coroutine_clone: add comments

I was very surprised to learn that coroutines can be cloned. This has non-trivial semantic consequences that I do not think have been considered. Lucky enough, it's still unstable. Let's add some comments and pointers so we hopefully become aware when a MIR opt actually is in conflict with this.

Cc `@rust-lang/wg-mir-opt`
Use `&raw` for `ptr` primitive docs

Fixes the first item in rust-lang#133024
Flatten effects directory now that it doesn't really test anything specific

These are just const trait tests now, after all.

There was one naming conflict between the aux-build `tests/ui/traits/const-traits/effects/auxiliary/cross-crate.rs` and `tests/ui/traits/const-traits/auxiliary/cross-crate.rs`. The former didn't really test anything useful since we no longer have an effect param, so I removed the test that owned it: `tests/ui/traits/const-traits/effects/no-explicit-const-params-cross-crate.rs`.

r? project-const-traits
@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. rollup A PR which is a rollup labels Dec 22, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Dec 22, 2024

📌 Commit 66dbfd4 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 Dec 22, 2024
@bors
Copy link
Contributor

bors commented Dec 22, 2024

⌛ Testing commit 66dbfd4 with merge a2bcfae...

@bors
Copy link
Contributor

bors commented Dec 22, 2024

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

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#134364 Use E0665 for missing #[default] on enum and update doc 5bc0dd3503fb86b0819b07a7715e60f4cc2388c2 (link)
#134601 Support pretty-printing dyn* trait objects 8fa39427bacdf6030b4b50a83a17669b534dbe22 (link)
#134603 Explain why a type is not eligible for impl PointerLike. c86144f89a0c74608212b66e9ad6d6dcd820f080 (link)
#134618 coroutine_clone: add comments c9124775288e1949ea69b6d23c38f12184a701c9 (link)
#134630 Use &raw for ptr primitive docs 6202d57f074a419e656d604f407201ba10f36ac0 (link)
#134637 Flatten effects directory now that it doesn't really test a… 9f75f7bc12a2c418fd74fee7e697d2cc37606059 (link)

previous master: c1132470a6

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 (a2bcfae): 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

Results (primary 3.9%)

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

Binary size

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

Bootstrap: 761.198s -> 761.892s (0.09%)
Artifact size: 330.59 MiB -> 330.63 MiB (0.01%)

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants