Skip to content

Commit 205a0d3

Browse files
Rollup merge of #84465 - jyn514:primitive, r=GuillaumeGomez
rustdoc: Implement `is_primitive` in terms of `primitive_type()` Previously, they disagreed about what types were primitives. r? `@GuillaumeGomez`
2 parents 266f452 + 909a33d commit 205a0d3

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/librustdoc/clean/types.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,6 @@ impl Type {
16061606
}
16071607
}
16081608
RawPointer(..) => Some(PrimitiveType::RawPointer),
1609-
BorrowedRef { type_: box Generic(..), .. } => Some(PrimitiveType::Reference),
16101609
BareFunction(..) => Some(PrimitiveType::Fn),
16111610
Never => Some(PrimitiveType::Never),
16121611
_ => None,
@@ -1665,13 +1664,7 @@ impl Type {
16651664
}
16661665

16671666
crate fn is_primitive(&self) -> bool {
1668-
match self {
1669-
Self::Primitive(_) => true,
1670-
Self::BorrowedRef { ref type_, .. } | Self::RawPointer(_, ref type_) => {
1671-
type_.is_primitive()
1672-
}
1673-
_ => false,
1674-
}
1667+
self.primitive_type().is_some()
16751668
}
16761669

16771670
crate fn projection(&self) -> Option<(&Type, DefId, Symbol)> {

0 commit comments

Comments
 (0)