about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-01-17 07:56:45 -0800
committerbors <bors@rust-lang.org>2014-01-17 07:56:45 -0800
commit4098327b1fe1112ddf661b587be9eeec1d80adde (patch)
tree3d1a8d2613c1101d46657fd5de25d32403e9626b /src/libstd/io
parent1e1871f35eb83ae6a63952a145e5132deffded2c (diff)
parentb520c2f28002db0e4120797d823380914871bac4 (diff)
downloadrust-4098327b1fe1112ddf661b587be9eeec1d80adde.tar.gz
rust-4098327b1fe1112ddf661b587be9eeec1d80adde.zip
auto merge of #11585 : nikomatsakis/rust/issue-3511-rvalue-lifetimes, r=pcwalton
Major changes:

- Define temporary scopes in a syntax-based way that basically defaults
  to the innermost statement or conditional block, except for in
  a `let` initializer, where we default to the innermost block. Rules
  are documented in the code, but not in the manual (yet).
  See new test run-pass/cleanup-value-scopes.rs for examples.
- Refactors Datum to better define cleanup roles.
- Refactor cleanup scopes to not be tied to basic blocks, permitting
  us to have a very large number of scopes (one per AST node).
- Introduce nascent documentation in trans/doc.rs covering datums and
  cleanup in a more comprehensive way.

r? @pcwalton
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/mem.rs6
-rw-r--r--src/libstd/io/process.rs14
2 files changed, 11 insertions, 9 deletions
diff --git a/src/libstd/io/mem.rs b/src/libstd/io/mem.rs
index f036131d211..a6caa1bfc29 100644
--- a/src/libstd/io/mem.rs
+++ b/src/libstd/io/mem.rs
@@ -406,7 +406,8 @@ mod test {
 
     #[test]
     fn test_read_char() {
-        let mut r = BufReader::new(bytes!("Việt"));
+        let b = bytes!("Việt");
+        let mut r = BufReader::new(b);
         assert_eq!(r.read_char(), Some('V'));
         assert_eq!(r.read_char(), Some('i'));
         assert_eq!(r.read_char(), Some('ệ'));
@@ -416,7 +417,8 @@ mod test {
 
     #[test]
     fn test_read_bad_char() {
-        let mut r = BufReader::new(bytes!(0x80));
+        let b = bytes!(0x80);
+        let mut r = BufReader::new(b);
         assert_eq!(r.read_char(), None);
     }
 
diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs
index a8b7e8e00ea..4c8a640a849 100644
--- a/src/libstd/io/process.rs
+++ b/src/libstd/io/process.rs
@@ -181,7 +181,7 @@ mod tests {
         let io = ~[];
         let args = ProcessConfig {
             program: "/bin/sh",
-            args: [~"-c", ~"true"],
+            args: &[~"-c", ~"true"],
             env: None,
             cwd: None,
             io: io,
@@ -198,7 +198,7 @@ mod tests {
         let io = ~[];
         let args = ProcessConfig {
             program: "if-this-is-a-binary-then-the-world-has-ended",
-            args: [],
+            args: &[],
             env: None,
             cwd: None,
             io: io,
@@ -215,7 +215,7 @@ mod tests {
         let io = ~[];
         let args = ProcessConfig {
             program: "/bin/sh",
-            args: [~"-c", ~"exit 1"],
+            args: &[~"-c", ~"exit 1"],
             env: None,
             cwd: None,
             io: io,
@@ -231,7 +231,7 @@ mod tests {
         let io = ~[];
         let args = ProcessConfig {
             program: "/bin/sh",
-            args: [~"-c", ~"kill -1 $$"],
+            args: &[~"-c", ~"kill -1 $$"],
             env: None,
             cwd: None,
             io: io,
@@ -274,7 +274,7 @@ mod tests {
         let io = ~[Ignored, CreatePipe(false, true)];
         let args = ProcessConfig {
             program: "/bin/sh",
-            args: [~"-c", ~"echo foobar"],
+            args: &[~"-c", ~"echo foobar"],
             env: None,
             cwd: None,
             io: io,
@@ -289,7 +289,7 @@ mod tests {
         let cwd = Some("/");
         let args = ProcessConfig {
             program: "/bin/sh",
-            args: [~"-c", ~"pwd"],
+            args: &[~"-c", ~"pwd"],
             env: None,
             cwd: cwd,
             io: io,
@@ -304,7 +304,7 @@ mod tests {
                    CreatePipe(false, true)];
         let args = ProcessConfig {
             program: "/bin/sh",
-            args: [~"-c", ~"read line; echo $line"],
+            args: &[~"-c", ~"read line; echo $line"],
             env: None,
             cwd: None,
             io: io,