diff options
| author | Ralf Jung <post@ralfj.de> | 2022-06-02 09:05:37 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-06-02 10:46:13 -0400 |
| commit | fafccdced349d655db83e0ec30e91b85dcf65cf7 (patch) | |
| tree | ac2824389ec482db03424576e022e3e304ef54a2 /src | |
| parent | 5e6bb83268518dcd74c96b5504f485b71e604e4c (diff) | |
| download | rust-fafccdced349d655db83e0ec30e91b85dcf65cf7.tar.gz rust-fafccdced349d655db83e0ec30e91b85dcf65cf7.zip | |
add cast kind of from_exposed_addr (int-to-ptr casts)
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff | 2 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/test/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff b/src/test/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff index 04724b13ca6..037febdf3a5 100644 --- a/src/test/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff +++ b/src/test/mir-opt/const_prop/reify_fn_ptr.main.ConstProp.diff @@ -19,7 +19,7 @@ // + literal: Const { ty: fn() {main}, val: Value(Scalar(<ZST>)) } _2 = move _3 as usize (PointerExposeAddress); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26 StorageDead(_3); // scope 0 at $DIR/reify_fn_ptr.rs:4:25: 4:26 - _1 = move _2 as *const fn() (Misc); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41 + _1 = move _2 as *const fn() (PointerFromExposedAddress); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41 StorageDead(_2); // scope 0 at $DIR/reify_fn_ptr.rs:4:40: 4:41 StorageDead(_1); // scope 0 at $DIR/reify_fn_ptr.rs:4:41: 4:42 nop; // scope 0 at $DIR/reify_fn_ptr.rs:3:11: 5:2 diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs index b1c82ac76e8..58abef38ea8 100644 --- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs +++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs @@ -131,7 +131,12 @@ fn check_rvalue<'tcx>( Rvalue::Cast(CastKind::Misc, operand, _) => { check_operand(tcx, operand, span, body) }, - Rvalue::Cast(CastKind::Pointer(PointerCast::MutToConstPointer | PointerCast::ArrayToPointer), operand, _) => { + Rvalue::Cast( + CastKind::PointerFromExposedAddress + | CastKind::Pointer(PointerCast::MutToConstPointer | PointerCast::ArrayToPointer), + operand, + _ + ) => { check_operand(tcx, operand, span, body) }, Rvalue::Cast( |
