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 instance evaluation and methods to read an allocation in StableMIR #118694

Merged
merged 4 commits into from Dec 9, 2023

Conversation

celinval
Copy link
Contributor

@celinval celinval commented Dec 7, 2023

The instance evaluation is needed to handle intrinsics such as type_id and type_name.

Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation.

I've also started to add a structured way to get information about the compilation target machine. For now, I've only added information needed to process an allocation.

r? @ouz-a

@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 Dec 7, 2023
@rustbot
Copy link
Collaborator

rustbot commented Dec 7, 2023

This PR changes Stable MIR

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

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Copy link
Contributor

@ouz-a ouz-a left a comment

Choose a reason for hiding this comment

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

everything looks good, but I wish see few more tests to make sure these newly added functions are working as intended.

compiler/stable_mir/src/ty.rs Show resolved Hide resolved
The instance evaluation is needed to handle intrinsics such as
`type_id` and `type_name`.

Since we now use Allocation to represent all evaluated constants,
provide a few methods to help process the data inside an allocation.
@ouz-a
Copy link
Contributor

ouz-a commented Dec 8, 2023

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 8, 2023

📌 Commit 9e15c49 has been approved by ouz-a

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 8, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 8, 2023
Add instance evaluation and methods to read an allocation in StableMIR

The instance evaluation is needed to handle intrinsics such as `type_id` and `type_name`.

Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation.

I've also started to add a structured way to get information about the compilation target machine. For now, I've only added information needed to process an allocation.

r? ``@ouz-a``
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 8, 2023
Add instance evaluation and methods to read an allocation in StableMIR

The instance evaluation is needed to handle intrinsics such as `type_id` and `type_name`.

Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation.

I've also started to add a structured way to get information about the compilation target machine. For now, I've only added information needed to process an allocation.

r? ``@ouz-a``
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 8, 2023
Add instance evaluation and methods to read an allocation in StableMIR

The instance evaluation is needed to handle intrinsics such as `type_id` and `type_name`.

Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation.

I've also started to add a structured way to get information about the compilation target machine. For now, I've only added information needed to process an allocation.

r? ```@ouz-a```
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 8, 2023
Add instance evaluation and methods to read an allocation in StableMIR

The instance evaluation is needed to handle intrinsics such as `type_id` and `type_name`.

Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation.

I've also started to add a structured way to get information about the compilation target machine. For now, I've only added information needed to process an allocation.

r? ````@ouz-a````
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 8, 2023
…llaumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#118150 (Add new targets {x86_64,i686}-win7-windows-msvc)
 - rust-lang#118417 (Add unstable `-Zdefault-hidden-visibility` cmdline flag for `rustc`.)
 - rust-lang#118692 (remove redundant imports)
 - rust-lang#118694 (Add instance evaluation and methods to read an allocation in StableMIR)
 - rust-lang#118737 (Extend tidy alphabetical checking to `tests/`.)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 8, 2023
Add instance evaluation and methods to read an allocation in StableMIR

The instance evaluation is needed to handle intrinsics such as `type_id` and `type_name`.

Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation.

I've also started to add a structured way to get information about the compilation target machine. For now, I've only added information needed to process an allocation.

r? `````@ouz-a`````
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 8, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#117586 (Uplift the (new solver) canonicalizer into `rustc_next_trait_solver`)
 - rust-lang#118692 (remove redundant imports)
 - rust-lang#118694 (Add instance evaluation and methods to read an allocation in StableMIR)
 - rust-lang#118715 (privacy: visit trait def id of projections)
 - rust-lang#118730 (recurse into refs when comparing tys for diagnostics)
 - rust-lang#118736 (temporarily revert "ice on ambguity in mir typeck")

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

Rollup of 6 pull requests

Successful merges:

 - rust-lang#117586 (Uplift the (new solver) canonicalizer into `rustc_next_trait_solver`)
 - rust-lang#118502 (fix: correct the arg for 'suggest to use associated function syntax' diagnostic)
 - rust-lang#118694 (Add instance evaluation and methods to read an allocation in StableMIR)
 - rust-lang#118715 (privacy: visit trait def id of projections)
 - rust-lang#118730 (recurse into refs when comparing tys for diagnostics)
 - rust-lang#118736 (temporarily revert "ice on ambguity in mir typeck")

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1889e5a into rust-lang:master Dec 9, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Dec 9, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 9, 2023
Rollup merge of rust-lang#118694 - celinval:smir-alloc-methods, r=ouz-a

Add instance evaluation and methods to read an allocation in StableMIR

The instance evaluation is needed to handle intrinsics such as `type_id` and `type_name`.

Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation.

I've also started to add a structured way to get information about the compilation target machine. For now, I've only added information needed to process an allocation.

r? ``````@ouz-a``````
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.

None yet

4 participants