Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/items.rs')
| -rw-r--r-- | crates/parser/src/grammar/items.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs index 7bfd9ef8c8..5e0951bf8b 100644 --- a/crates/parser/src/grammar/items.rs +++ b/crates/parser/src/grammar/items.rs @@ -17,7 +17,7 @@ use super::*; // foo::bar!(); // super::baz! {} // struct S; -pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) { +pub(super) fn mod_contents(p: &mut Parser<'_>, stop_on_r_curly: bool) { attributes::inner_attrs(p); while !p.at(EOF) && !(p.at(T!['}']) && stop_on_r_curly) { item_or_macro(p, stop_on_r_curly); @@ -41,7 +41,7 @@ pub(super) const ITEM_RECOVERY_SET: TokenSet = TokenSet::new(&[ T![;], ]); -pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool) { +pub(super) fn item_or_macro(p: &mut Parser<'_>, stop_on_r_curly: bool) { let m = p.start(); attributes::outer_attrs(p); @@ -84,7 +84,7 @@ pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool) { } /// Try to parse an item, completing `m` in case of success. -pub(super) fn opt_item(p: &mut Parser, m: Marker) -> Result<(), Marker> { +pub(super) fn opt_item(p: &mut Parser<'_>, m: Marker) -> Result<(), Marker> { // test_err pub_expr // fn foo() { pub 92; } let has_visibility = opt_visibility(p, false); @@ -214,7 +214,7 @@ pub(super) fn opt_item(p: &mut Parser, m: Marker) -> Result<(), Marker> { Ok(()) } -fn opt_item_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { +fn opt_item_without_modifiers(p: &mut Parser<'_>, m: Marker) -> Result<(), Marker> { let la = p.nth(1); match p.current() { T![extern] if la == T![crate] => extern_crate(p, m), @@ -239,7 +239,7 @@ fn opt_item_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { // test extern_crate // extern crate foo; -fn extern_crate(p: &mut Parser, m: Marker) { +fn extern_crate(p: &mut Parser<'_>, m: Marker) { p.bump(T![extern]); p.bump(T![crate]); @@ -262,7 +262,7 @@ fn extern_crate(p: &mut Parser, m: Marker) { // test mod_item // mod a; -pub(crate) fn mod_item(p: &mut Parser, m: Marker) { +pub(crate) fn mod_item(p: &mut Parser<'_>, m: Marker) { p.bump(T![mod]); name(p); if p.at(T!['{']) { @@ -277,7 +277,7 @@ pub(crate) fn mod_item(p: &mut Parser, m: Marker) { // test type_alias // type Foo = Bar; -fn type_alias(p: &mut Parser, m: Marker) { +fn type_alias(p: &mut Parser<'_>, m: Marker) { p.bump(T![type]); name(p); @@ -305,7 +305,7 @@ fn type_alias(p: &mut Parser, m: Marker) { m.complete(p, TYPE_ALIAS); } -pub(crate) fn item_list(p: &mut Parser) { +pub(crate) fn item_list(p: &mut Parser<'_>) { assert!(p.at(T!['{'])); let m = p.start(); p.bump(T!['{']); @@ -314,7 +314,7 @@ pub(crate) fn item_list(p: &mut Parser) { m.complete(p, ITEM_LIST); } -pub(crate) fn extern_item_list(p: &mut Parser) { +pub(crate) fn extern_item_list(p: &mut Parser<'_>) { assert!(p.at(T!['{'])); let m = p.start(); p.bump(T!['{']); @@ -323,7 +323,7 @@ pub(crate) fn extern_item_list(p: &mut Parser) { m.complete(p, EXTERN_ITEM_LIST); } -fn macro_rules(p: &mut Parser, m: Marker) { +fn macro_rules(p: &mut Parser<'_>, m: Marker) { assert!(p.at_contextual_kw(T![macro_rules])); p.bump_remap(T![macro_rules]); p.expect(T![!]); @@ -358,7 +358,7 @@ fn macro_rules(p: &mut Parser, m: Marker) { // test macro_def // macro m($i:ident) {} -fn macro_def(p: &mut Parser, m: Marker) { +fn macro_def(p: &mut Parser<'_>, m: Marker) { p.expect(T![macro]); name_r(p, ITEM_RECOVERY_SET); if p.at(T!['{']) { @@ -382,7 +382,7 @@ fn macro_def(p: &mut Parser, m: Marker) { // test fn // fn foo() {} -fn fn_(p: &mut Parser, m: Marker) { +fn fn_(p: &mut Parser<'_>, m: Marker) { p.bump(T![fn]); name_r(p, ITEM_RECOVERY_SET); @@ -414,13 +414,13 @@ fn fn_(p: &mut Parser, m: Marker) { m.complete(p, FN); } -fn macro_call(p: &mut Parser) -> BlockLike { +fn macro_call(p: &mut Parser<'_>) -> BlockLike { assert!(paths::is_use_path_start(p)); paths::use_path(p); macro_call_after_excl(p) } -pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike { +pub(super) fn macro_call_after_excl(p: &mut Parser<'_>) -> BlockLike { p.expect(T![!]); match p.current() { @@ -439,7 +439,7 @@ pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike { } } -pub(crate) fn token_tree(p: &mut Parser) { +pub(crate) fn token_tree(p: &mut Parser<'_>) { let closing_paren_kind = match p.current() { T!['{'] => T!['}'], T!['('] => T![')'], |