Remove unnecessary .clone()
This commit is contained in:
parent
165842ba1f
commit
6a0abd6048
14 changed files with 14 additions and 14 deletions
|
@ -307,7 +307,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
|
|
||||||
let required_region_bounds = tcx.required_region_bounds(
|
let required_region_bounds = tcx.required_region_bounds(
|
||||||
opaque_type,
|
opaque_type,
|
||||||
bounds.predicates.clone(),
|
bounds.predicates,
|
||||||
);
|
);
|
||||||
debug_assert!(!required_region_bounds.is_empty());
|
debug_assert!(!required_region_bounds.is_empty());
|
||||||
|
|
||||||
|
|
|
@ -1617,7 +1617,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
||||||
self.ir.tcx.lint_hir_note(
|
self.ir.tcx.lint_hir_note(
|
||||||
lint::builtin::UNUSED_VARIABLES,
|
lint::builtin::UNUSED_VARIABLES,
|
||||||
hir_id,
|
hir_id,
|
||||||
spans.clone(),
|
spans,
|
||||||
&format!("variable `{}` is assigned to, but never used", name),
|
&format!("variable `{}` is assigned to, but never used", name),
|
||||||
&format!("consider using `_{}` instead", name),
|
&format!("consider using `_{}` instead", name),
|
||||||
);
|
);
|
||||||
|
|
|
@ -36,7 +36,7 @@ fn owned_ptr_base_path<'a, 'tcx>(loan_path: &'a LoanPath<'tcx>) -> &'a LoanPath<
|
||||||
|
|
||||||
return match helper(loan_path) {
|
return match helper(loan_path) {
|
||||||
Some(new_loan_path) => new_loan_path,
|
Some(new_loan_path) => new_loan_path,
|
||||||
None => loan_path.clone()
|
None => loan_path,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn helper<'a, 'tcx>(loan_path: &'a LoanPath<'tcx>) -> Option<&'a LoanPath<'tcx>> {
|
fn helper<'a, 'tcx>(loan_path: &'a LoanPath<'tcx>) -> Option<&'a LoanPath<'tcx>> {
|
||||||
|
|
|
@ -279,7 +279,7 @@ fn fat_lto(cgcx: &CodegenContext<LlvmCodegenBackend>,
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
serialized_modules.extend(cached_modules.into_iter().map(|(buffer, wp)| {
|
serialized_modules.extend(cached_modules.into_iter().map(|(buffer, wp)| {
|
||||||
(buffer, CString::new(wp.cgu_name.clone()).unwrap())
|
(buffer, CString::new(wp.cgu_name).unwrap())
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// For all serialized bitcode files we parse them and link them in as we did
|
// For all serialized bitcode files we parse them and link them in as we did
|
||||||
|
|
|
@ -459,7 +459,7 @@ impl CodegenCx<'b, 'tcx> {
|
||||||
};
|
};
|
||||||
let f = self.declare_cfn(name, fn_ty);
|
let f = self.declare_cfn(name, fn_ty);
|
||||||
llvm::SetUnnamedAddr(f, false);
|
llvm::SetUnnamedAddr(f, false);
|
||||||
self.intrinsics.borrow_mut().insert(name, f.clone());
|
self.intrinsics.borrow_mut().insert(name, f);
|
||||||
f
|
f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1609,7 +1609,7 @@ impl<'tcx> VariantInfo<'tcx> {
|
||||||
// with every variant, make each variant name be just the value
|
// with every variant, make each variant name be just the value
|
||||||
// of the discriminant. The struct name for the variant includes
|
// of the discriminant. The struct name for the variant includes
|
||||||
// the actual variant description.
|
// the actual variant description.
|
||||||
format!("{}", variant_index.as_usize()).to_string()
|
format!("{}", variant_index.as_usize())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@ impl AnnotateSnippetEmitterWriter {
|
||||||
let converter = DiagnosticConverter {
|
let converter = DiagnosticConverter {
|
||||||
source_map: self.source_map.clone(),
|
source_map: self.source_map.clone(),
|
||||||
level: level.clone(),
|
level: level.clone(),
|
||||||
message: message.clone(),
|
message,
|
||||||
code: code.clone(),
|
code: code.clone(),
|
||||||
msp: msp.clone(),
|
msp: msp.clone(),
|
||||||
children,
|
children,
|
||||||
|
|
|
@ -236,7 +236,7 @@ impl<'a> CrateLoader<'a> {
|
||||||
let host_lib = host_lib.unwrap();
|
let host_lib = host_lib.unwrap();
|
||||||
self.load_derive_macros(
|
self.load_derive_macros(
|
||||||
&host_lib.metadata.get_root(),
|
&host_lib.metadata.get_root(),
|
||||||
host_lib.dylib.clone().map(|p| p.0),
|
host_lib.dylib.map(|p| p.0),
|
||||||
span
|
span
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1737,7 +1737,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
pat_span,
|
pat_span,
|
||||||
}))),
|
}))),
|
||||||
};
|
};
|
||||||
let for_arm_body = self.local_decls.push(local.clone());
|
let for_arm_body = self.local_decls.push(local);
|
||||||
let locals = if has_guard.0 {
|
let locals = if has_guard.0 {
|
||||||
let ref_for_guard = self.local_decls.push(LocalDecl::<'tcx> {
|
let ref_for_guard = self.local_decls.push(LocalDecl::<'tcx> {
|
||||||
// This variable isn't mutated but has a name, so has to be
|
// This variable isn't mutated but has a name, so has to be
|
||||||
|
|
|
@ -922,7 +922,7 @@ fn receiver_is_valid<'fcx, 'tcx>(
|
||||||
};
|
};
|
||||||
|
|
||||||
let obligation = traits::Obligation::new(
|
let obligation = traits::Obligation::new(
|
||||||
cause.clone(),
|
cause,
|
||||||
fcx.param_env,
|
fcx.param_env,
|
||||||
trait_ref.to_predicate()
|
trait_ref.to_predicate()
|
||||||
);
|
);
|
||||||
|
|
|
@ -317,7 +317,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
|
||||||
// Ensure that rustdoc works even if rustc is feature-staged
|
// Ensure that rustdoc works even if rustc is feature-staged
|
||||||
unstable_features: UnstableFeatures::Allow,
|
unstable_features: UnstableFeatures::Allow,
|
||||||
actually_rustdoc: true,
|
actually_rustdoc: true,
|
||||||
debugging_opts: debugging_options.clone(),
|
debugging_opts: debugging_options,
|
||||||
error_format,
|
error_format,
|
||||||
edition,
|
edition,
|
||||||
describe_lints,
|
describe_lints,
|
||||||
|
|
|
@ -740,7 +740,7 @@ impl Tester for Collector {
|
||||||
debug!("Creating test {}: {}", name, test);
|
debug!("Creating test {}: {}", name, test);
|
||||||
self.tests.push(testing::TestDescAndFn {
|
self.tests.push(testing::TestDescAndFn {
|
||||||
desc: testing::TestDesc {
|
desc: testing::TestDesc {
|
||||||
name: testing::DynTestName(name.clone()),
|
name: testing::DynTestName(name),
|
||||||
ignore: config.ignore,
|
ignore: config.ignore,
|
||||||
// compiler failures are test failures
|
// compiler failures are test failures
|
||||||
should_panic: testing::ShouldPanic::No,
|
should_panic: testing::ShouldPanic::No,
|
||||||
|
|
|
@ -887,7 +887,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt<'_>,
|
||||||
};
|
};
|
||||||
|
|
||||||
let fmt_str = &*fmt.node.0.as_str(); // for the suggestions below
|
let fmt_str = &*fmt.node.0.as_str(); // for the suggestions below
|
||||||
let mut parser = parse::Parser::new(fmt_str, str_style, skips.clone(), append_newline);
|
let mut parser = parse::Parser::new(fmt_str, str_style, skips, append_newline);
|
||||||
|
|
||||||
let mut unverified_pieces = Vec::new();
|
let mut unverified_pieces = Vec::new();
|
||||||
while let Some(piece) = parser.next() {
|
while let Some(piece) = parser.next() {
|
||||||
|
|
|
@ -409,7 +409,7 @@ impl server::TokenStream for Rustc<'_> {
|
||||||
}
|
}
|
||||||
fn from_str(&mut self, src: &str) -> Self::TokenStream {
|
fn from_str(&mut self, src: &str) -> Self::TokenStream {
|
||||||
parse::parse_stream_from_source_str(
|
parse::parse_stream_from_source_str(
|
||||||
FileName::proc_macro_source_code(src.clone()),
|
FileName::proc_macro_source_code(src),
|
||||||
src.to_string(),
|
src.to_string(),
|
||||||
self.sess,
|
self.sess,
|
||||||
Some(self.call_site),
|
Some(self.call_site),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue