about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlan Andrade <alan.andradec@gmail.com>2013-12-31 00:51:11 -0600
committerAlan Andrade <alan.andradec@gmail.com>2013-12-31 00:51:11 -0600
commitff801d662ebdebee4845dcc825b366215e4b88bf (patch)
tree17506378ba62f91bab08a1f4942183b30004542d
parent6bc278c8c636a3964aca4b8d2d89e0321d345df3 (diff)
downloadrust-ff801d662ebdebee4845dcc825b366215e4b88bf.tar.gz
rust-ff801d662ebdebee4845dcc825b366215e4b88bf.zip
Fix tests
-rw-r--r--src/libextra/getopts.rs2
-rw-r--r--src/libstd/str.rs14
2 files changed, 10 insertions, 6 deletions
diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs
index 0220f6a6bf4..5debc999192 100644
--- a/src/libextra/getopts.rs
+++ b/src/libextra/getopts.rs
@@ -31,7 +31,7 @@
 //!
 //! ~~~{.rust}
 //! extern mod extra;
-//! use extra::getopts::{optopt,optflag,getopts};
+//! use extra::getopts::{optopt,optflag,getopts,Opt};
 //! use std::os;
 //!
 //! fn do_work(inp: &str, out: Option<~str>) {
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index 8e6d8523f77..4516fb85f90 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -38,11 +38,15 @@ there are three common kinds of strings in rust:
 As an example, here's a few different kinds of strings.
 
 ```rust
-let owned_string = ~"I am an owned string";
-let managed_string = @"This string is garbage-collected";
-let borrowed_string1 = "This string is borrowed with the 'static lifetime";
-let borrowed_string2: &str = owned_string;   // owned strings can be borrowed
-let borrowed_string3: &str = managed_string; // managed strings can also be borrowed
+#[feature(managed_boxes)];
+
+fn main() {
+    let owned_string = ~"I am an owned string";
+    let managed_string = @"This string is garbage-collected";
+    let borrowed_string1 = "This string is borrowed with the 'static lifetime";
+    let borrowed_string2: &str = owned_string;   // owned strings can be borrowed
+    let borrowed_string3: &str = managed_string; // managed strings can also be borrowed
+}
  ```
 
 From the example above, you can see that rust has 3 different kinds of string