about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-03 10:02:52 +0000
committerbors <bors@rust-lang.org>2023-10-03 10:02:52 +0000
commitf107a50b2331e9adac586784b780e38ecb4bf8bd (patch)
tree67b7ab92d94fc15dbc5928f829497b8ad9ed502d
parent3169423ce9e8e304ab1badca364bc7f71d89430d (diff)
parentea4b38820bafe9d7016cf19d35e977b08f0cbdd3 (diff)
downloadrust-f107a50b2331e9adac586784b780e38ecb4bf8bd.tar.gz
rust-f107a50b2331e9adac586784b780e38ecb4bf8bd.zip
Auto merge of #115025 - ouz-a:ouz_testing, r=lcnr
Make subtyping explicit in MIR

This adds new mir-opt that pushes new `ProjectionElem` called `ProjectionElem::Subtype(T)` to `Rvalue` of a subtyped assignment so we can unsoundness issues like https://github.com/rust-lang/rust/issues/107205

Addresses https://github.com/rust-lang/rust/issues/112651

r? `@lcnr`
-rw-r--r--clippy_utils/src/qualify_min_const_fn.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs
index 17233058c9c..55f9cb27ad4 100644
--- a/clippy_utils/src/qualify_min_const_fn.rs
+++ b/clippy_utils/src/qualify_min_const_fn.rs
@@ -272,6 +272,7 @@ fn check_place<'tcx>(tcx: TyCtxt<'tcx>, place: Place<'tcx>, span: Span, body: &B
             | ProjectionElem::Downcast(..)
             | ProjectionElem::Subslice { .. }
             | ProjectionElem::Deref
+            | ProjectionElem::Subtype(_)
             | ProjectionElem::Index(_) => {},
         }
     }