1
Fork 0

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.
This commit is contained in:
Felix S. Klock II 2024-12-02 21:16:35 +00:00 committed by Celina G. Val
parent bcb8565f30
commit 777def87d5
5 changed files with 90 additions and 0 deletions

View file

@ -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 {