Title: Fix compound assignment type casts by joaotgouveia · Pull Request #228 · Cpp2Rust/cpp2rust · GitHub
Open Graph Title: Fix compound assignment type casts by joaotgouveia · Pull Request #228 · Cpp2Rust/cpp2rust
X Title: Fix compound assignment type casts by joaotgouveia · Pull Request #228 · Cpp2Rust/cpp2rust
Description: Fixes type casts inside compound assignments under the unsafe model and removes unnecessary casts under the refcount model. When translating binary operators, both unsafe and refcount have a special case for translating compound assignments involving different types.
The types being compared were the original C++ types. However, differences between the original C++ types do not necessarily mean that the corresponding Rust types differ. This caused unnecessary casts to be introduced and, under the unsafe model, resulted in translations that do not compile, such as the following:
int main() {
std::vector
Open Graph Description: Fixes type casts inside compound assignments under the unsafe model and removes unnecessary casts under the refcount model. When translating binary operators, both unsafe and refcount have a specia...
X Description: Fixes type casts inside compound assignments under the unsafe model and removes unnecessary casts under the refcount model. When translating binary operators, both unsafe and refcount have a specia...
Opengraph URL: https://github.com/Cpp2Rust/cpp2rust/pull/228
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ef5f552c-24fd-872e-1e60-23673f61c1ba |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A0C6:B4B51:1262CF2:18EFA2B:6A4D6A9A |
| html-safe-nonce | 602f3a84940be17a6a899fd5c7e2e1268a2cb710088bdba3d93004350204d79d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMEM2OkI0QjUxOjEyNjJDRjI6MThFRkEyQjo2QTRENkE5QSIsInZpc2l0b3JfaWQiOiIzNzY0MzE5Mjk1MTc5MTU2MTIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a864ba2a751c09ef53376060d74171bd1d92203cce0aa1d892b415d7765f0fa1 |
| hovercard-subject-tag | pull_request:3994840210 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/Cpp2Rust/cpp2rust/pull/228/files |
| twitter:image | https://avatars.githubusercontent.com/u/92531965?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/92531965?s=400&v=4 |
| og:image:alt | Fixes type casts inside compound assignments under the unsafe model and removes unnecessary casts under the refcount model. When translating binary operators, both unsafe and refcount have a specia... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7db3950e3f59095e20a9789440c3dd554efc62d434882ead06ae05b5815605b9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/Cpp2Rust/cpp2rust git https://github.com/Cpp2Rust/cpp2rust.git |
| octolytics-dimension-user_id | 197474191 |
| octolytics-dimension-user_login | Cpp2Rust |
| octolytics-dimension-repository_id | 1183095779 |
| octolytics-dimension-repository_nwo | Cpp2Rust/cpp2rust |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1183095779 |
| octolytics-dimension-repository_network_root_nwo | Cpp2Rust/cpp2rust |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cd8f6a71db61d6012a0cbb134be844fdbe9b8a45 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width