Skip to content

Commit 68fd3fe

Browse files
---
yaml --- r: 274838 b: refs/heads/stable c: 62bada4 h: refs/heads/master
1 parent b700266 commit 68fd3fe

File tree

6 files changed

+54
-54
lines changed

6 files changed

+54
-54
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: fbeb67985df7fadfb01dd2e3b0defe2fa0dfd9d4
32+
refs/heads/stable: 62bada40dec16bb47e2ea0a0d54f74389309512a
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/librustc_borrowck/borrowck/check_loans.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ fn owned_ptr_base_path<'a, 'tcx>(loan_path: &'a LoanPath<'tcx>) -> &'a LoanPath<
5151
match loan_path.kind {
5252
LpVar(_) | LpUpvar(_) => None,
5353
LpExtend(ref lp_base, _, LpDeref(mc::Unique)) => {
54-
match helper(&**lp_base) {
54+
match helper(&lp_base) {
5555
v @ Some(_) => v,
56-
None => Some(&**lp_base)
56+
None => Some(&lp_base)
5757
}
5858
}
5959
LpDowncast(ref lp_base, _) |
60-
LpExtend(ref lp_base, _, _) => helper(&**lp_base)
60+
LpExtend(ref lp_base, _, _) => helper(&lp_base)
6161
}
6262
}
6363
}
@@ -319,7 +319,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
319319
}
320320
LpDowncast(ref lp_base, _) |
321321
LpExtend(ref lp_base, _, _) => {
322-
loan_path = &**lp_base;
322+
loan_path = &lp_base;
323323
}
324324
}
325325

@@ -442,21 +442,21 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
442442
// borrow prevents subsequent moves, borrows, or modification of `x` until the
443443
// borrow ends
444444

