diff options
| author | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2025-01-27 06:06:06 +0800 |
|---|---|---|
| committer | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2025-02-09 20:40:41 +0800 |
| commit | de405dcb8fbcd0add1e60c75800dac9b8fbe4884 (patch) | |
| tree | a2f982a559cd78d48a2add7cfeefb7630e471f34 /compiler/rustc_hir/src/lang_items.rs | |
| parent | 43ca9d18e333797f0aa3b525501a7cec8d61a96b (diff) | |
| download | rust-de405dcb8fbcd0add1e60c75800dac9b8fbe4884.tar.gz rust-de405dcb8fbcd0add1e60c75800dac9b8fbe4884.zip | |
introduce CoercePointeeWellformed for coherence checks at typeck stage
Diffstat (limited to 'compiler/rustc_hir/src/lang_items.rs')
| -rw-r--r-- | compiler/rustc_hir/src/lang_items.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs index b6689c95c4b..b18e96646b1 100644 --- a/compiler/rustc_hir/src/lang_items.rs +++ b/compiler/rustc_hir/src/lang_items.rs @@ -370,6 +370,8 @@ language_item_table! { PointerLike, sym::pointer_like, pointer_like, Target::Trait, GenericRequirement::Exact(0); + CoercePointeeWellformed, sym::coerce_pointee_wellformed, coerce_pointee_wellformed_trait, Target::Trait, GenericRequirement::Exact(0); + ConstParamTy, sym::const_param_ty, const_param_ty_trait, Target::Trait, GenericRequirement::Exact(0); UnsizedConstParamTy, sym::unsized_const_param_ty, unsized_const_param_ty_trait, Target::Trait, GenericRequirement::Exact(0); @@ -429,9 +431,13 @@ language_item_table! { ContractCheckRequires, sym::contract_check_requires, contract_check_requires_fn, Target::Fn, GenericRequirement::None; } +/// The requirement imposed on the generics of a lang item pub enum GenericRequirement { + /// No restriction on the generics None, + /// A minimum number of generics that is demanded on a lang item Minimum(usize), + /// The number of generics must match precisely as stipulated Exact(usize), } |
