mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Use clone to clone DelimArgs in two places.
This commit is contained in:
@@ -916,7 +916,7 @@ fn alias_attrs(&mut self, id: HirId, target_id: HirId) {
|
||||
}
|
||||
|
||||
fn lower_delim_args(&self, args: &DelimArgs) -> DelimArgs {
|
||||
DelimArgs { dspan: args.dspan, delim: args.delim, tokens: args.tokens.clone() }
|
||||
args.clone()
|
||||
}
|
||||
|
||||
/// Lower an associated item constraint.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use std::ops::Deref;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use rustc_ast::{self as ast, DelimArgs};
|
||||
use rustc_ast as ast;
|
||||
use rustc_attr_data_structures::AttributeKind;
|
||||
use rustc_errors::{DiagCtxtHandle, Diagnostic};
|
||||
use rustc_feature::Features;
|
||||
@@ -315,11 +315,7 @@ pub fn parse_attribute_list<'a>(
|
||||
fn lower_attr_args(&self, args: &ast::AttrArgs, lower_span: impl Fn(Span) -> Span) -> AttrArgs {
|
||||
match args {
|
||||
ast::AttrArgs::Empty => AttrArgs::Empty,
|
||||
ast::AttrArgs::Delimited(args) => AttrArgs::Delimited(DelimArgs {
|
||||
dspan: args.dspan,
|
||||
delim: args.delim,
|
||||
tokens: args.tokens.clone(),
|
||||
}),
|
||||
ast::AttrArgs::Delimited(args) => AttrArgs::Delimited(args.clone()),
|
||||
// This is an inert key-value attribute - it will never be visible to macros
|
||||
// after it gets lowered to HIR. Therefore, we can extract literals to handle
|
||||
// nonterminals in `#[doc]` (e.g. `#[doc = $e]`).
|
||||
|
||||
Reference in New Issue
Block a user