diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-10-10 17:33:19 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-10-14 12:51:13 +0300 |
| commit | e6115af4bd5f07024e0b73139e1dbcd68c96d9f7 (patch) | |
| tree | caead936dd84ba0d4492222d3c3bd6da121dffd3 /src/libsyntax/parse/token.rs | |
| parent | 3037965b5bb762b6ed0dc860aefe01b664943ce8 (diff) | |
| download | rust-e6115af4bd5f07024e0b73139e1dbcd68c96d9f7.tar.gz rust-e6115af4bd5f07024e0b73139e1dbcd68c96d9f7.zip | |
Implement `dyn Trait` syntax
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 4888654fac9..20db87cfc82 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -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 { |
