Enum rustc_parse::parser::ty::RecoverReturnSign[−][src]

pub(super) enum RecoverReturnSign {
    Yes,
    OnlyFatArrow,
    No,
}

Signals whether parsing a type should recover ->.

More specifically, when parsing a function like:

fn foo() => u8 { 0 }
fn bar(): u8 { 0 }

The compiler will try to recover interpreting foo() => u8 as foo() -> u8 when calling parse_ty with anything except RecoverReturnSign::No, and it will try to recover bar(): u8 as bar() -> u8 when passing RecoverReturnSign::Yes to parse_ty

Variants

Yes
OnlyFatArrow
No

Implementations

impl RecoverReturnSign[src]

fn can_recover(self, token: &TokenKind) -> bool[src]

RecoverReturnSign::Yes allows for recovering fn foo() => u8 and fn foo(): u8, RecoverReturnSign::OnlyFatArrow allows for recovering only fn foo() => u8 (recovering colons can cause problems when parsing where clauses), and RecoverReturnSign::No doesn’t allow for any recovery of the return type arrow

Trait Implementations

impl Clone for RecoverReturnSign[src]

impl Copy for RecoverReturnSign[src]

impl PartialEq<RecoverReturnSign> for RecoverReturnSign[src]

impl StructuralPartialEq for RecoverReturnSign[src]

Auto Trait Implementations

impl RefUnwindSafe for RecoverReturnSign

impl Send for RecoverReturnSign

impl Sync for RecoverReturnSign

impl Unpin for RecoverReturnSign

impl UnwindSafe for RecoverReturnSign

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.