Enum rustc_parse::parser::ty::RecoverReturnSign [−][src]
pub(super) enum RecoverReturnSign {
Yes,
OnlyFatArrow,
No,
}Expand description
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
Implementations
impl RecoverReturnSign[src]
impl RecoverReturnSign[src]fn can_recover(self, token: &TokenKind) -> bool[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 Clone for RecoverReturnSign[src]fn clone(&self) -> RecoverReturnSign[src]
fn clone(&self) -> RecoverReturnSign[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl PartialEq<RecoverReturnSign> for RecoverReturnSign[src]
impl PartialEq<RecoverReturnSign> for RecoverReturnSign[src]impl Copy 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> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more