]> git.lizzy.rs Git - rust.git/commit
make PointerKind directly reflect pointer types
authorRalf Jung <post@ralfj.de>
Tue, 27 Dec 2022 11:31:17 +0000 (12:31 +0100)
committerRalf Jung <post@ralfj.de>
Mon, 6 Feb 2023 10:46:32 +0000 (11:46 +0100)
commit201ae7387245caa4591d4c8db4c35c170c64faf0
tree011ec2bc77cfee914cfab9d89b61c40232046986
parent0c13c172507f01d921808107d2c4ec37b43b982d
make PointerKind directly reflect pointer types

The code that consumes PointerKind (`adjust_for_rust_scalar` in rustc_ty_utils)
ended up using PointerKind variants to talk about Rust reference types (& and
&mut) anyway, making the old code structure quite confusing: one always had to
keep in mind which PointerKind corresponds to which type. So this changes
PointerKind to directly reflect the type.

This does not change behavior.
compiler/rustc_abi/src/lib.rs
compiler/rustc_middle/src/ty/layout.rs
compiler/rustc_ty_utils/src/abi.rs
tests/codegen/function-arguments-noopt.rs