-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rust: Add support for lifetime-annotation and => operator. Fix #1339
- Loading branch information
Showing
7 changed files
with
90 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'a' | ||
'स' | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["char", "'a'"], | ||
["char", "'स'"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for chars. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const ALL_CARDS: &'static [&'static char] = &["2"] | ||
fn foo<'a> (first: &'a str, second: &'a str) => () { } | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "const"], | ||
" ALL_CARDS", | ||
["punctuation", ":"], | ||
["operator", "&"], | ||
["lifetime-annotation", "'static"], | ||
["punctuation", "["], | ||
["operator", "&"], | ||
["lifetime-annotation", "'static"], | ||
" char", | ||
["punctuation", "]"], | ||
["operator", "="], | ||
["operator", "&"], | ||
["punctuation", "["], | ||
["string", "\"2\""], | ||
["punctuation", "]"], | ||
["keyword", "fn"], | ||
" foo", | ||
["operator", "<"], | ||
["lifetime-annotation", "'a"], | ||
["operator", ">"], | ||
["punctuation", "("], | ||
"first", | ||
["punctuation", ":"], | ||
["operator", "&"], | ||
["lifetime-annotation", "'a"], | ||
" str", | ||
["punctuation", ","], | ||
" second", | ||
["punctuation", ":"], | ||
["operator", "&"], | ||
["lifetime-annotation", "'a"], | ||
" str", | ||
["punctuation", ")"], | ||
["operator", "=>"], | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", "{"], | ||
["punctuation", "}"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for lifetime annotations in real-world examples. See #1339. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'foo | ||
'a | ||
<'a> | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["lifetime-annotation", "'foo"], | ||
["lifetime-annotation", "'a"], | ||
["operator", "<"], ["lifetime-annotation", "'a"], ["operator", ">"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for lifetime annotations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters