Implement dyn Trait
syntax
This commit is contained in:
parent
3037965b5b
commit
e6115af4bd
17 changed files with 149 additions and 41 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue