1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
const ALL_CARDS: &'static [&'static char] = &["2"]
fn foo<'a> (first: &'a str, second: &'a str) => () { }
----------------------------------------------------
[
["keyword", "const"],
["constant", "ALL_CARDS"],
["punctuation", ":"],
["operator", "&"],
["lifetime-annotation", "'static"],
["punctuation", "["],
["operator", "&"],
["lifetime-annotation", "'static"],
["keyword", "char"],
["punctuation", "]"],
["operator", "="],
["operator", "&"],
["punctuation", "["],
["string", "\"2\""],
["punctuation", "]"],
["keyword", "fn"],
["function-definition", "foo"],
["operator", "<"],
["lifetime-annotation", "'a"],
["operator", ">"],
["punctuation", "("],
"first",
["punctuation", ":"],
["operator", "&"],
["lifetime-annotation", "'a"],
["keyword", "str"],
["punctuation", ","],
" second",
["punctuation", ":"],
["operator", "&"],
["lifetime-annotation", "'a"],
["keyword", "str"],
["punctuation", ")"],
["operator", "=>"],
["punctuation", "("],
["punctuation", ")"],
["punctuation", "{"],
["punctuation", "}"]
]
----------------------------------------------------
Checks for lifetime annotations in real-world examples. See #1339.