diff options
| author | Ralf Jung <post@ralfj.de> | 2022-12-27 12:31:17 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-02-06 11:46:32 +0100 |
| commit | 201ae7387245caa4591d4c8db4c35c170c64faf0 (patch) | |
| tree | 011ec2bc77cfee914cfab9d89b61c40232046986 /tests/codegen | |
| parent | 0c13c172507f01d921808107d2c4ec37b43b982d (diff) | |
| download | rust-201ae7387245caa4591d4c8db4c35c170c64faf0.tar.gz rust-201ae7387245caa4591d4c8db4c35c170c64faf0.zip | |
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.
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/function-arguments-noopt.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/codegen/function-arguments-noopt.rs b/tests/codegen/function-arguments-noopt.rs index ff76405a4ea..0c62e0d35e3 100644 --- a/tests/codegen/function-arguments-noopt.rs +++ b/tests/codegen/function-arguments-noopt.rs @@ -29,6 +29,12 @@ pub fn borrow(x: &i32) -> &i32 { x } +// CHECK: align 4 {{i32\*|ptr}} @borrow_mut({{i32\*|ptr}} align 4 %x) +#[no_mangle] +pub fn borrow_mut(x: &mut i32) -> &mut i32 { + x +} + // CHECK-LABEL: @borrow_call #[no_mangle] pub fn borrow_call(x: &i32, f: fn(&i32) -> &i32) -> &i32 { |
