Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/builtin_fn_macro.rs')
| -rw-r--r-- | crates/hir-expand/src/builtin_fn_macro.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/hir-expand/src/builtin_fn_macro.rs b/crates/hir-expand/src/builtin_fn_macro.rs index c892f462d2..29d389f656 100644 --- a/crates/hir-expand/src/builtin_fn_macro.rs +++ b/crates/hir-expand/src/builtin_fn_macro.rs @@ -125,7 +125,7 @@ fn mk_pound(span: Span) -> tt::Subtree { vec![crate::tt::Leaf::Punct(crate::tt::Punct { char: '#', spacing: crate::tt::Spacing::Alone, - span: span, + span, }) .into()], span, @@ -279,9 +279,9 @@ fn format_args_expand_general( let pound = mk_pound(span); let mut tt = tt.clone(); tt.delimiter.kind = tt::DelimiterKind::Parenthesis; - return ExpandResult::ok(quote! {span => + ExpandResult::ok(quote! {span => builtin #pound format_args #tt - }); + }) } fn asm_expand( @@ -392,6 +392,7 @@ fn unreachable_expand( ExpandResult::ok(call) } +#[allow(clippy::never_loop)] fn use_panic_2021(db: &dyn ExpandDatabase, span: Span) -> bool { // To determine the edition, we check the first span up the expansion // stack that does not have #[allow_internal_unstable(edition_panic)]. @@ -624,7 +625,7 @@ fn relative_file( fn parse_string(tt: &tt::Subtree) -> Result<String, ExpandError> { tt.token_trees - .get(0) + .first() .and_then(|tt| match tt { tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => unquote_str(it), _ => None, |