1
Fork 0

Implement dyn Trait syntax

This commit is contained in:
Vadim Petrochenkov 2017-10-10 17:33:19 +03:00
parent 3037965b5b
commit e6115af4bd
17 changed files with 149 additions and 41 deletions

View file

@ -258,6 +258,12 @@ impl Token {
}
}
/// Returns `true` if the token can appear at the start of a generic bound.
pub fn can_begin_bound(&self) -> bool {
self.is_path_start() || self.is_lifetime() || self.is_keyword(keywords::For) ||
self == &Question || self == &OpenDelim(Paren)
}
/// Returns `true` if the token is any literal
pub fn is_lit(&self) -> bool {
match *self {