Implement RFC 1861: Extern types

This commit is contained in:
Paul Lietar
2017-09-03 19:53:58 +01:00
committed by Paul Liétar
parent bed9a85c40
commit 77f7e85d7f
81 changed files with 737 additions and 120 deletions

View File

@@ -2007,13 +2007,16 @@ pub enum ForeignItemKind {
/// A foreign static item (`static ext: u8`), with optional mutability
/// (the boolean is true when mutable)
Static(P<Ty>, bool),
/// A foreign type
Ty,
}
impl ForeignItemKind {
pub fn descriptive_variant(&self) -> &str {
match *self {
ForeignItemKind::Fn(..) => "foreign function",
ForeignItemKind::Static(..) => "foreign static item"
ForeignItemKind::Static(..) => "foreign static item",
ForeignItemKind::Ty => "foreign type",
}
}
}