Skip to content

Commit 5d8bcb1

Browse files
committed
---
yaml --- r: 150502 b: refs/heads/try2 c: dc59df7 h: refs/heads/master v: v3
1 parent d2ebfda commit 5d8bcb1

File tree

2 files changed

+2
-65
lines changed

2 files changed

+2
-65
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 393bc08762de9d24517bce260e2d2564074d3aa9
8+
refs/heads/try2: dc59df776a18956365f2b8f0ee026aca37891acb
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
use middle::ty;
6666
use middle::typeck;
67-
use util::ppaux::{ty_to_str, region_ptr_to_str, Repr};
67+
use util::ppaux::{ty_to_str, Repr};
6868

6969
use syntax::ast::{MutImmutable, MutMutable};
7070
use syntax::ast;
@@ -674,20 +674,6 @@ impl<TYPER:Typer> MemCategorizationContext<TYPER> {
674674
}
675675
}
676676

677-
/// inherited mutability: used in cases where the mutability of a
678-
/// component is inherited from the base it is a part of. For
679-
/// example, a record field is mutable if it is declared mutable
680-
/// or if the container is mutable.
681-
pub fn inherited_mutability(&mut self,
682-
base_m: MutabilityCategory,
683-
interior_m: ast::Mutability)
684-
-> MutabilityCategory {
685-
match interior_m {
686-
MutImmutable => base_m.inherit(),
687-
MutMutable => McDeclared
688-
}
689-
}
690-
691677
pub fn cat_field<N:ast_node>(&mut self,
692678
node: &N,
693679
base_cmt: cmt,
@@ -1114,13 +1100,6 @@ impl<TYPER:Typer> MemCategorizationContext<TYPER> {
11141100
Ok(())
11151101
}
11161102

1117-
pub fn mut_to_str(&mut self, mutbl: ast::Mutability) -> ~str {
1118-
match mutbl {
1119-
MutMutable => ~"mutable",
1120-
MutImmutable => ~"immutable"
1121-
}
1122-
}
1123-
11241103
pub fn cmt_to_str(&self, cmt: cmt) -> ~str {
11251104
match cmt.cat {
11261105
cat_static_item => {
@@ -1174,48 +1153,6 @@ impl<TYPER:Typer> MemCategorizationContext<TYPER> {
11741153
}
11751154
}
11761155
}
1177-
1178-
pub fn region_to_str(&self, r: ty::Region) -> ~str {
1179-
region_ptr_to_str(self.tcx(), r)
1180-
}
1181-
}
1182-
1183-
/// The node_id here is the node of the expression that references the field.
1184-
/// This function looks it up in the def map in case the type happens to be
1185-
/// an enum to determine which variant is in use.
1186-
pub fn field_mutbl(tcx: &ty::ctxt,
1187-
base_ty: ty::t,
1188-
// FIXME #6993: change type to Name
1189-
f_name: ast::Ident,
1190-
node_id: ast::NodeId)
1191-
-> Option<ast::Mutability> {
1192-
// Need to refactor so that struct/enum fields can be treated uniformly.
1193-
match ty::get(base_ty).sty {
1194-
ty::ty_struct(did, _) => {
1195-
let r = ty::lookup_struct_fields(tcx, did);
1196-
for fld in r.iter() {
1197-
if fld.name == f_name.name {
1198-
return Some(ast::MutImmutable);
1199-
}
1200-
}
1201-
}
1202-
ty::ty_enum(..) => {
1203-
match tcx.def_map.borrow().get_copy(&node_id) {
1204-
ast::DefVariant(_, variant_id, _) => {
1205-
let r = ty::lookup_struct_fields(tcx, variant_id);
1206-
for fld in r.iter() {
1207-
if fld.name == f_name.name {
1208-
return Some(ast::MutImmutable);
1209-
}
1210-
}
1211-
}
1212-
_ => {}
1213-
}
1214-
}
1215-
_ => { }
1216-
}
1217-
1218-
return None;
12191156
}
12201157

12211158
pub enum InteriorSafety {

0 commit comments

Comments
 (0)