Skip to content

Commit cdc3954

Browse files
killerswanbrson
authored andcommitted
---
yaml --- r: 10968 b: refs/heads/master c: 6156bc5 h: refs/heads/master v: v3
1 parent 2956278 commit cdc3954

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 47c57a17dc51ff32594b5759c300b84e380b9f7b
2+
refs/heads/master: 6156bc56cbd1f40e538b59ff91ce9b8d89969ff3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/comp/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,15 +562,15 @@ fn mangle_internal_name_by_seq(ccx: @crate_ctxt, flav: str) -> str {
562562
fn link_binary(sess: session,
563563
obj_filename: str,
564564
out_filename: str,
565-
lm: link_meta) {
565+
lm: link_meta) unsafe {
566566
// Converts a library file name into a gcc -l argument
567567
fn unlib(config: @session::config, filename: str) -> str {
568568
let rmlib = fn@(filename: str) -> str {
569569
if config.os == session::os_macos ||
570570
(config.os == session::os_linux ||
571571
config.os == session::os_freebsd) &&
572572
str::find(filename, "lib") == 0 {
573-
ret str::slice(filename, 3u,
573+
ret str::unsafe::slice(filename, 3u,
574574
str::byte_len(filename));
575575
} else { ret filename; }
576576
};

trunk/src/comp/middle/debuginfo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ fn cached_metadata<T: copy>(cache: metadata_cache, mdtag: int,
157157
}
158158

159159
fn create_compile_unit(cx: @crate_ctxt, full_path: str)
160-
-> @metadata<compile_unit_md> {
160+
-> @metadata<compile_unit_md> unsafe {
161161
let cache = get_cache(cx);
162162
let tg = CompileUnitTag;
163163
alt cached_metadata::<@metadata<compile_unit_md>>(cache, tg,
@@ -168,7 +168,7 @@ fn create_compile_unit(cx: @crate_ctxt, full_path: str)
168168

169169
let work_dir = cx.sess.working_dir;
170170
let file_path = if str::starts_with(full_path, work_dir) {
171-
str::slice(full_path, str::byte_len(work_dir),
171+
str::unsafe::slice(full_path, str::byte_len(work_dir),
172172
str::byte_len(full_path))
173173
} else {
174174
full_path

trunk/src/comp/syntax/parse/lexer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ type reader = @{
2424

2525
impl reader for reader {
2626
fn is_eof() -> bool { self.curr == -1 as char }
27-
fn get_str_from(start: uint) -> str {
27+
fn get_str_from(start: uint) -> str unsafe {
2828
// I'm pretty skeptical about this subtraction. What if there's a
2929
// multi-byte character before the mark?
30-
ret str::slice(*self.src, start - 1u, self.pos - 1u);
30+
ret str::unsafe::slice(*self.src, start - 1u, self.pos - 1u);
3131
}
3232
fn next() -> char {
3333
if self.pos < self.len {
@@ -579,11 +579,11 @@ fn all_whitespace(s: str, begin: uint, end: uint) -> bool {
579579
ret true;
580580
}
581581

582-
fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) {
582+
fn trim_whitespace_prefix_and_push_line(&lines: [str], s: str, col: uint) unsafe {
583583
let s1;
584584
if all_whitespace(s, 0u, col) {
585585
if col < str::byte_len(s) {
586-
s1 = str::slice(s, col, str::byte_len(s));
586+
s1 = str::unsafe::slice(s, col, str::byte_len(s));
587587
} else { s1 = ""; }
588588
} else { s1 = s; }
589589
log(debug, "pushing line: " + s1);

trunk/src/libstd/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ path separators in the path then the returned path is identical to
6363
the provided path. If an empty path is provided or the path ends
6464
with a path separator then an empty path is returned.
6565
*/
66-
fn basename(p: path) -> path {
66+
fn basename(p: path) -> path unsafe {
6767
let i: int = str::rindex(p, os_fs::path_sep as u8);
6868
if i == -1 {
6969
i = str::rindex(p, os_fs::alt_path_sep as u8);
7070
if i == -1 { ret p; }
7171
}
7272
let len = str::byte_len(p);
7373
if i + 1 as uint >= len { ret p; }
74-
ret str::slice(p, i + 1 as uint, len);
74+
ret str::unsafe::slice(p, i + 1 as uint, len);
7575
}
7676

7777

trunk/src/libstd/getopts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ ok(match) - On success. Use functions such as <opt_present>
209209
<opt_str>, etc. to interrogate results.
210210
err(fail_) - On failure. Use <fail_str> to get an error message.
211211
*/
212-
fn getopts(args: [str], opts: [opt]) -> result {
212+
fn getopts(args: [str], opts: [opt]) -> result unsafe {
213213
let n_opts = vec::len::<opt>(opts);
214214
fn f(_x: uint) -> [optval] { ret []; }
215215
let vals = vec::init_fn_mut::<[optval]>(n_opts, f);
@@ -229,14 +229,14 @@ fn getopts(args: [str], opts: [opt]) -> result {
229229
let names;
230230
let i_arg = option::none::<str>;
231231
if cur[1] == '-' as u8 {
232-
let tail = str::slice(cur, 2u, curlen);
232+
let tail = str::unsafe::slice(cur, 2u, curlen);
233233
let eq = str::index(tail, '=' as u8);
234234
if eq == -1 {
235235
names = [long(tail)];
236236
} else {
237-
names = [long(str::slice(tail, 0u, eq as uint))];
237+
names = [long(str::unsafe::slice(tail, 0u, eq as uint))];
238238
i_arg =
239-
option::some::<str>(str::slice(tail,
239+
option::some::<str>(str::unsafe::slice(tail,
240240
(eq as uint) + 1u,
241241
curlen - 2u));
242242
}

0 commit comments

Comments
 (0)