about summary refs log tree commit diff
diff options
context:
space:
mode:
authoroli <github35764891676564198441@oli-obk.de>2020-11-01 17:00:09 +0000
committeroli <github35764891676564198441@oli-obk.de>2020-11-04 10:12:13 +0000
commit3ef9dfdd425e061a71dd5ca168c2dfec03699754 (patch)
tree8f896970ba3be81968cbbfc31c9f69ae8e318104
parent1eb300ede104d8da439d308dd3193f4448ed442b (diff)
downloadrust-3ef9dfdd425e061a71dd5ca168c2dfec03699754.tar.gz
rust-3ef9dfdd425e061a71dd5ca168c2dfec03699754.zip
Update comment
-rw-r--r--compiler/rustc_middle/src/ty/consts/int.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/ty/consts/int.rs b/compiler/rustc_middle/src/ty/consts/int.rs
index bdb6e4e9660..4b842b75461 100644
--- a/compiler/rustc_middle/src/ty/consts/int.rs
+++ b/compiler/rustc_middle/src/ty/consts/int.rs
@@ -165,9 +165,8 @@ impl ScalarInt {
     }
 
     /// 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).
+    /// This is guaranteed by all constructors here, but having had this check saved us from
+    /// bugs many times in the past, so keeping it around is definitely worth it.
     #[inline(always)]
     fn check_data(self) {
         // Using a block `{self.data}` here to force a copy instead of using `self.data`