]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_const_eval/src/transform/promote_consts.rs
add cast kind of from_exposed_addr (int-to-ptr casts)
[rust.git] / compiler / rustc_const_eval / src / transform / promote_consts.rs
index cf5d7b6c70a30f09c0d9f57a60806a6d58f5e789..4879e8de10000f4f2ee44eefff13419bba0a5a69 100644 (file)
@@ -504,7 +504,8 @@ fn validate_rvalue(&mut self, rvalue: &Rvalue<'tcx>) -> Result<(), Unpromotable>
             // ptr-to-int casts are not possible in consts and thus not promotable
             Rvalue::Cast(CastKind::PointerExposeAddress, _, _) => return Err(Unpromotable),
 
-            // int-to-ptr casts are fine, they just use the integer value at pointer type.
+            // all ohter casts including int-to-ptr casts are fine, they just use the integer value
+            // at pointer type.
             Rvalue::Cast(_, operand, _) => {
                 self.validate_operand(operand)?;
             }