fix clippy::clone_on_ref_ptr for compiler
This commit is contained in:
parent
0bff99403c
commit
746b675c5a
33 changed files with 98 additions and 91 deletions
|
@ -622,7 +622,7 @@ impl TtParser {
|
|||
// possible next positions into `next_mps`. After some post-processing, the contents of
|
||||
// `next_mps` replenish `cur_mps` and we start over again.
|
||||
self.cur_mps.clear();
|
||||
self.cur_mps.push(MatcherPos { idx: 0, matches: self.empty_matches.clone() });
|
||||
self.cur_mps.push(MatcherPos { idx: 0, matches: Rc::clone(&self.empty_matches) });
|
||||
|
||||
loop {
|
||||
self.next_mps.clear();
|
||||
|
|
|
@ -5,6 +5,7 @@ use rustc_ast::mut_visit::{self, MutVisitor};
|
|||
use rustc_ast::token::{self, Delimiter, IdentIsRaw, Lit, LitKind, Nonterminal, Token, TokenKind};
|
||||
use rustc_ast::tokenstream::{DelimSpacing, DelimSpan, Spacing, TokenStream, TokenTree};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_errors::{Diag, DiagCtxtHandle, PResult, pluralize};
|
||||
use rustc_parse::lexer::nfc_normalize;
|
||||
use rustc_parse::parser::ParseNtResult;
|
||||
|
@ -293,7 +294,7 @@ pub(super) fn transcribe<'a>(
|
|||
// `Delimiter::Invisible` to maintain parsing priorities.
|
||||
// `Interpolated` is currently used for such groups in rustc parser.
|
||||
marker.visit_span(&mut sp);
|
||||
TokenTree::token_alone(token::Interpolated(nt.clone()), sp)
|
||||
TokenTree::token_alone(token::Interpolated(Lrc::clone(nt)), sp)
|
||||
}
|
||||
MatchedSeq(..) => {
|
||||
// We were unable to descend far enough. This is an error.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue