Skip to content

Commit 9147936

Browse files
committed
librustc: Remove all mutable fields from librustc. rs=demuting
1 parent 9c71249 commit 9147936

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustc/middle/ty.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ pub type ctxt = @ctxt_;
230230
struct ctxt_ {
231231
diag: syntax::diagnostic::span_handler,
232232
interner: HashMap<intern_key, t_box>,
233-
mut next_id: uint,
233+
next_id: @mut uint,
234234
vecs_implicitly_copyable: bool,
235235
legacy_modes: bool,
236236
legacy_records: bool,
@@ -261,7 +261,7 @@ struct ctxt_ {
261261
short_names_cache: HashMap<t, @~str>,
262262
needs_drop_cache: HashMap<t, bool>,
263263
needs_unwind_cleanup_cache: HashMap<t, bool>,
264-
mut tc_cache: LinearMap<uint, TypeContents>,
264+
tc_cache: @mut LinearMap<uint, TypeContents>,
265265
ast_ty_to_ty_cache: HashMap<node_id, ast_ty_to_ty_cache_entry>,
266266
enum_var_cache: HashMap<def_id, @~[VariantInfo]>,
267267
trait_method_cache: HashMap<def_id, @~[method]>,
@@ -811,7 +811,7 @@ pub fn mk_ctxt(s: session::Session,
811811
@ctxt_ {
812812
diag: s.diagnostic(),
813813
interner: interner,
814-
mut next_id: 0u,
814+
next_id: @mut 0,
815815
vecs_implicitly_copyable: vecs_implicitly_copyable,
816816
legacy_modes: legacy_modes,
817817
legacy_records: legacy_records,
@@ -831,7 +831,7 @@ pub fn mk_ctxt(s: session::Session,
831831
short_names_cache: new_ty_hash(),
832832
needs_drop_cache: new_ty_hash(),
833833
needs_unwind_cleanup_cache: new_ty_hash(),
834-
tc_cache: LinearMap::new(),
834+
tc_cache: @mut LinearMap::new(),
835835
ast_ty_to_ty_cache: HashMap(),
836836
enum_var_cache: HashMap(),
837837
trait_method_cache: HashMap(),
@@ -920,7 +920,7 @@ fn mk_t_with_id(cx: ctxt, +st: sty, o_def_id: Option<ast::def_id>) -> t {
920920

921921
let t = @t_box_ {
922922
sty: st,
923-
id: cx.next_id,
923+
id: *cx.next_id,
924924
flags: flags,
925925
o_def_id: o_def_id
926926
};
@@ -931,7 +931,7 @@ fn mk_t_with_id(cx: ctxt, +st: sty, o_def_id: Option<ast::def_id>) -> t {
931931

932932
cx.interner.insert(key, t);
933933

934-
cx.next_id += 1u;
934+
*cx.next_id += 1;
935935
unsafe { cast::reinterpret_cast(&t) }
936936
}
937937

0 commit comments

Comments
 (0)