mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Introduce TypeCtor::Scalar
This commit is contained in:
parent
2a4076c14d
commit
5183c9f083
13 changed files with 353 additions and 383 deletions
|
@ -4,7 +4,8 @@ use std::{borrow::Cow, fmt};
|
|||
|
||||
use crate::{
|
||||
db::HirDatabase, utils::generics, ApplicationTy, CallableDefId, FnSig, GenericPredicate,
|
||||
Lifetime, Obligation, OpaqueTy, OpaqueTyId, ProjectionTy, Substs, TraitRef, Ty, TypeCtor,
|
||||
Lifetime, Obligation, OpaqueTy, OpaqueTyId, ProjectionTy, Scalar, Substs, TraitRef, Ty,
|
||||
TypeCtor,
|
||||
};
|
||||
use arrayvec::ArrayVec;
|
||||
use hir_def::{
|
||||
|
@ -241,10 +242,11 @@ impl HirDisplay for ApplicationTy {
|
|||
}
|
||||
|
||||
match self.ctor {
|
||||
TypeCtor::Bool => write!(f, "bool")?,
|
||||
TypeCtor::Char => write!(f, "char")?,
|
||||
TypeCtor::Int(t) => write!(f, "{}", t)?,
|
||||
TypeCtor::Float(t) => write!(f, "{}", t)?,
|
||||
TypeCtor::Scalar(Scalar::Bool) => write!(f, "bool")?,
|
||||
TypeCtor::Scalar(Scalar::Char) => write!(f, "char")?,
|
||||
TypeCtor::Scalar(Scalar::Float(t)) => write!(f, "{}", t)?,
|
||||
TypeCtor::Scalar(Scalar::Int(t)) => write!(f, "{}", t)?,
|
||||
TypeCtor::Scalar(Scalar::Uint(t)) => write!(f, "{}", t)?,
|
||||
TypeCtor::Str => write!(f, "str")?,
|
||||
TypeCtor::Slice => {
|
||||
let t = self.parameters.as_single();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue