mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Improve generics handling in term search
This commit is contained in:
parent
1d3558bfe1
commit
8bd30e9b3f
6 changed files with 136 additions and 73 deletions
|
@ -3856,6 +3856,11 @@ impl Type {
|
|||
Type { env: ty.env, ty: TyBuilder::slice(ty.ty) }
|
||||
}
|
||||
|
||||
pub fn new_tuple(krate: CrateId, tys: &[Type]) -> Type {
|
||||
let tys = tys.iter().map(|it| it.ty.clone());
|
||||
Type { env: TraitEnvironment::empty(krate), ty: TyBuilder::tuple_with(tys) }
|
||||
}
|
||||
|
||||
pub fn is_unit(&self) -> bool {
|
||||
matches!(self.ty.kind(Interner), TyKind::Tuple(0, ..))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue