Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/lib.rs')
-rw-r--r--crates/hir-ty/src/lib.rs21
1 files changed, 20 insertions, 1 deletions
diff --git a/crates/hir-ty/src/lib.rs b/crates/hir-ty/src/lib.rs
index 3c18ea9281..55d81875a2 100644
--- a/crates/hir-ty/src/lib.rs
+++ b/crates/hir-ty/src/lib.rs
@@ -100,7 +100,9 @@ pub use mapping::{
};
pub use method_resolution::check_orphan_rules;
pub use traits::TraitEnvironment;
-pub use utils::{all_super_traits, direct_super_traits, is_fn_unsafe_to_call};
+pub use utils::{
+ all_super_traits, direct_super_traits, is_fn_unsafe_to_call, TargetFeatures, Unsafety,
+};
pub use variance::Variance;
pub use chalk_ir::{
@@ -1047,3 +1049,20 @@ pub fn known_const_to_ast(
}
Some(make::expr_const_value(konst.display(db, edition).to_string().as_str()))
}
+
+#[derive(Debug, Copy, Clone)]
+pub(crate) enum DeclOrigin {
+ LetExpr,
+ /// from `let x = ..`
+ LocalDecl {
+ has_else: bool,
+ },
+}
+
+/// Provides context for checking patterns in declarations. More specifically this
+/// allows us to infer array types if the pattern is irrefutable and allows us to infer
+/// the size of the array. See issue rust-lang/rust#76342.
+#[derive(Debug, Copy, Clone)]
+pub(crate) struct DeclContext {
+ pub(crate) origin: DeclOrigin,
+}