Skip to content

Commit 4584f98

Browse files
committed
---
yaml --- r: 94074 b: refs/heads/try c: edb9e85 h: refs/heads/master v: v3
1 parent 5a27c65 commit 4584f98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+296
-308
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: c1eb20b5f830a6181ec8f9818a50107c891ff3b0
5+
refs/heads/try: edb9e85ce2e3708abe3a81d9645054e3eab85395
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/procsrv.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ pub fn run(lib_path: &str,
6060
for input in input.iter() {
6161
process.input().write(input.as_bytes());
6262
}
63-
let output = process.finish_with_output();
63+
let run::ProcessOutput { status, output, error } = process.finish_with_output();
6464

6565
Result {
66-
status: output.status,
67-
out: str::from_utf8(output.output),
68-
err: str::from_utf8(output.error)
66+
status: status,
67+
out: str::from_utf8_owned(output),
68+
err: str::from_utf8_owned(error)
6969
}
7070
}
7171

@@ -90,4 +90,3 @@ pub fn run_background(lib_path: &str,
9090

9191
return process;
9292
}
93-

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
298298

299299
let adb_arg = format!("export LD_LIBRARY_PATH={}; gdbserver :5039 {}/{}",
300300
config.adb_test_dir.clone(), config.adb_test_dir.clone(),
301-
str::from_utf8(exe_file.filename().unwrap())).clone();
301+
str::from_utf8(exe_file.filename().unwrap()));
302302

303303
let mut process = procsrv::run_background("", config.adb_path.clone(),
304304
[~"shell",adb_arg.clone()],~[(~"",~"")], Some(~""));
@@ -1151,4 +1151,3 @@ fn run_codegen_test(config: &config, props: &TestProps,
11511151
(base_lines as f64) / (clang_lines as f64),
11521152
0.001);
11531153
}
1154-

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Patrick Walton <[email protected]>
44
" Maintainer: Ben Blum <[email protected]>
55
" Maintainer: Chris Morgan <[email protected]>
6-
" Last Change: 2013 Oct 29
6+
" Last Change: 2013 Dec 04
77

88
if version < 600
99
syntax clear
@@ -28,6 +28,7 @@ syn keyword rustKeyword use nextgroup=rustModPath skipwhite
2828
" FIXME: Scoped impl's name is also fallen in this category
2929
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite
3030
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite
31+
syn keyword rustKeyword proc
3132
syn keyword rustStorage const mut ref static
3233

3334
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
@@ -89,6 +90,7 @@ syn keyword rustTrait Orderable Signed Unsigned Round
8990
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive
9091
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
9192
syn keyword rustTrait RawPtr
93+
syn keyword rustTrait Buffer Writer Reader Seek
9294
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
9395
syn keyword rustTrait Str StrVector StrSlice OwnedStr
9496
syn keyword rustTrait IterBytes
@@ -143,38 +145,29 @@ syn match rustOperator display "&&\|||"
143145
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail
144146
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
145147

146-
syn match rustFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\=.[^]]*\]\)" contained
147-
syn match rustFormat display "%%" contained
148+
syn match rustSpecialError display contained /\\./
148149
syn match rustSpecial display contained /\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
149150
syn match rustStringContinuation display contained /\\\n\s*/
150-
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat,rustSpecial,rustStringContinuation
151+
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustSpecial,rustSpecialError,rustStringContinuation
151152
syn region rustString start='r\z(#*\)"' end='"\z1'
152153

153154
syn region rustAttribute start="#\[" end="\]" contains=rustString,rustDeriving
154155
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
155156

156157
" Number literals
157-
syn match rustNumber display "\<[0-9][0-9_]*\>"
158-
syn match rustNumber display "\<[0-9][0-9_]*\(u\|u8\|u16\|u32\|u64\)\>"
159-
syn match rustNumber display "\<[0-9][0-9_]*\(i\|i8\|i16\|i32\|i64\)\>"
160-
161-
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\>"
162-
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(u\|u8\|u16\|u32\|u64\)\>"
163-
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(i8\|i16\|i32\|i64\)\>"
164-
syn match rustOctNumber display "\<0o[0-7_]\+\>"
165-
syn match rustOctNumber display "\<0o[0-7_]\+\(u\|u8\|u16\|u32\|u64\)\>"
166-
syn match rustOctNumber display "\<0o[0-7_]\+\(i8\|i16\|i32\|i64\)\>"
167-
syn match rustBinNumber display "\<0b[01_]\+\>"
168-
syn match rustBinNumber display "\<0b[01_]\+\(u\|u8\|u16\|u32\|u64\)\>"
169-
syn match rustBinNumber display "\<0b[01_]\+\(i8\|i16\|i32\|i64\)\>"
170-
171-
syn match rustFloat display "\<[0-9][0-9_]*\(f\|f32\|f64\)\>"
172-
syn match rustFloat display "\<[0-9][0-9_]*\([eE][+-]\=[0-9_]\+\)\>"
173-
syn match rustFloat display "\<[0-9][0-9_]*\([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
174-
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\>"
175-
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\(f\|f32\|f64\)\>"
176-
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\>"
177-
syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>"
158+
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(8\|16\|32\|64\)\=\)\="
159+
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
160+
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
161+
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
162+
163+
" To mark it as a float, it must have at least one of the three things integral values don't have:
164+
" a decimal point and more numbers; an exponent; and a type suffix.
165+
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
166+
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
167+
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
168+
" Special case for numbers of the form "1." which are float literals, unless followed by
169+
" an identifier, which makes them integer literals with a method call or field access.
170+
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\@!"
178171

