From f9644c16f3156025d83d3dc1262ac35d9ae89588 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 28 Feb 2020 09:21:25 +0100 Subject: [PATCH] add comment to check_data --- src/librustc/mir/interpret/value.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc/mir/interpret/value.rs b/src/librustc/mir/interpret/value.rs index 2c146b5d7b4..0e14089eebc 100644 --- a/src/librustc/mir/interpret/value.rs +++ b/src/librustc/mir/interpret/value.rs @@ -170,6 +170,10 @@ impl From for Scalar { } impl Scalar<()> { + /// Make sure the `data` fits in `size`. + /// This is guaranteed by all constructors here, but since the enum variants are public, + /// it could still be violated (even though no code outside this file should + /// construct `Scalar`s). #[inline(always)] fn check_data(data: u128, size: u8) { debug_assert_eq!(