@@ -23,6 +23,7 @@ use std::cmp;
2323use collections:: HashMap ;
2424use std:: u32;
2525use std:: local_data;
26+ use std:: vec_ng:: Vec ;
2627
2728pub fn path_name_i ( idents : & [ Ident ] ) -> ~str {
2829 // FIXME: Bad copies (#2543 -- same for everything else that says "bad")
@@ -795,7 +796,7 @@ pub fn resolve_internal(id : Ident,
795796 let resolved = {
796797 let result = {
797798 let table = table. table . borrow ( ) ;
798- table. get ( ) [ id. ctxt ]
799+ * table. get ( ) . get ( id. ctxt as uint )
799800 } ;
800801 match result {
801802 EmptyCtxt => id. name ,
@@ -844,7 +845,7 @@ pub fn marksof(ctxt: SyntaxContext, stopname: Name, table: &SCTable) -> Vec<Mrk>
844845 loop {
845846 let table_entry = {
846847 let table = table. table . borrow ( ) ;
847- table. get ( ) [ loopvar]
848+ * table. get ( ) . get ( loopvar as uint )
848849 } ;
849850 match table_entry {
850851 EmptyCtxt => {
@@ -873,7 +874,7 @@ pub fn marksof(ctxt: SyntaxContext, stopname: Name, table: &SCTable) -> Vec<Mrk>
873874pub fn mtwt_outer_mark ( ctxt : SyntaxContext ) -> Mrk {
874875 let sctable = get_sctable ( ) ;
875876 let table = sctable. table . borrow ( ) ;
876- match table. get ( ) [ ctxt] {
877+ match * table. get ( ) . get ( ctxt as uint ) {
877878 ast:: Mark ( mrk, _) => mrk,
878879 _ => fail ! ( "can't retrieve outer mark when outside is not a mark" )
879880 }
@@ -901,7 +902,7 @@ pub fn getLast(arr: &Vec<Mrk> ) -> Mrk {
901902pub fn path_name_eq ( a : & ast:: Path , b : & ast:: Path ) -> bool {
902903 ( a. span == b. span )
903904 && ( a. global == b. global )
904- && ( segments_name_eq ( a. segments , b. segments ) )
905+ && ( segments_name_eq ( a. segments . as_slice ( ) , b. segments . as_slice ( ) ) )
905906}
906907
907908// are two arrays of segments equal when compared unhygienically?
@@ -938,6 +939,8 @@ mod test {
938939 use opt_vec;
939940 use collections:: HashMap ;
940941
942+ use std:: vec_ng:: Vec ;
943+
941944 fn ident_to_segment ( id : & Ident ) -> PathSegment {
942945 PathSegment { identifier : id. clone ( ) ,
943946 lifetimes : opt_vec:: Empty ,
@@ -1000,7 +1003,7 @@ mod test {
10001003 let mut result = Vec :: new ( ) ;
10011004 loop {
10021005 let table = table. table . borrow ( ) ;
1003- match table. get ( ) [ sc ] {
1006+ match * table. get ( ) . get ( sc as uint ) {
10041007 EmptyCtxt => { return result; } ,
10051008 Mark ( mrk, tail) => {
10061009 result. push ( M ( mrk) ) ;
@@ -1024,9 +1027,9 @@ mod test {
10241027 assert_eq ! ( unfold_test_sc( test_sc. clone( ) , EMPTY_CTXT , & mut t) , 4 ) ;
10251028 {
10261029 let table = t. table . borrow ( ) ;
1027- assert ! ( table. get( ) [ 2 ] == Mark ( 9 , 0 ) ) ;
1028- assert ! ( table. get( ) [ 3 ] == Rename ( id( 101 , 0 ) , 14 , 2 ) ) ;
1029- assert ! ( table. get( ) [ 4 ] == Mark ( 3 , 3 ) ) ;
1030+ assert ! ( * table. get( ) . get ( 2 ) == Mark ( 9 , 0 ) ) ;
1031+ assert ! ( * table. get( ) . get ( 3 ) == Rename ( id( 101 , 0 ) , 14 , 2 ) ) ;
1032+ assert ! ( * table. get( ) . get ( 4 ) == Mark ( 3 , 3 ) ) ;
10301033 }
10311034 assert_eq ! ( refold_test_sc( 4 , & t) , test_sc) ;
10321035 }
@@ -1045,8 +1048,8 @@ mod test {
10451048 assert_eq ! ( unfold_marks( vec!( 3 , 7 ) , EMPTY_CTXT , & mut t) , 3 ) ;
10461049 {
10471050 let table = t. table . borrow ( ) ;
1048- assert ! ( table. get( ) [ 2 ] == Mark ( 7 , 0 ) ) ;
1049- assert ! ( table. get( ) [ 3 ] == Mark ( 3 , 2 ) ) ;
1051+ assert ! ( * table. get( ) . get ( 2 ) == Mark ( 7 , 0 ) ) ;
1052+ assert ! ( * table. get( ) . get ( 3 ) == Mark ( 3 , 2 ) ) ;
10501053 }
10511054 }
10521055
0 commit comments