179172
" For the benefit of delimitMate
180173
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
@@ -183,12 +176,24 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
183176

184177
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
185178
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
186-
syn match rustCharacter /'\([^'\\]\|\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial
187-
188-
syn region rustCommentML start="/\*" end="\*/" contains=rustTodo
189-
syn region rustComment start="//" end="$" contains=rustTodo keepend
190-
syn region rustCommentMLDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo
191-
syn region rustCommentDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo keepend
179+
syn match rustCharacter /'\([^'\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial,rustSpecialError
180+
181+
syn cluster rustComment contains=rustCommentLine,rustCommentLineDoc,rustCommentBlock,rustCommentBlockDoc
182+
syn region rustCommentLine start="//" end="$" contains=rustTodo
183+
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo
184+
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,@rustComment keepend extend
185+
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,@rustComment keepend extend
186+
" FIXME: this is a really ugly and not fully correct implementation. Most
187+
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
188+
" a comment, but in practice at present it leaves comments open two levels
189+
" deep. But as long as you stay away from that particular case, I *believe*
190+
" the highlighting is correct. Due to the way Vim's syntax engine works
191+
" (greedy for start matches, unlike Rust's tokeniser which is searching for
192+
" the earliest-starting match, start or end), I believe this cannot be solved.
193+
" Oh you who would fix it, don't bother with things like duplicating the Block
194+
" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as
195+
" then you must deal with cases like ``/*/**/*/``. And don't try making it
196+
" worse with ``\%(/\@<!\*\)\@<!``, either...
192197

193198
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
194199

@@ -200,15 +205,16 @@ syn region rustFoldBraces start="{" end="}" transparent fold
200205
" It's not enabled by default as it would drive some people mad.
201206

202207
" Default highlighting {{{1
208+
hi def link rustDecNumber rustNumber
203209
hi def link rustHexNumber rustNumber
204210
hi def link rustOctNumber rustNumber
205211
hi def link rustBinNumber rustNumber
206212
hi def link rustIdentifierPrime rustIdentifier
207213
hi def link rustTrait rustType
208214

209215
hi def link rustSigil StorageClass
210-
hi def link rustFormat Special
211216
hi def link rustSpecial Special
217+
hi def link rustSpecialError Error
212218
hi def link rustStringContinuation Special
213219
hi def link rustString String
214220
hi def link rustCharacter Character
@@ -229,10 +235,10 @@ hi def link rustModPathSep Delimiter
229235
hi def link rustFunction Function
230236
hi def link rustFuncName Function
231237
hi def link rustFuncCall Function
232-
hi def link rustCommentMLDoc rustCommentDoc
233-
hi def link rustCommentDoc SpecialComment
234-
hi def link rustCommentML rustComment
235-
hi def link rustComment Comment
238+
hi def link rustCommentLine Comment
239+
hi def link rustCommentLineDoc SpecialComment
240+
hi def link rustCommentBlock rustCommentLine
241+
hi def link rustCommentBlockDoc rustCommentLineDoc
236242
hi def link rustAssert PreCondit
237243
hi def link rustFail PreCondit
238244
hi def link rustMacro Macro