445-
let common = new_loan.loan_path.common(&*old_loan.loan_path);
445+
let common = new_loan.loan_path.common(&old_loan.loan_path);
446446
let (nl, ol, new_loan_msg, old_loan_msg) =
447-
if new_loan.loan_path.has_fork(&*old_loan.loan_path) && common.is_some() {
447+
if new_loan.loan_path.has_fork(&old_loan.loan_path) && common.is_some() {
448448
let nl = self.bccx.loan_path_to_string(&common.unwrap());
449449
let ol = nl.clone();
450450
let new_loan_msg = format!(" (here through borrowing `{}`)",
451451
self.bccx.loan_path_to_string(
452-
&*new_loan.loan_path));
452+
&new_loan.loan_path));
453453
let old_loan_msg = format!(" (through borrowing `{}`)",
454454
self.bccx.loan_path_to_string(
455-
&*old_loan.loan_path));
455+
&old_loan.loan_path));
456456
(nl, ol, new_loan_msg, old_loan_msg)
457457
} else {
458-
(self.bccx.loan_path_to_string(&*new_loan.loan_path),
459-
self.bccx.loan_path_to_string(&*old_loan.loan_path),
458+
(self.bccx.loan_path_to_string(&new_loan.loan_path),
459+
self.bccx.loan_path_to_string(&old_loan.loan_path),
460460
String::new(), String::new())
461461
};
462462

@@ -578,7 +578,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
578578
Some(lp) => {
579579
let moved_value_use_kind = match mode {
580580
euv::Copy => {
581-
self.check_for_copy_of_frozen_path(id, span, &*lp);
581+
self.check_for_copy_of_frozen_path(id, span, &lp);
582582
MovedInUse
583583
}
584584
euv::Move(_) => {
@@ -593,7 +593,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
593593
}
594594
Some(move_kind) => {
595595
self.check_for_move_of_borrowed_path(id, span,
596-
&*lp, move_kind);
596+
&lp, move_kind);
597597
if move_kind == move_data::Captured {
598598
MovedInCapture
599599
} else {
@@ -622,7 +622,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
622622
&self.bccx.loan_path_to_string(copy_path))
623623
.span_note(loan_span,
624624
&format!("borrow of `{}` occurs here",
625-
&self.bccx.loan_path_to_string(&*loan_path))
625+
&self.bccx.loan_path_to_string(&loan_path))
626626
)
627627
.emit();
628628
}
@@ -656,7 +656,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
656656
err.span_note(
657657
loan_span,
658658
&format!("borrow of `{}` occurs here",
659-
&self.bccx.loan_path_to_string(&*loan_path))
659+
&self.bccx.loan_path_to_string(&loan_path))
660660
);
661661
err.emit();
662662
}
@@ -706,7 +706,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
706706
self.bccx.report_use_of_moved_value(
707707
span,
708708
use_kind,
709-
&**lp,
709+
&lp,
710710
the_move,
711711
moved_lp,
712712
self.param_env);
@@ -760,7 +760,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
760760
self.bccx
761761
.report_partial_reinitialization_of_uninitialized_structure(
762762
span,
763-
&*loan_path);
763+
&loan_path);
764764
false
765765
});
766766
return;
@@ -790,8 +790,8 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
790790
// Check that we don't invalidate any outstanding loans
791791
if let Some(loan_path) = opt_loan_path(&assignee_cmt) {
792792
let scope = self.tcx().region_maps.node_extent(assignment_id);
793-
self.each_in_scope_loan_affecting_path(scope, &*loan_path, |loan| {
794-
self.report_illegal_mutation(assignment_span, &*loan_path, loan);
793+
self.each_in_scope_loan_affecting_path(scope, &loan_path, |loan| {
794+
self.report_illegal_mutation(assignment_span, &loan_path, loan);
795795
false
796796
});
797797
}
@@ -807,7 +807,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
807807
} else {
808808
self.bccx.report_reassigned_immutable_variable(
809809
assignment_span,
810-
&*lp,
810+
&lp,
811811
assign);
812812
}
813813
false

branches/stable/src/librustc_borrowck/borrowck/gather_loans/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,11 @@ impl<'a, 'tcx> GatherLoanCtxt<'a, 'tcx> {
386386
let gen_scope = self.compute_gen_scope(borrow_scope, loan_scope);
387387
debug!("gen_scope = {:?}", gen_scope);
388388

389-
let kill_scope = self.compute_kill_scope(loan_scope, &*loan_path);
389+
let kill_scope = self.compute_kill_scope(loan_scope, &loan_path);
390390
debug!("kill_scope = {:?}", kill_scope);
391391

392392
if req_kind == ty::MutBorrow {
393-
self.mark_loan_path_as_mutated(&*loan_path);
393+
self.mark_loan_path_as_mutated(&loan_path);
394394
}
395395

396396
Loan {
@@ -452,7 +452,7 @@ impl<'a, 'tcx> GatherLoanCtxt<'a, 'tcx> {
452452
LpDowncast(ref base, _) |
453453
LpExtend(ref base, mc::McInherited, _) |
454454
LpExtend(ref base, mc::McDeclared, _) => {
455-
self.mark_loan_path_as_mutated(&**base);
455+
self.mark_loan_path_as_mutated(&base);
456456
}
457457
LpExtend(_, mc::McImmutable, _) => {
458458
// Nothing to do.
@@ -527,7 +527,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for StaticInitializerCtxt<'a, 'tcx> {
527527
if let hir::ExprAddrOf(mutbl, ref base) = ex.node {
528528
let infcx = infer::new_infer_ctxt(self.bccx.tcx, &self.bccx.tcx.tables, None);
529529
let mc = mc::MemCategorizationContext::new(&infcx);
530-
let base_cmt = mc.cat_expr(&**base).unwrap();
530+
let base_cmt = mc.cat_expr(&base).unwrap();
531531
let borrow_kind = ty::BorrowKind::from_mutbl(mutbl);
532532
// Check that we don't allow borrows of unsafe static items.
533533
if check_aliasability(self.bccx, ex.span,

branches/stable/src/librustc_borrowck/borrowck/mod.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ impl<'a, 'tcx, 'v> Visitor<'v> for BorrowckCtxt<'a, 'tcx> {
8585

8686
fn visit_trait_item(&mut self, ti: &hir::TraitItem) {
8787
if let hir::ConstTraitItem(_, Some(ref expr)) = ti.node {
88-
gather_loans::gather_loans_in_static_initializer(self, &*expr);
88+
gather_loans::gather_loans_in_static_initializer(self, &expr);
8989
}
9090
intravisit::walk_trait_item(self, ti);
9191
}
9292

9393
fn visit_impl_item(&mut self, ii: &hir::ImplItem) {
9494
if let hir::ImplItemKind::Const(_, ref expr) = ii.node {
95-
gather_loans::gather_loans_in_static_initializer(self, &*expr);
95+
gather_loans::gather_loans_in_static_initializer(self, &expr);
9696
}
9797
intravisit::walk_impl_item(self, ii);
9898
}
@@ -139,7 +139,7 @@ fn borrowck_item(this: &mut BorrowckCtxt, item: &hir::Item) {
139139
match item.node {
140140
hir::ItemStatic(_, _, ref ex) |
141141
hir::ItemConst(_, ref ex) => {
142-
gather_loans::gather_loans_in_static_initializer(this, &**ex);
142+
gather_loans::gather_loans_in_static_initializer(this, &ex);
143143
}
144144
_ => { }
145145
}
@@ -251,9 +251,9 @@ pub fn build_borrowck_dataflow_data_for_fn<'a, 'tcx>(
251251

252252
let dataflow_data = build_borrowck_dataflow_data(&mut bccx,
253253
fn_parts.kind,
254-
&*fn_parts.decl,
254+
&fn_parts.decl,
255255
cfg,
256-
&*fn_parts.body,
256+
&fn_parts.body,
257257
fn_parts.span,
258258
fn_parts.id);
259259

@@ -426,12 +426,12 @@ impl<'tcx> LoanPath<'tcx> {
426426
(&LpExtend(ref base, _, LpInterior(opt_variant_id, id)),
427427
&LpExtend(ref base2, _, LpInterior(opt_variant_id2, id2))) =>
428428
if id == id2 && opt_variant_id == opt_variant_id2 {
429-
base.has_fork(&**base2)
429+
base.has_fork(&base2)
430430
} else {
431431
true
432432
},
433433
(&LpExtend(ref base, _, LpDeref(_)), _) => base.has_fork(other),
434-
(_, &LpExtend(ref base, _, LpDeref(_))) => self.has_fork(&**base),
434+
(_, &LpExtend(ref base, _, LpDeref(_))) => self.has_fork(&base),
435435
_ => false,
436436
}
437437
}
@@ -449,7 +449,7 @@ impl<'tcx> LoanPath<'tcx> {
449449
(&LpExtend(ref base, a, LpInterior(opt_variant_id, id)),
450450
&LpExtend(ref base2, _, LpInterior(opt_variant_id2, id2))) => {
451451
if id == id2 && opt_variant_id == opt_variant_id2 {
452-
base.common(&**base2).map(|x| {
452+
base.common(&base2).map(|x| {
453453
let xd = x.depth();
454454
if base.depth() == xd && base2.depth() == xd {
455455
assert_eq!(base.ty, base2.ty);
@@ -463,11 +463,11 @@ impl<'tcx> LoanPath<'tcx> {
463463
}
464464
})
465465
} else {
466-
base.common(&**base2)
466+
base.common(&base2)
467467
}
468468
}
469469
(&LpExtend(ref base, _, LpDeref(_)), _) => base.common(other),
470-
(_, &LpExtend(ref other, _, LpDeref(_))) => self.common(&**other),
470+
(_, &LpExtend(ref other, _, LpDeref(_))) => self.common(&other),
471471
(&LpVar(id), &LpVar(id2)) => {
472472
if id == id2 {
473473
assert_eq!(self.ty, other.ty);
@@ -673,7 +673,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
673673
.map
674674
.find(the_move.id) {
675675
Some(hir_map::NodeExpr(expr)) => {
676-
(self.tcx.expr_ty_adjusted(&*expr), expr.span)
676+
(self.tcx.expr_ty_adjusted(&expr), expr.span)
677677
}
678678
r => {
679679
self.tcx.sess.bug(&format!("MoveExpr({}) maps to \
@@ -735,7 +735,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
735735
.map
736736
.find(the_move.id) {
737737
Some(hir_map::NodeExpr(expr)) => {
738-
(self.tcx.expr_ty_adjusted(&*expr), expr.span)
738+
(self.tcx.expr_ty_adjusted(&expr), expr.span)
739739
}
740740
r => {
741741
self.tcx.sess.bug(&format!("Captured({}) maps to \
@@ -833,19 +833,19 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
833833
err_mutbl => {
834834
let descr = match err.cmt.note {
835835
mc::NoteClosureEnv(_) | mc::NoteUpvarRef(_) => {
836-
self.cmt_to_string(&*err.cmt)
836+
self.cmt_to_string(&err.cmt)
837837
}
838838
_ => match opt_loan_path(&err.cmt) {
839839
None => {
840840
format!("{} {}",
841841
err.cmt.mutbl.to_user_str(),
842-
self.cmt_to_string(&*err.cmt))
842+
self.cmt_to_string(&err.cmt))
843843
}
844844
Some(lp) => {
845845
format!("{} {} `{}`",
846846
err.cmt.mutbl.to_user_str(),
847-
self.cmt_to_string(&*err.cmt),
848-
self.loan_path_to_string(&*lp))
847+
self.cmt_to_string(&err.cmt),
848+
self.loan_path_to_string(&lp))
849849
}
850850
}
851851
};
@@ -876,7 +876,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
876876
let msg = match opt_loan_path(&err.cmt) {
877877
None => "borrowed value".to_string(),
878878
Some(lp) => {
879-
format!("`{}`", self.loan_path_to_string(&*lp))
879+
format!("`{}`", self.loan_path_to_string(&lp))
880880
}
881881
};
882882
format!("{} does not live long enough", msg)
@@ -1051,9 +1051,9 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10511051
err_borrowed_pointer_too_short(loan_scope, ptr_scope) => {
10521052
let descr = match opt_loan_path(&err.cmt) {
10531053
Some(lp) => {
1054-
format!("`{}`", self.loan_path_to_string(&*lp))
1054+
format!("`{}`", self.loan_path_to_string(&lp))
10551055
}
1056-
None => self.cmt_to_string(&*err.cmt),
1056+
None => self.cmt_to_string(&err.cmt),
10571057
};
10581058
self.tcx.note_and_explain_region(
10591059
db,
@@ -1081,15 +1081,15 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10811081

10821082
LpDowncast(ref lp_base, variant_def_id) => {
10831083
out.push('(');
1084-
self.append_loan_path_to_string(&**lp_base, out);
1084+
self.append_loan_path_to_string(&lp_base, out);
10851085
out.push_str(DOWNCAST_PRINTED_OPERATOR);
10861086
out.push_str(&self.tcx.item_path_str(variant_def_id));
10871087
out.push(')');
10881088
}
10891089

10901090

10911091
LpExtend(ref lp_base, _, LpInterior(_, InteriorField(fname))) => {
1092-
self.append_autoderefd_loan_path_to_string(&**lp_base, out);
1092+
self.append_autoderefd_loan_path_to_string(&lp_base, out);
10931093
match fname {
10941094
mc::NamedField(fname) => {
10951095
out.push('.');
@@ -1103,13 +1103,13 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
11031103
}
11041104

11051105
LpExtend(ref lp_base, _, LpInterior(_, InteriorElement(..))) => {
1106-
self.append_autoderefd_loan_path_to_string(&**lp_base, out);
1106+
self.append_autoderefd_loan_path_to_string(&lp_base, out);
11071107
out.push_str("[..]");
11081108
}
11091109

11101110
LpExtend(ref lp_base, _, LpDeref(_)) => {
11111111
out.push('*');
1112-
self.append_loan_path_to_string(&**lp_base, out);
1112+
self.append_loan_path_to_string(&lp_base, out);
11131113
}
11141114
}
11151115
}
@@ -1122,12 +1122,12 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
11221122
// For a path like `(*x).f` or `(*x)[3]`, autoderef
11231123
// rules would normally allow users to omit the `*x`.
11241124
// So just serialize such paths to `x.f` or x[3]` respectively.
1125-
self.append_autoderefd_loan_path_to_string(&**lp_base, out)
1125+
self.append_autoderefd_loan_path_to_string(&lp_base, out)
11261126
}
11271127

11281128
LpDowncast(ref lp_base, variant_def_id) => {
11291129
out.push('(');
1130-
self.append_autoderefd_loan_path_to_string(&**lp_base, out);
1130+
self.append_autoderefd_loan_path_to_string(&lp_base, out);
11311131
out.push(':');
11321132
out.push_str(&self.tcx.item_path_str(variant_def_id));
11331133
out.push(')');

branches/stable/src/librustc_borrowck/borrowck/move_data.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn loan_path_is_precise(loan_path: &LoanPath) -> bool {
207207
}
208208
LpDowncast(ref lp_base, _) |
209209
LpExtend(ref lp_base, _, _) => {
210-
loan_path_is_precise(&**lp_base)
210+
loan_path_is_precise(&lp_base)
211211
}
212212
}
213213
}
@@ -587,7 +587,7 @@ impl<'tcx> MoveData<'tcx> {
587587
// assignment referring to another location.
588588

589589
let loan_path = self.path_loan_path(path);
590-
if loan_path_is_precise(&*loan_path) {
590+
if loan_path_is_precise(&loan_path) {
591591
self.each_applicable_move(path, |move_index| {
592592
debug!("kill_moves add_kill {:?} kill_id={} move_index={}",
593593
kill_kind, kill_id, move_index.get());
@@ -700,7 +700,7 @@ impl<'a, 'tcx> FlowedMoveData<'a, 'tcx> {
700700
if base_indices.iter().any(|x| x == &moved_path) {
701701
// Scenario 1 or 2: `loan_path` or some base path of
702702
// `loan_path` was moved.
703-
if !f(the_move, &*self.move_data.path_loan_path(moved_path)) {
703+
if !f(the_move, &self.move_data.path_loan_path(moved_path)) {
704704
ret = false;
705705
}
706706
} else {
@@ -710,7 +710,7 @@ impl<'a, 'tcx> FlowedMoveData<'a, 'tcx> {
710710
// Scenario 3: some extension of `loan_path`
711711
// was moved
712712
f(the_move,
713-
&*self.move_data.path_loan_path(moved_path))
713+
&self.move_data.path_loan_path(moved_path))
714714
} else {
715715
true
716716
}

0 commit comments

Comments
 (0)