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

switch_ty is redundant #73586

Merged
merged 3 commits into from
Jun 23, 2020
Merged

switch_ty is redundant #73586

merged 3 commits into from
Jun 23, 2020

Conversation

RalfJung
Copy link
Member

This field is redundant, but we cannot remove it currently as pretty-printing relies on it (and it does not have access to mir::Body to compute the type itself).

Cc @oli-obk @matthewjasper @jonas-schievink

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 21, 2020
@RalfJung RalfJung changed the title remove switch_ty reliance in codegen switch_ty is redundant Jun 21, 2020
@@ -1075,6 +1075,8 @@ pub enum TerminatorKind<'tcx> {
discr: Operand<'tcx>,

/// The type of value being tested.
/// This is always the same as the type of `discr`.
/// FIXME: remove this redundant information. Currently, it is relied on by pretty-printing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to be more aggressive about it you can #[deprecate] it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what that would help with?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would nudge people away from new usages of this field.

@oli-obk
Copy link
Contributor

oli-obk commented Jun 22, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jun 22, 2020

📌 Commit 7447bf2 has been approved by oli-obk

@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 Jun 22, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 22, 2020
switch_ty is redundant

This field is redundant, but we cannot remove it currently as pretty-printing relies on it (and it does not have access to `mir::Body` to compute the type itself).

Cc @oli-obk @matthewjasper @jonas-schievink
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#71756 (add Windows system error codes that should map to io::ErrorKind::TimedOut)
 - rust-lang#73495 (Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits)
 - rust-lang#73575 (Fix typo in error_codes doc)
 - rust-lang#73578 (Make is_freeze and is_copy_modulo_regions take TyCtxtAt)
 - rust-lang#73586 (switch_ty is redundant)
 - rust-lang#73600 (Fix spurious 'value moved here in previous iteration of loop' messages)
 - rust-lang#73610 (Clean up E0699 explanation)

Failed merges:

r? @ghost
@bors bors merged commit 490d820 into rust-lang:master Jun 23, 2020
@RalfJung RalfJung deleted the switch-ty branch June 28, 2020 07:19
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants