We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
is_primitive
primitive_type()
1 parent 7f4afdf commit 909a33dCopy full SHA for 909a33d
src/librustdoc/clean/types.rs
@@ -1413,7 +1413,6 @@ impl Type {
1413
}
1414
1415
RawPointer(..) => Some(PrimitiveType::RawPointer),
1416
- BorrowedRef { type_: box Generic(..), .. } => Some(PrimitiveType::Reference),
1417
BareFunction(..) => Some(PrimitiveType::Fn),
1418
Never => Some(PrimitiveType::Never),
1419
_ => None,
@@ -1472,13 +1471,7 @@ impl Type {
1472
1471
1473
1474
crate fn is_primitive(&self) -> bool {
1475
- match self {
1476
- Self::Primitive(_) => true,
1477
- Self::BorrowedRef { ref type_, .. } | Self::RawPointer(_, ref type_) => {
1478
- type_.is_primitive()
1479
- }
1480
- _ => false,
1481
+ self.primitive_type().is_some()
1482
1483
1484
crate fn projection(&self) -> Option<(&Type, DefId, Symbol)> {
0 commit comments