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

Add a stable MIR visitor #117417

Merged
merged 1 commit into from Nov 1, 2023
Merged

Add a stable MIR visitor #117417

merged 1 commit into from Nov 1, 2023

Conversation

celinval
Copy link
Contributor

This change also adds a few utility functions as well and extend most mir and ty ADTs to implement PartialEq and Eq.

Fixes rust-lang/project-stable-mir#32

r? @oli-obk

Add a few utility functions as well and extend most `mir` and `ty`
ADTs to implement `PartialEq` and `Eq`.
@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. labels Oct 30, 2023
@rustbot
Copy link
Collaborator

rustbot commented Oct 30, 2023

This PR changes Stable MIR

cc @oli-obk, @celinval, @spastorino, @ouz-a

@oli-obk
Copy link
Contributor

oli-obk commented Oct 31, 2023

Equality for things containing Span has bitten us a few times in rustc. Things like mir::Constant comparing as inequal if they have different spans is surprising, but you also don't want them to compare as equal. What do you need it for?

@celinval
Copy link
Contributor Author

Equality for things containing Span has bitten us a few times in rustc. Things like mir::Constant comparing as inequal if they have different spans is surprising, but you also don't want them to compare as equal. What do you need it for?

My initial use case was testing. In the long run, I think it is very helpful to store many of these constructs in hash maps, even though I haven't derived Hash yet.

For cases like Constant, we could eventually create a different trait or a method that only compare semantics, not structure.

We could also add comparison for fewer constructs for now, although removing some of them might make all the other ones hard to implement.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 31, 2023

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 31, 2023

📌 Commit af7472e has been approved by oli-obk

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

Rollup of 5 pull requests

Successful merges:

 - rust-lang#113241 (rustdoc: Document lack of object safety on affected traits)
 - rust-lang#117388 (Turn const_caller_location from a query to a hook)
 - rust-lang#117417 (Add a stable MIR visitor)
 - rust-lang#117439 (prepopulate opaque ty storage before using it)
 - rust-lang#117451 (Add support for pre-unix-epoch file dates on Apple platforms (rust-lang#108277))

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 31, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#113241 (rustdoc: Document lack of object safety on affected traits)
 - rust-lang#117388 (Turn const_caller_location from a query to a hook)
 - rust-lang#117417 (Add a stable MIR visitor)
 - rust-lang#117439 (prepopulate opaque ty storage before using it)
 - rust-lang#117451 (Add support for pre-unix-epoch file dates on Apple platforms (rust-lang#108277))

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 290daf9 into rust-lang:master Nov 1, 2023
11 checks passed
@rustbot rustbot added this to the 1.75.0 milestone Nov 1, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 1, 2023
Rollup merge of rust-lang#117417 - celinval:smir-visitor, r=oli-obk

Add a stable MIR visitor

This change also adds a few utility functions as well and extend most `mir` and `ty` ADTs to implement `PartialEq` and `Eq`.

Fixes rust-lang/project-stable-mir#32

r? `@oli-obk`
bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Nov 1, 2023
78: Automated pull from upstream `master` r=tshepang a=github-actions[bot]


This PR pulls the following changes from the upstream repository:

* rust-lang/rust#113970
* rust-lang/rust#117459
  * rust-lang/rust#117451
  * rust-lang/rust#117439
  * rust-lang/rust#117417
  * rust-lang/rust#117388
  * rust-lang/rust#113241
* rust-lang/rust#117462
* rust-lang/rust#117450
* rust-lang/rust#117407
* rust-lang/rust#117444
  * rust-lang/rust#117438
  * rust-lang/rust#117421
  * rust-lang/rust#117416
  * rust-lang/rust#116712
  * rust-lang/rust#116267
* rust-lang/rust#117377
* rust-lang/rust#117419



Co-authored-by: Alexis (Poliorcetics) Bourget <ab_github@poliorcetiq.eu>
Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
Co-authored-by: David Tolnay <dtolnay@gmail.com>
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Michael Goulet <michael@errs.io>
Co-authored-by: bors <bors@rust-lang.org>
Co-authored-by: Camille GILLOT <gillot.camille@gmail.com>
Co-authored-by: lcnr <rust@lcnr.de>
Co-authored-by: Zalathar <Zalathar@users.noreply.github.com>
Co-authored-by: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
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. 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.

Implement visitor for smir types
4 participants