Skip to content

Commit 3ef9dfd

Browse files
committed
Update comment
1 parent 1eb300e commit 3ef9dfd

File tree

1 file changed

+2
-3
lines changed
  • compiler/rustc_middle/src/ty/consts

1 file changed

+2
-3
lines changed

compiler/rustc_middle/src/ty/consts/int.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ impl ScalarInt {
165165
}
166166

167167
/// Make sure the `data` fits in `size`.
168-
/// This is guaranteed by all constructors here, but since the enum variants are public,
169-
/// it could still be violated (even though no code outside this file should
170-
/// construct `Scalar`s).
168+
/// This is guaranteed by all constructors here, but having had this check saved us from
169+
/// bugs many times in the past, so keeping it around is definitely worth it.
171170
#[inline(always)]
172171
fn check_data(self) {
173172
// Using a block `{self.data}` here to force a copy instead of using `self.data`

0 commit comments

Comments
 (0)