mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add more tests, refactor array lengths/consteval work
Fix #2922: add unknown length as a condition for a type having unknown. Incorporate reviews: * Extract some of the const evaluation workings into functions * Add fixmes on the hacks * Add tests for impls on specific array lengths (these work!!! 😁) * Add tests for const generics (indeed we don't support it yet)
This commit is contained in:
parent
32c600664e
commit
78d6b88f21
8 changed files with 223 additions and 35 deletions
|
@ -52,7 +52,9 @@ use hir_def::{
|
|||
};
|
||||
use hir_expand::{diagnostics::DiagnosticSink, name::name, MacroDefKind};
|
||||
use hir_ty::{
|
||||
autoderef, could_unify,
|
||||
autoderef,
|
||||
consteval::ConstExtension,
|
||||
could_unify,
|
||||
method_resolution::{self, def_crates, TyFingerprint},
|
||||
primitive::UintTy,
|
||||
subst_prefix,
|
||||
|
@ -1910,6 +1912,7 @@ impl Type {
|
|||
substs.iter(&Interner).filter_map(|a| a.ty(&Interner)).any(go)
|
||||
}
|
||||
|
||||
TyKind::Array(_ty, len) if len.is_unknown() => true,
|
||||
TyKind::Array(ty, _)
|
||||
| TyKind::Slice(ty)
|
||||
| TyKind::Raw(_, ty)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue