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

Fix TyKind::is_simple_path #103176

Merged
merged 2 commits into from
Oct 19, 2022
Merged

Conversation

nnethercote
Copy link
Contributor

Fixes #103157.

r? @spastorino

To include some `Option<>` fields of different types in a single enum.
The test output is currently buggy, but the next commit will fix that.
PR rust-lang#98758 introduced code to avoid redundant assertions in derived code
like this:
```
let _: ::core::clone::AssertParamIsClone<u32>;
let _: ::core::clone::AssertParamIsClone<u32>;
```
But the predicate `is_simple_path` introduced as part of this failed to
account for generic arguments. Therefore the deriving code erroneously
considers types like `Option<bool>` and `Option<f32>` to be the same.

This commit fixes `is_simple_path`.

Fixes rust-lang#103157.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 18, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 18, 2022
@nnethercote
Copy link
Contributor Author

@bors rollup=always

@spastorino
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 18, 2022

📌 Commit 9a23f60 has been approved by spastorino

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 Oct 18, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 19, 2022
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#103166 (Optimize `slice_iter.copied().next_chunk()`)
 - rust-lang#103176 (Fix `TyKind::is_simple_path`)
 - rust-lang#103178 (Partially fix `src/test/run-make/coverage-reports` when cross-compiling)
 - rust-lang#103198 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e86bc89 into rust-lang:master Oct 19, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 19, 2022
@nnethercote nnethercote deleted the fix-TyKind-is_simple_path branch October 19, 2022 09:02
@apiraino
Copy link
Contributor

I'm going to ask T-compiler about a backport (either or both stable/beta)

@rustbot label beta-nominated stable-nominated

@rustbot rustbot added beta-nominated Nominated for backporting to the compiler in the beta channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels Oct 19, 2022
@Noratrieb
Copy link
Member

I agree that this should go at least back to beta

  • it's a small and obvious change
  • it can break code that compiled with the previous compiler
    Backporting it would minimize churn for users at little maintenance cost

@apiraino
Copy link
Contributor

apiraino commented Oct 20, 2022

Beta backport accepted as per compiler team on Zulip

@rustbot label +beta-accepted

@rustbot rustbot added beta-accepted Accepted for backporting to the compiler in the beta channel. stable-accepted Accepted for backporting to the compiler in the stable channel. labels Oct 20, 2022
@apiraino apiraino removed the stable-accepted Accepted for backporting to the compiler in the stable channel. label Oct 20, 2022
@cuviper cuviper mentioned this pull request Oct 20, 2022
@cuviper cuviper modified the milestones: 1.66.0, 1.65.0 Oct 20, 2022
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 20, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 21, 2022
[beta] backports

- Use rebind instead of dummy binder in `SameTypeModuloInfer` relation rust-lang#102059
- Add missing space between notable trait tooltip and where clause rust-lang#102107
- Avoid repeated re-initialization of the BufReader buffer rust-lang#102760
- Ensure enum cast moves rust-lang#103016
- Fix `TyKind::is_simple_path` rust-lang#103176
- Do anonymous lifetimes remapping correctly for nested rpits rust-lang#103205
- [beta] Cargo backport 1.65.0 rust-lang#103303
- linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO rust-lang#103092

r? `@ghost`
@spastorino
Copy link
Member

spastorino commented Oct 21, 2022

This one was also stable-accepted https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202022-10-20/near/305212449.

@apiraino did you intend to remove stable-accepted for some reason?. Maybe I have missed some conversation or something.

I think as with #103205, this one needs @rustbot label +stable-accepted -stable-nominated too.

@apiraino apiraino added the stable-accepted Accepted for backporting to the compiler in the stable channel. label Oct 21, 2022
@cuviper
Copy link
Member

cuviper commented Oct 21, 2022

I'm general, backports should keep both the nominated and accepted label until they've actually been backported.

@Mark-Simulacrum Mark-Simulacrum removed stable-nominated Nominated for backporting to the compiler in the stable channel. stable-accepted Accepted for backporting to the compiler in the stable channel. labels Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Illegal Eq derive in an enum with Option<f64>
9 participants