about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/hooks
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2025-01-29 09:20:53 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2025-02-05 14:56:41 +0000
commitab3115990d333b8b782f8ea062c881fda377a353 (patch)
tree26d86e6c1f818f98c9acc63abec99e73401b5200 /compiler/rustc_middle/src/hooks
parent8df89d1cb077cd76013d3f9f5a4e92c5b5a9280c (diff)
downloadrust-ab3115990d333b8b782f8ea062c881fda377a353.tar.gz
rust-ab3115990d333b8b782f8ea062c881fda377a353.zip
Pretty print pattern type values with `transmute` if they don't satisfy their pattern
Diffstat (limited to 'compiler/rustc_middle/src/hooks')
-rw-r--r--compiler/rustc_middle/src/hooks/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/hooks/mod.rs b/compiler/rustc_middle/src/hooks/mod.rs
index 276a02b4e0f..c5ce6efcb81 100644
--- a/compiler/rustc_middle/src/hooks/mod.rs
+++ b/compiler/rustc_middle/src/hooks/mod.rs
@@ -98,6 +98,10 @@ declare_hooks! {
     hook save_dep_graph() -> ();
 
     hook query_key_hash_verify_all() -> ();
+
+    /// Ensure the given scalar is valid for the given type.
+    /// This checks non-recursive runtime validity.
+    hook validate_scalar_in_layout(scalar: crate::ty::ScalarInt, ty: Ty<'tcx>) -> bool;
 }
 
 #[cold]