From aaa35b3e48b768315a5f53b8523435f27b708d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Christopher=20K=C3=B6hl?= Date: Wed, 12 Oct 2022 23:46:31 +0200 Subject: [PATCH] Add comment for the current retag situation --- compiler/rustc_mir_dataflow/src/value_analysis.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs index 9ae87418bc8..116a8b7bd40 100644 --- a/compiler/rustc_mir_dataflow/src/value_analysis.rs +++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs @@ -114,8 +114,13 @@ pub trait ValueAnalysis<'tcx> { // (A2) state.flood_with(place.as_ref(), self.map(), Self::Value::bottom()); } + StatementKind::Retag(..) => { + // A retag modifies the provenance of references. Currently references are only + // tracked if `-Zunsound-mir-opts` is given, but this might change in the future. + // However, it is still unclear how retags should be handled: + // https://github.com/rust-lang/rust/pull/101168#discussion_r985304895 + } StatementKind::Nop - | StatementKind::Retag(..) | StatementKind::FakeRead(..) | StatementKind::Coverage(..) | StatementKind::AscribeUserType(..) => (),