1
Fork 0

[breaking-change] don't glob import ast::FunctionRetTy variants

This commit is contained in:
Oliver Schneider 2016-02-08 15:04:11 +01:00
parent 05e25de4f0
commit 3b57d40fe5
10 changed files with 40 additions and 41 deletions

View file

@ -16,7 +16,6 @@ pub use self::Decl_::*;
pub use self::ExplicitSelf_::*;
pub use self::Expr_::*;
pub use self::FloatTy::*;
pub use self::FunctionRetTy::*;
pub use self::ForeignItem_::*;
pub use self::IntTy::*;
pub use self::Item_::*;
@ -1727,23 +1726,23 @@ impl fmt::Debug for ImplPolarity {
pub enum FunctionRetTy {
/// Functions with return type `!`that always
/// raise an error or exit (i.e. never return to the caller)
NoReturn(Span),
None(Span),
/// Return type is not specified.
///
/// Functions default to `()` and
/// closures default to inference. Span points to where return
/// type would be inserted.
DefaultReturn(Span),
Default(Span),
/// Everything else
Return(P<Ty>),
Ty(P<Ty>),
}
impl FunctionRetTy {
pub fn span(&self) -> Span {
match *self {
NoReturn(span) => span,
DefaultReturn(span) => span,
Return(ref ty) => ty.span
FunctionRetTy::None(span) => span,
FunctionRetTy::Default(span) => span,
FunctionRetTy::Ty(ref ty) => ty.span,
}
}
}