branches/try/src/libextra/base64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<'self> FromBase64 for &'self str {
162162
* Convert any base64 encoded string (literal, `@`, `&`, or `~`)
163163
* to the byte values it encodes.
164164
*
165-
* You can use the `from_utf8` function in `std::str`
165+
* You can use the `from_utf8_owned` function in `std::str`
166166
* to turn a `[u8]` into a string with characters corresponding to those
167167
* values.
168168
*
@@ -180,7 +180,7 @@ impl<'self> FromBase64 for &'self str {
180180
* println!("base64 output: {}", hello_str);
181181
* let res = hello_str.from_base64();
182182
* if res.is_ok() {
183-
* let optBytes = str::from_utf8_opt(res.unwrap());
183+
* let optBytes = str::from_utf8_owned_opt(res.unwrap());
184184
* if optBytes.is_some() {
185185
* println!("decoded from base64: {}", optBytes.unwrap());
186186
* }

branches/try/src/libextra/ebml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Doc {
4141
}
4242

4343
pub fn as_str_slice<'a>(&'a self) -> &'a str {
44-
str::from_utf8_slice(self.data.slice(self.start, self.end))
44+
str::from_utf8(self.data.slice(self.start, self.end))
4545
}
4646

4747
pub fn as_str(&self) -> ~str {

branches/try/src/libextra/hex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'self> FromHex for &'self str {
6262
* Convert any hexadecimal encoded string (literal, `@`, `&`, or `~`)
6363
* to the byte values it encodes.
6464
*
65-
* You can use the `from_utf8` function in `std::str`
65+
* You can use the `from_utf8_owned` function in `std::str`
6666
* to turn a `[u8]` into a string with characters corresponding to those
6767
* values.
6868
*
@@ -80,7 +80,7 @@ impl<'self> FromHex for &'self str {
8080
* println!("{}", hello_str);
8181
* let bytes = hello_str.from_hex().unwrap();
8282
* println!("{:?}", bytes);
83-
* let result_str = str::from_utf8(bytes);
83+
* let result_str = str::from_utf8_owned(bytes);
8484
* println!("{}", result_str);
8585
* }
8686
* ```

branches/try/src/libextra/terminfo/parser/compiled.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ pub fn parse(file: &mut io::Reader,
215215
return Err(~"incompatible file: more string offsets than expected");
216216
}
217217

218-
let names_str = str::from_utf8(file.read_bytes(names_bytes as uint - 1)); // don't read NUL
218+
// don't read NUL
219+
let names_str = str::from_utf8_owned(file.read_bytes(names_bytes as uint - 1));
220+
219221
let term_names: ~[~str] = names_str.split('|').map(|s| s.to_owned()).collect();
220222

221223
file.read_byte(); // consume NUL

branches/try/src/libextra/url.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,51 @@ use std::hashmap::HashMap;
1919
use std::to_bytes;
2020
use std::uint;
2121

22+
/// A Uniform Resource Locator (URL). A URL is a form of URI (Uniform Resource
23+
/// Identifier) that includes network location information, such as hostname or
24+
/// port number.
25+
///
26+
/// # Example
27+
///
28+
/// ```rust
29+
/// let url = Url { scheme: ~"https",
30+
/// user: Some(UserInfo { user: ~"username", pass: None }),
31+
/// host: ~"example.com",
32+
/// port: Some(~"8080"),
33+
/// path: ~"/foo/bar",
34+
/// query: ~[(~"baz", ~"qux")],
35+
/// fragment: Some(~"quz") };
36+
/// // https://[email protected]:8080/foo/bar?baz=qux#quz
37+
/// ```
2238
#[deriving(Clone, Eq)]
2339
pub struct Url {
40+
/// The scheme part of a URL, such as `https` in the above example.
2441
scheme: ~str,
42+
/// A URL subcomponent for user authentication. `username` in the above example.
2543
user: Option<UserInfo>,
44+
/// A domain name or IP address. For example, `example.com`.
2645
host: ~str,
46+
/// A TCP port number, for example `8080`.
2747
port: Option<~str>,
48+
/// The path component of a URL, for example `/foo/bar`.
2849
path: ~str,
50+
/// The query component of a URL. `~[(~"baz", ~"qux")]` represents the
51+
/// fragment `baz=qux` in the above example.
2952
query: Query,
53+
/// The fragment component, such as `quz`. Doesn't include the leading `#` character.
3054
fragment: Option<~str>
3155
}
3256

57+
/// An optional subcomponent of a URI authority component.
3358
#[deriving(Clone, Eq)]
3459
pub struct UserInfo {
60+
/// The user name.
3561
user: ~str,
62+
/// Password or other scheme-specific authentication information.
3663
pass: Option<~str>
3764
}
3865

66+
/// Represents the query component of a URI.
3967
pub type Query = ~[(~str, ~str)];
4068

4169
impl Url {

branches/try/src/libextra/uuid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl Uuid {
310310
s[i*2+0] = digit[0];
311311
s[i*2+1] = digit[1];
312312
}
313-
str::from_utf8(s)
313+
str::from_utf8_owned(s)
314314
}
315315

316316
/// Returns a string of hexadecimal digits, separated into groups with a hypen

branches/try/src/libextra/workcache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ fn json_encode<'self, T:Encodable<json::Encoder<'self>>>(t: &T) -> ~str {
260260
let mut writer = MemWriter::new();
261261
let mut encoder = json::Encoder::init(&mut writer as &mut io::Writer);
262262
t.encode(&mut encoder);
263-
str::from_utf8(writer.inner_ref().as_slice())
263+
str::from_utf8_owned(writer.inner())
264264
}
265265

266266
// FIXME(#5121)

branches/try/src/librustc/back/archive.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,25 @@ impl Archive {
119119
}
120120

121121
fn find_library(&self, name: &str) -> Path {
122-
let (prefix, ext) = match self.sess.targ_cfg.os {
122+
let (osprefix, osext) = match self.sess.targ_cfg.os {
123123
abi::OsWin32 => ("", "lib"), _ => ("lib", "a"),
124124
};
125-
let libname = format!("{}{}.{}", prefix, name, ext);
125+
// On windows, static libraries sometimes show up as libfoo.a and other
126+
// times show up as foo.lib
127+
let oslibname = format!("{}{}.{}", osprefix, name, osext);
128+
let unixlibname = format!("lib{}.a", name);
126129

127130
let mut rustpath = filesearch::rust_path();
128131
rustpath.push(self.sess.filesearch.get_target_lib_path());
129132
let path = self.sess.opts.addl_lib_search_paths.iter();
130133
for path in path.chain(rustpath.iter()) {
131134
debug!("looking for {} inside {}", name, path.display());
132-
let test = path.join(libname.clone());
135+
let test = path.join(oslibname.as_slice());
133136
if test.exists() { return test }
137+
if oslibname != unixlibname {
138+
let test = path.join(unixlibname.as_slice());
139+
if test.exists() { return test }
140+
}
134141
}
135142
self.sess.fatal(format!("could not find native static library `{}`, \
136143
perhaps an -L flag is missing?", name));

branches/try/src/librustc/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ pub mod write {
368368
if !prog.status.success() {
369369
sess.err(format!("linking with `{}` failed: {}", cc, prog.status));
370370
sess.note(format!("{} arguments: '{}'", cc, args.connect("' '")));
371-
sess.note(str::from_utf8(prog.error + prog.output));
371+
sess.note(str::from_utf8_owned(prog.error + prog.output));
372372
sess.abort_if_errors();
373373
}
374374
}
@@ -1079,7 +1079,7 @@ fn link_natively(sess: Session, dylib: bool, obj_filename: &Path,
10791079
if !prog.status.success() {
10801080
sess.err(format!("linking with `{}` failed: {}", cc_prog, prog.status));
10811081
sess.note(format!("{} arguments: '{}'", cc_prog, cc_args.connect("' '")));
1082-
sess.note(str::from_utf8(prog.error + prog.output));
1082+
sess.note(str::from_utf8_owned(prog.error + prog.output));
10831083
sess.abort_if_errors();
10841084
}
10851085

branches/try/src/librustc/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Available lint options:
166166
max_key = num::max(name.len(), max_key);
167167
}
168168
fn padded(max: uint, s: &str) -> ~str {
169-
str::from_utf8(vec::from_elem(max - s.len(), ' ' as u8)) + s
169+
" ".repeat(max - s.len()) + s
170170
}
171171
println("\nAvailable lint checks:\n");
172172
println!(" {} {:7.7s} {}",
@@ -246,7 +246,7 @@ pub fn run_compiler(args: &[~str], demitter: @diagnostic::Emitter) {
246246
1u => {
247247
let ifile = matches.free[0].as_slice();
248248
if "-" == ifile {
249-
let src = str::from_utf8(io::stdin().read_to_end());
249+
let src = str::from_utf8_owned(io::stdin().read_to_end());
250250
str_input(src.to_managed())
251251
} else {
252252
file_input(Path::init(ifile))

branches/try/src/librustc/metadata/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,8 +1274,8 @@ fn family_names_type(fam: Family) -> bool {
12741274
fn read_path(d: ebml::Doc) -> (~str, uint) {
12751275
reader::with_doc_data(d, |desc| {
12761276
let pos = u64_from_be_bytes(desc, 0u, 4u) as uint;
1277-
let pathbytes = desc.slice(4u, desc.len());
1278-
let path = str::from_utf8(pathbytes);
1277+
let pathbytes = desc.slice_from(4u).to_owned();
1278+
let path = str::from_utf8_owned(pathbytes);
12791279

12801280
(path, pos)
12811281
})

branches/try/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1902,5 +1902,5 @@ pub fn encoded_ty(tcx: ty::ctxt, t: ty::t) -> ~str {
19021902
abbrevs: tyencode::ac_no_abbrevs};
19031903
let wr = @mut MemWriter::new();
19041904
tyencode::enc_ty(wr, cx, t);
1905-
str::from_utf8(*wr.inner_ref())
1905+
str::from_utf8_owned(wr.inner_ref().to_owned())
19061906
}

0 commit comments

Comments
 (0)