about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorKevin Cantu <me@kevincantu.org>2012-02-01 03:41:58 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-01 21:56:53 -0800
commit6156bc56cbd1f40e538b59ff91ce9b8d89969ff3 (patch)
treeec399916523a701e8ac25903855e90d2210a9254 /src/comp
parent47c57a17dc51ff32594b5759c300b84e380b9f7b (diff)
downloadrust-6156bc56cbd1f40e538b59ff91ce9b8d89969ff3.tar.gz
rust-6156bc56cbd1f40e538b59ff91ce9b8d89969ff3.zip
Propagating unsafe::slice 2
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/back/link.rs4
-rw-r--r--src/comp/middle/debuginfo.rs4
-rw-r--r--src/comp/syntax/parse/lexer.rs8
3 files changed, 8 insertions, 8 deletions
diff --git a/src/comp/back/link.rs b/src/comp/back/link.rs
index 4f61ddf8178..250b576a113 100644
--- a/src/comp/back/link.rs
+++ b/src/comp/back/link.rs
@@ -562,7 +562,7 @@ fn mangle_internal_name_by_seq(ccx: @crate_ctxt, flav: str) -> str {
 fn link_binary(sess: session,
                obj_filename: str,
                out_filename: str,
-               lm: link_meta) {
+               lm: link_meta) unsafe {
     // Converts a library file name into a gcc -l argument
     fn unlib(config: @session::config, filename: str) -> str {
         let rmlib = fn@(filename: str) -> str {
@@ -570,7 +570,7 @@ fn link_binary(sess: session,
                 (config.os == session::os_linux ||
                  config.os == session::os_freebsd) &&
                 str::find(filename, "lib") == 0 {
-                ret str::slice(filename, 3u,
+                ret str::unsafe::slice(filename, 3u,
                                str::byte_len(filename));
             } else { ret filename; }
         };
diff --git a/src/comp/middle/debuginfo.rs b/src/comp/middle/debuginfo.rs
index 56a07619a46..b674af49b26 100644
--- a/src/comp/middle/debuginfo.rs
+++ b/src/comp/middle/debuginfo.rs
@@ -157,7 +157,7 @@ fn cached_metadata<T: copy>(cache: metadata_cache, mdtag: int,
 }
 
 fn create_compile_unit(cx: @crate_ctxt, full_path: str)
-    -> @metadata<compile_unit_md> {
+    -> @metadata<compile_unit_md> unsafe {
     let cache = get_cache(cx);
     let tg = CompileUnitTag;
     alt cached_metadata::<@metadata<compile_unit_md>>(cache, tg,
@@ -168,7 +168,7 @@ fn create_compile_unit(cx: @crate_ctxt, full_path: str)
 
     let work_dir = cx.sess.working_dir;
     let file_path = if str::starts_with(full_path, work_dir) {
-        str::slice(full_path, str::byte_len(work_dir),
+        str::unsafe::slice(full_path, str::byte_len(work_dir),
                    str::byte_len(full_path))
     } else {
         full_path
diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs
index 03fc4017106..d4e67e812d1 100644
--- a/src/comp/syntax/parse/lexer.rs
+++ b/src/comp/syntax/parse/lexer.rs
@@ -24,10 +24,10 @@ type reader = @{
 
 impl reader for reader {
     fn is_eof() -> bool { self.curr == -1 as char }
-    fn get_str_from(start: uint) -> str {
+    fn get_str_from(start: uint) -> str unsafe {
         // I'm pretty skeptical about this subtraction. What if there's a
         // multi-byte character before the mark?
-        ret str::slice(*self.src, start - 1u, self.pos - 1u);
+        ret str::unsafe::slice(*self.src, start - 1u, self.pos - 1u);
     }
     fn next() -> char {
         if self.pos < self.len {
@@ -579,11 +579,11 @@ fn all_whitespace(s: str, begin: uint, end: uint) -> bool {
     ret true;
 }
 
-fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) {
+fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) unsafe {
     let s1;
     if all_whitespace(s, 0u, col) {
         if col < str::byte_len(s) {
-            s1 = str::slice(s, col, str::byte_len(s));
+            s1 = str::unsafe::slice(s, col, str::byte_len(s));
         } else { s1 = ""; }
     } else { s1 = s; }
     log(debug, "pushing line: " + s1);