Skip to content

Commit a6d926d

Browse files
committed
Fix tests
1 parent f49ed7a commit a6d926d

File tree

17 files changed

+32
-17
lines changed

17 files changed

+32
-17
lines changed

compiler/rustc_codegen_ssa/src/back/rpath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn get_rpath_flags(config: &mut RPathConfig<'_>) -> Vec<String> {
2424

2525
debug!("preparing the RPATH!");
2626

27-
let libs = config.used_crates.clone();
27+
let libs = config.used_crates;
2828
let libs = libs.iter().filter_map(|&(_, ref l)| l.option()).collect::<Vec<_>>();
2929
let rpaths = get_rpaths(config, &libs);
3030
let mut flags = rpaths_to_flags(&rpaths);

compiler/rustc_lint/src/noop_method_call.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
4646
{
4747
// Check that we're dealing with a trait method
4848
if let Some(trait_id) = cx.tcx.trait_of_item(did) {
49+
// Check we're dealing with one of the traits we care about
50+
if ![sym::Clone, sym::Deref, sym::Borrow]
51+
.iter()
52+
.any(|s| cx.tcx.is_diagnostic_item(*s, trait_id))
53+
{
54+
return;
55+
}
56+
4957
let substs = cx.typeck_results().node_substs(expr.hir_id);
5058
// We can't resolve on types that recursively require monomorphization,
5159
// so check that we don't need to perfom substitution
@@ -54,7 +62,6 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
5462
// Resolve the trait method instance
5563
if let Ok(Some(i)) = ty::Instance::resolve(cx.tcx, param_env, did, substs) {
5664
// Check that it implements the noop diagnostic
57-
tracing::debug!("Resolves to: {:?}", i.def_id());
5865
if [
5966
sym::noop_method_borrow,
6067
sym::noop_method_clone,

compiler/rustc_middle/src/ty/error.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use rustc_target::spec::abi;
1212

1313
use std::borrow::Cow;
1414
use std::fmt;
15-
use std::ops::Deref;
1615

1716
#[derive(Clone, Copy, Debug, PartialEq, Eq, TypeFoldable)]
1817
pub struct ExpectedFound<T> {
@@ -548,7 +547,6 @@ impl<T> Trait<T> for X {
548547
TargetFeatureCast(def_id) => {
549548
let attrs = self.get_attrs(*def_id);
550549
let target_spans = attrs
551-
.deref()
552550
.iter()
553551
.filter(|attr| attr.has_name(sym::target_feature))
554552
.map(|attr| attr.span);

compiler/rustc_mir/src/borrow_check/invalidation.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
165165
self.consume_operand(location, value);
166166

167167
// Invalidate all borrows of local places
168-
let borrow_set = self.borrow_set.clone();
168+
let borrow_set = self.borrow_set;
169169
let resume = self.location_table.start_index(resume.start_location());
170170
for (i, data) in borrow_set.iter_enumerated() {
171171
if borrow_of_local_data(data.borrowed_place) {
@@ -177,7 +177,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
177177
}
178178
TerminatorKind::Resume | TerminatorKind::Return | TerminatorKind::GeneratorDrop => {
179179
// Invalidate all borrows of local places
180-
let borrow_set = self.borrow_set.clone();
180+
let borrow_set = self.borrow_set;
181181
let start = self.location_table.start_index(location);
182182
for (i, data) in borrow_set.iter_enumerated() {
183183
if borrow_of_local_data(data.borrowed_place) {
@@ -369,15 +369,15 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
369369
);
370370
let tcx = self.tcx;
371371
let body = self.body;
372-
let borrow_set = self.borrow_set.clone();
372+
let borrow_set = self.borrow_set;
373373
let indices = self.borrow_set.indices();
374374
each_borrow_involving_path(
375375
self,
376376
tcx,
377377
body,
378378
location,
379379
(sd, place),
380-
&borrow_set.clone(),
380+
borrow_set,
381381
indices,
382382
|this, borrow_index, borrow| {
383383
match (rw, borrow.kind) {

compiler/rustc_mir_build/src/build/matches/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
5151

5252
PatKind::Constant { value } => Test {
5353
span: match_pair.pattern.span,
54-
kind: TestKind::Eq { value, ty: match_pair.pattern.ty.clone() },
54+
kind: TestKind::Eq { value, ty: match_pair.pattern.ty },
5555
},
5656

5757
PatKind::Range(range) => {

compiler/rustc_span/src/symbol.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ symbols! {
129129
BTreeMap,
130130
BTreeSet,
131131
BinaryHeap,
132+
Borrow,
132133
C,
133134
CString,
134135
Center,
@@ -141,6 +142,7 @@ symbols! {
141142
Decodable,
142143
Decoder,
143144
Default,
145+
Deref,
144146
Encodable,
145147
Encoder,
146148
Eq,

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
819819
sig.decl
820820
.inputs
821821
.iter()
822-
.map(|arg| match arg.clone().kind {
822+
.map(|arg| match arg.kind {
823823
hir::TyKind::Tup(ref tys) => ArgKind::Tuple(
824824
Some(arg.span),
825825
vec![("_".to_owned(), "_".to_owned()); tys.len()],

compiler/rustc_traits/src/chalk/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ crate fn evaluate_goal<'tcx>(
165165
// let's just ignore that
166166
let sol = Canonical {
167167
max_universe: ty::UniverseIndex::from_usize(0),
168-
variables: obligation.variables.clone(),
168+
variables: obligation.variables,
169169
value: QueryResponse {
170170
var_values: CanonicalVarValues { var_values: IndexVec::new() }
171171
.make_identity(tcx),

compiler/rustc_typeck/src/check/callee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
465465
let expected_arg_tys = self.expected_inputs_for_expected_output(
466466
call_expr.span,
467467
expected,
468-
fn_sig.output().clone(),
468+
fn_sig.output(),
469469
fn_sig.inputs(),
470470
);
471471

compiler/rustc_typeck/src/check/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
711711
});
712712

713713
let ret_ty = ret_coercion.borrow().expected_ty();
714-
let return_expr_ty = self.check_expr_with_hint(return_expr, ret_ty.clone());
714+
let return_expr_ty = self.check_expr_with_hint(return_expr, ret_ty);
715715
ret_coercion.borrow_mut().coerce(
716716
self,
717717
&self.cause(return_expr.span, ObligationCauseCode::ReturnValue(return_expr.hir_id)),

0 commit comments

Comments
 (0)