Skip to content

Commit f9644c1

Browse files
committed
add comment to check_data
1 parent 7497d93 commit f9644c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc/mir/interpret/value.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ impl<Tag> From<Double> for Scalar<Tag> {
170170
}
171171

172172
impl Scalar<()> {
173+
/// Make sure the `data` fits in `size`.
174+
/// This is guaranteed by all constructors here, but since the enum variants are public,
175+
/// it could still be violated (even though no code outside this file should
176+
/// construct `Scalar`s).
173177
#[inline(always)]
174178
fn check_data(data: u128, size: u8) {
175179
debug_assert_eq!(

0 commit comments

Comments
 (0)