Skip to content

Commit f431fda

Browse files
authored
Rollup merge of #118688 - celinval:smir-rvalue-ty, r=compiler-errors
Add method to get type of an Rvalue in StableMIR Provide a method to StableMIR users to retrieve the type of an Rvalue operation. There were two possible implementation: 1. Create the logic inside stable_mir to process the type according to the Rvalue semantics, which duplicates the logic of `rustc_middle::mir::Rvalue::ty()`. 2. Implement the Rvalue translation from StableMIR back to internal representation, invoke the `rustc_middle::mir::Rvalue::ty()`, and translate the return value to StableMIR. I chose the first one for now since the duplication was fairly small, and the option 2 would require way more work to translate everything back to rustc internal representation. If we eventually add those translations, we could easily swap to the option 2. ```@compiler-errors``` / ```@ouz-a``` Please let me know if you have any strong opinion here. r? ```@compiler-errors```
2 parents 5c3a377 + b06fe53 commit f431fda

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)