Skip to content

Avoid compiler error about glob imports in getopts example #11142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 31, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libextra/getopts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
//!
//! ~~~{.rust}
//! extern mod extra;
//! use extra::getopts::*;
//! use extra::getopts::{optopt,optflag,getopts,Opt};
//! use std::os;
//!
//! fn do_work(inp: &str, out: Option<~str>) {
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ fn maketest(s: &str, cratename: &str) -> @str {
let mut prog = ~r"
#[deny(warnings)];
#[allow(unused_variable, dead_assignment, unused_mut, attribute_usage, dead_code)];
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
";
if s.contains("extra") {
prog.push_str("extern mod extra;\n");
Expand Down
14 changes: 9 additions & 5 deletions src/libstd/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down