未验证 提交 205a0d3a 编写于 作者: G Guillaume Gomez 提交者: GitHub

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`
......@@ -1606,7 +1606,6 @@ impl Type {
}
}
RawPointer(..) => Some(PrimitiveType::RawPointer),
BorrowedRef { type_: box Generic(..), .. } => Some(PrimitiveType::Reference),
BareFunction(..) => Some(PrimitiveType::Fn),
Never => Some(PrimitiveType::Never),
_ => None,
......@@ -1665,13 +1664,7 @@ impl Type {
}
crate fn is_primitive(&self) -> bool {
match self {
Self::Primitive(_) => true,
Self::BorrowedRef { ref type_, .. } | Self::RawPointer(_, ref type_) => {
type_.is_primitive()
}
_ => false,
}
self.primitive_type().is_some()
}
crate fn projection(&self) -> Option<(&Type, DefId, Symbol)> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册