about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-02-29 10:14:16 +0100
committerRalf Jung <post@ralfj.de>2024-03-02 10:52:49 +0100
commitd9a2886ef8ba8716abbaad338d1e7278d66d25b8 (patch)
tree75080f0025993bfb3996130087c3ac7da5b61a2d /compiler/rustc_const_eval/src
parent4cdd20584ccb75890d7d9bfae266054abfae5d46 (diff)
add comment and test: we do not do value-based reasoning for promotion of unions
Diffstat (limited to 'compiler/rustc_const_eval/src')
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
index 7eb3c181d69..1847847d9d2 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
@@ -284,6 +284,7 @@ where
                 if Q::in_adt_inherently(cx, def, args) {
                     return true;
                 }
+                // Don't do any value-based reasoning for unions.
                 if def.is_union() && Q::in_any_value_of_ty(cx, rvalue.ty(cx.body, cx.tcx)) {
                     return true;
                 }