Skip to content

add cast kind of from_exposed_addr (int-to-ptr casts) #97653

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jun 3, 2022

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Jun 2, 2022

This is basically the dual to #97582, for int2ptr casts.

Cc @tmiasko #97649

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 2, 2022
@rust-highfive
Copy link
Contributor

Some changes occured to rustc_codegen_cranelift

cc @bjorn3

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive
Copy link
Contributor

r? @wesleywiser

(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 2, 2022
let ty_from = op.ty(body, tcx);
let cast_ty_from = CastTy::from_ty(ty_from);
let cast_ty_to = CastTy::from_ty(*ty);
// Misc casts are either between floats and ints, or one ptr type to another.
Copy link
Member Author

Choose a reason for hiding this comment

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

@oli-obk this looks like logic that would also be nice to have in MIR validation, but without duplicating everything...

Copy link
Contributor

Choose a reason for hiding this comment

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

yea, I was actually wondering whether we shouldn't move (large) parts of mir typeck to mir validation

Copy link
Contributor

Choose a reason for hiding this comment

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

basically anything that doesn't produce obligations I guess

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
@oli-obk
Copy link
Contributor

oli-obk commented Jun 2, 2022

r? @oli-obk
@bors r+

@bors
Copy link
Collaborator

bors commented Jun 2, 2022

📌 Commit d5a590f has been approved by oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned wesleywiser Jun 2, 2022
@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 2, 2022
@oli-obk oli-obk added the A-mir-opt Area: MIR optimizations label Jun 2, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 3, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#97366 (Stabilize `{slice,array}::from_ref`)
 - rust-lang#97653 (add cast kind of from_exposed_addr (int-to-ptr casts))
 - rust-lang#97663 (take back half-baked noaliasing check in Assignment)
 - rust-lang#97664 (On E0204 suggest missing type param bounds)
 - rust-lang#97668 (rustdoc: clean up primitive.slice.html links)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f116dd7 into rust-lang:master Jun 3, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 3, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 4, 2022
add cast kind of from_exposed_addr (int-to-ptr casts)

This is basically the dual to rust-lang#97582, for int2ptr casts.

Cc `@tmiasko` rust-lang#97649
@RalfJung RalfJung deleted the int-to-ptr branch June 5, 2022 15:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-mir-opt Area: MIR optimizations 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.

7 participants