Skip to content

Commit b12588a

Browse files
committed
rustc: Fix mutability checking when dereferencing a region-annotated pointer
1 parent 4e3e133 commit b12588a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/rustc/middle/mutbl.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ fn expr_root(tcx: ty::ctxt, ex: @expr, autoderef: bool) ->
1818
let ds = [], t = t;
1919
loop {
2020
alt ty::get(t).struct {
21-
ty::ty_box(mt) {
22-
ds += [@{mutbl: mt.mutbl == m_mutbl,
23-
kind: unbox(false),
24-
outer_t: t}];
25-
t = mt.ty;
26-
}
27-
ty::ty_uniq(mt) {
21+
ty::ty_box(mt) | ty::ty_uniq(mt) | ty::ty_rptr(_, mt) {
2822
ds += [@{mutbl: mt.mutbl == m_mutbl,
2923
kind: unbox(false),
3024
outer_t: t}];

0 commit comments

Comments
 (0)