mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Move Ty::fn_ptr to TyBuilder
This commit is contained in:
parent
b0fe3d929f
commit
e6f007d9a8
2 changed files with 12 additions and 11 deletions
|
@ -818,14 +818,8 @@ impl TyBuilder {
|
|||
pub fn unit() -> Ty {
|
||||
TyKind::Tuple(0, Substitution::empty(&Interner)).intern(&Interner)
|
||||
}
|
||||
}
|
||||
|
||||
impl Ty {
|
||||
pub fn adt_ty(adt: hir_def::AdtId, substs: Substitution) -> Ty {
|
||||
TyKind::Adt(AdtId(adt), substs).intern(&Interner)
|
||||
}
|
||||
|
||||
pub fn fn_ptr(sig: CallableSig) -> Self {
|
||||
pub fn fn_ptr(sig: CallableSig) -> Ty {
|
||||
TyKind::Function(FnPointer {
|
||||
num_args: sig.params().len(),
|
||||
sig: FnSig { abi: (), safety: Safety::Safe, variadic: sig.is_varargs },
|
||||
|
@ -833,6 +827,12 @@ impl Ty {
|
|||
})
|
||||
.intern(&Interner)
|
||||
}
|
||||
}
|
||||
|
||||
impl Ty {
|
||||
pub fn adt_ty(adt: hir_def::AdtId, substs: Substitution) -> Ty {
|
||||
TyKind::Adt(AdtId(adt), substs).intern(&Interner)
|
||||
}
|
||||
|
||||
pub fn builtin(builtin: BuiltinType) -> Self {
|
||||
match builtin {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue