File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
branches/dist-snap/src/librustc/middle Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
9
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10
- refs/heads/dist-snap: d10b5c725b927c94ab73e74f036d622fdc14f4c5
10
+ refs/heads/dist-snap: 800b8a759d7d22de9ff49a5bd680f36407123298
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
13
13
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -453,26 +453,27 @@ impl &mem_categorization_ctxt {
453
453
mutbl: m_imm, ty: expr_ty}
454
454
}
455
455
456
- ast:: def_arg( vid, mode, _ ) => {
456
+ ast:: def_arg( vid, mode, mutbl ) => {
457
457
// Idea: make this could be rewritten to model by-ref
458
458
// stuff as `&const` and `&mut`?
459
459
460
460
// m: mutability of the argument
461
461
// lp: loan path, must be none for aliasable things
462
- let { m, lp} = match ty:: resolved_mode ( self . tcx , mode) {
462
+ let m = if mutbl { m_mutbl} else { m_imm} ;
463
+ let lp = match ty:: resolved_mode ( self . tcx , mode) {
463
464
ast:: by_move | ast:: by_copy => {
464
- { m : m_imm , lp : Some ( @lp_arg ( vid) ) }
465
+ Some ( @lp_arg ( vid) )
465
466
}
466
467
ast:: by_ref => {
467
- { m : m_imm , lp : None }
468
+ None
468
469
}
469
470
ast:: by_val => {
470
471
// by-value is this hybrid mode where we have a
471
472
// pointer but we do not own it. This is not
472
473
// considered loanable because, for example, a by-ref
473
474
// and and by-val argument might both actually contain
474
475
// the same unique ptr.
475
- { m : m_imm , lp : None }
476
+ None
476
477
}
477
478
} ;
478
479
@{ id: id, span: span,
Original file line number Diff line number Diff line change @@ -4104,9 +4104,11 @@ impl Resolver {
4104
4104
for declaration. inputs. each |argument| {
4105
4105
let binding_mode =
4106
4106
ArgumentIrrefutableMode ( argument. mode) ;
4107
+ let mutability =
4108
+ if argument. is_mutbl { Mutable} else { Immutable } ;
4107
4109
self . resolve_pattern( argument. pat,
4108
4110
binding_mode,
4109
- Immutable ,
4111
+ mutability ,
4110
4112
None ,
4111
4113
visitor) ;
4112
4114
@@ -4295,12 +4297,7 @@ impl Resolver {
4295
4297
}
4296
4298
4297
4299
fn resolve_local( local: @local, visitor: ResolveVisitor ) {
4298
- let mut mutability;
4299
- if local. node. is_mutbl {
4300
- mutability = Mutable ;
4301
- } else {
4302
- mutability = Immutable ;
4303
- }
4300
+ let mutability = if local. node. is_mutbl { Mutable} else { Immutable } ;
4304
4301
4305
4302
// Resolve the type.
4306
4303
self . resolve_type( local. node. ty, visitor) ;
You can’t perform that action at this time.
0 commit comments