about summary refs log tree commit diff
path: root/compiler/rustc_hir/src/lang_items.rs
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2024-12-02 21:16:35 +0000
committerCelina G. Val <celinval@amazon.com>2025-02-03 12:54:00 -0800
commit777def87d58ee067e1df2e94a99fc099bcb15189 (patch)
tree22dbc57fd67592841fd2137f0d339d06d9e2dc91 /compiler/rustc_hir/src/lang_items.rs
parentbcb8565f301b579dee60fffe87d5a329cc69fefa (diff)
downloadrust-777def87d58ee067e1df2e94a99fc099bcb15189.tar.gz
rust-777def87d58ee067e1df2e94a99fc099bcb15189.zip
contracts: added lang items that act as hooks for rustc-injected code to invoke.
see test for an example of the kind of injected code that is anticipated here.
Diffstat (limited to 'compiler/rustc_hir/src/lang_items.rs')
-rw-r--r--compiler/rustc_hir/src/lang_items.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs
index d9759580e8f..75898cbec14 100644
--- a/compiler/rustc_hir/src/lang_items.rs
+++ b/compiler/rustc_hir/src/lang_items.rs
@@ -418,6 +418,10 @@ language_item_table! {
 
     String,                  sym::String,              string,                     Target::Struct,         GenericRequirement::None;
     CStr,                    sym::CStr,                c_str,                      Target::Struct,         GenericRequirement::None;
+
+    // Experimental lang items for implementing contract pre- and post-condition checking.
+    ContractBuildCheckEnsures, sym::contract_build_check_ensures, contract_build_check_ensures_fn, Target::Fn, GenericRequirement::None;
+    ContractCheckRequires,     sym::contract_check_requires,      contract_check_requires_fn,      Target::Fn, GenericRequirement::None;
 }
 
 pub enum GenericRequirement {