mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Truncate closure capture place for raw pointer
This commit is contained in:
parent
7059ae2fc2
commit
3bcdb7d886
3 changed files with 48 additions and 0 deletions
|
@ -28,6 +28,7 @@ pub trait TyExt {
|
|||
fn is_unknown(&self) -> bool;
|
||||
fn contains_unknown(&self) -> bool;
|
||||
fn is_ty_var(&self) -> bool;
|
||||
fn is_union(&self) -> bool;
|
||||
|
||||
fn as_adt(&self) -> Option<(hir_def::AdtId, &Substitution)>;
|
||||
fn as_builtin(&self) -> Option<BuiltinType>;
|
||||
|
@ -96,6 +97,10 @@ impl TyExt for Ty {
|
|||
matches!(self.kind(Interner), TyKind::InferenceVar(_, _))
|
||||
}
|
||||
|
||||
fn is_union(&self) -> bool {
|
||||
matches!(self.adt_id(Interner), Some(AdtId(hir_def::AdtId::UnionId(_))))
|
||||
}
|
||||
|
||||
fn as_adt(&self) -> Option<(hir_def::AdtId, &Substitution)> {
|
||||
match self.kind(Interner) {
|
||||
TyKind::Adt(AdtId(adt), parameters) => Some((*adt, parameters)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue