Skip to content

Commit cd5bbd6

Browse files
committed
---
yaml --- r: 161724 b: refs/heads/master c: 207a508 h: refs/heads/master v: v3
1 parent 8b06fd2 commit cd5bbd6

File tree

109 files changed

+1444
-1626
lines changed

Some content is hidden

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

109 files changed

+1444
-1626
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: b82624bf205e83555d7764d9f849fbfd30df0083
2+
refs/heads/master: 207a5084110d106149f7aba96603abba5850fdcb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6

trunk/configure

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,6 @@ do
10401040
make_dir $h/test/debuginfo-gdb
10411041
make_dir $h/test/debuginfo-lldb
10421042
make_dir $h/test/codegen
1043-
make_dir $h/test/doc-tutorial
10441043
make_dir $h/test/doc-guide
10451044
make_dir $h/test/doc-guide-ffi
10461045
make_dir $h/test/doc-guide-runtime
@@ -1052,7 +1051,7 @@ do
10521051
make_dir $h/test/doc-guide-plugin
10531052
make_dir $h/test/doc-guide-crates
10541053
make_dir $h/test/doc-guide-error-handling
1055-
make_dir $h/test/doc-rust
1054+
make_dir $h/test/doc-reference
10561055
done
10571056

10581057
# Configure submodules

trunk/mk/target.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
7979
$$(dir $$@)$$(call CFG_LIB_GLOB_$(2),$(4)))
8080
$$(call REMOVE_ALL_OLD_GLOB_MATCHES, \
8181
$$(dir $$@)$$(call CFG_RLIB_GLOB,$(4)))
82-
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
82+
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
8383
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) \
8484
$$(RUST_LIB_FLAGS_ST$(1)) \
8585
-L "$$(RT_OUTPUT_DIR_$(2))" \

trunk/mk/tests.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
412412
$$(CRATEFILE_$(4)) \
413413
$$(TESTDEP_$(1)_$(2)_$(3)_$(4))
414414
@$$(call E, rustc: $$@)
415-
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
415+
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
416416
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
417417
-L "$$(RT_OUTPUT_DIR_$(2))" \
418418
-L "$$(LLVM_LIBDIR_$(2))" \
@@ -598,7 +598,7 @@ CTEST_DISABLE_debuginfo-lldb = "lldb tests are only run on darwin"
598598
endif
599599

600600
ifeq ($(CFG_OSTYPE),apple-darwin)
601-
CTEST_DISABLE_debuginfo-gdb = "gdb on darwing needs root"
601+
CTEST_DISABLE_debuginfo-gdb = "gdb on darwin needs root"
602602
endif
603603

604604
# CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
@@ -891,7 +891,7 @@ endif
891891
ifeq ($(2),$$(CFG_BUILD))
892892
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
893893
@$$(call E, run doc-crate-$(4) [$(2)])
894-
$$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
894+
$$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
895895
$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
896896
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
897897
else

trunk/src/doc/guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ or 'breaks up,' the tuple, and assigns the bits to three bindings.
922922

923923
This pattern is very powerful, and we'll see it repeated more later.
924924

925-
There also a few things you can do with a tuple as a whole, without
925+
There are also a few things you can do with a tuple as a whole, without
926926
destructuring. You can assign one tuple into another, if they have the same
927927
arity and contained types.
928928

trunk/src/libcollections/binary_heap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
//! A priority queue implemented with a binary heap.
1212
//!
13-
//! Insertions have `O(log n)` time complexity and checking or popping the largest element is
14-
//! `O(1)`. Converting a vector to a priority queue can be done in-place, and has `O(n)`
13+
//! Insertion and popping the largest element have `O(log n)` time complexity. Checking the largest
14+
//! element is `O(1)`. Converting a vector to a priority queue can be done in-place, and has `O(n)`
1515
//! complexity. A priority queue can also be converted to a sorted vector in-place, allowing it to
1616
//! be used for an `O(n log n)` in-place heapsort.
1717
//!

trunk/src/libcollections/str.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,13 @@ Section: CowString
656656
/// A clone-on-write string
657657
pub type CowString<'a> = Cow<'a, String, str>;
658658

659+
impl<'a> Str for CowString<'a> {
660+
#[inline]
661+
fn as_slice<'b>(&'b self) -> &'b str {
662+
(**self).as_slice()
663+
}
664+
}
665+
659666
/*
660667
Section: Trait implementations
661668
*/

trunk/src/libgetopts/lib.rs

Lines changed: 42 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@
9292

9393
#[cfg(test)] #[phase(plugin, link)] extern crate log;
9494

95-
pub use self::Name::*;
96-
pub use self::HasArg::*;
97-
pub use self::Occur::*;
98-
pub use self::Fail_::*;
99-
pub use self::FailType::*;
95+
use self::Name::*;
96+
use self::HasArg::*;
97+
use self::Occur::*;
98+
use self::Fail::*;
10099
use self::Optval::*;
101100

102101
use std::fmt;
@@ -191,7 +190,7 @@ pub struct Matches {
191190
/// expected format. Use the `Show` implementation to output detailed
192191
/// information.
193192
#[deriving(Clone, PartialEq, Eq)]
194-
pub enum Fail_ {
193+
pub enum Fail {
195194
/// The option requires an argument but none was passed.
196195
ArgumentMissing(String),
197196
/// The passed option is not declared among the possible options.
@@ -204,19 +203,8 @@ pub enum Fail_ {
204203
UnexpectedArgument(String),
205204
}
206205

207-
/// The type of failure that occurred.
208-
#[deriving(PartialEq, Eq)]
209-
#[allow(missing_docs)]
210-
pub enum FailType {
211-
ArgumentMissing_,
212-
UnrecognizedOption_,
213-
OptionMissing_,
214-
OptionDuplicated_,
215-
UnexpectedArgument_,
216-
}
217-
218206
/// The result of parsing a command line with a set of options.
219-
pub type Result = result::Result<Matches, Fail_>;
207+
pub type Result = result::Result<Matches, Fail>;
220208

221209
impl Name {
222210
fn from_str(nm: &str) -> Name {
@@ -264,7 +252,7 @@ impl OptGroup {
264252
(1,_) => Opt {
265253
name: Long((long_name)),
266254
hasarg: hasarg,
267-
occur: occur,
255+
occur: occur,
268256
aliases: vec!(
269257
Opt {
270258
name: Short(short_name.as_slice().char_at(0)),
@@ -366,11 +354,12 @@ impl Matches {
366354
pub fn opt_default(&self, nm: &str, def: &str) -> Option<String> {
367355
let vals = self.opt_vals(nm);
368356
if vals.is_empty() {
369-
return None;
370-
}
371-
match vals[0] {
372-
Val(ref s) => Some((*s).clone()),
373-
_ => Some(def.to_string())
357+
None
358+
} else {
359+
match vals[0] {
360+
Val(ref s) => Some((*s).clone()),
361+
_ => Some(def.to_string())
362+
}
374363
}
375364
}
376365

@@ -534,15 +523,15 @@ pub fn opt(short_name: &str,
534523
}
535524
}
536525

537-
impl Fail_ {
538-
/// Convert a `Fail_` enum into an error string.
526+
impl Fail {
527+
/// Convert a `Fail` enum into an error string.
539528
#[deprecated="use `Show` (`{}` format specifier)"]
540529
pub fn to_err_msg(self) -> String {
541530
self.to_string()
542531
}
543532
}
544533

545-
impl fmt::Show for Fail_ {
534+
impl fmt::Show for Fail {
546535
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
547536
match *self {
548537
ArgumentMissing(ref nm) => {
@@ -570,7 +559,7 @@ impl fmt::Show for Fail_ {
570559
/// `opt_str`, etc. to interrogate results.
571560
/// # Panics
572561
///
573-
/// Returns `Err(Fail_)` on failure: use the `Show` implementation of `Fail_` to display
562+
/// Returns `Err(Fail)` on failure: use the `Show` implementation of `Fail` to display
574563
/// information about it.
575564
pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result {
576565
let opts: Vec<Opt> = optgrps.iter().map(|x| x.long_to_short()).collect();
@@ -681,21 +670,15 @@ pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result {
681670
}
682671
i += 1;
683672
}
684-
i = 0u;
685-
while i < n_opts {
673+
for i in range(0u, n_opts) {
686674
let n = vals[i].len();
687675
let occ = opts[i].occur;
688-
if occ == Req {
689-
if n == 0 {
690-
return Err(OptionMissing(opts[i].name.to_string()));
691-
}
676+
if occ == Req && n == 0 {
677+
return Err(OptionMissing(opts[i].name.to_string()));
692678
}
693-
if occ != Multi {
694-
if n > 1 {
695-
return Err(OptionDuplicated(opts[i].name.to_string()));
696-
}
679+
if occ != Multi && n > 1 {
680+
return Err(OptionDuplicated(opts[i].name.to_string()));
697681
}
698-
i += 1;
699682
}
700683
Ok(Matches {
701684
opts: opts,
@@ -966,20 +949,11 @@ fn test_split_within() {
966949
#[cfg(test)]
967950
mod tests {
968951
use super::*;
952+
use super::Fail::*;
969953

970954
use std::result::{Err, Ok};
971955
use std::result;
972956

973-
fn check_fail_type(f: Fail_, ft: FailType) {
974-
match f {
975-
ArgumentMissing(_) => assert!(ft == ArgumentMissing_),
976-
UnrecognizedOption(_) => assert!(ft == UnrecognizedOption_),
977-
OptionMissing(_) => assert!(ft == OptionMissing_),
978-
OptionDuplicated(_) => assert!(ft == OptionDuplicated_),
979-
UnexpectedArgument(_) => assert!(ft == UnexpectedArgument_)
980-
}
981-
}
982-
983957
// Tests for reqopt
984958
#[test]
985959
fn test_reqopt() {
@@ -1013,7 +987,7 @@ mod tests {
1013987
let opts = vec!(reqopt("t", "test", "testing", "TEST"));
1014988
let rs = getopts(args.as_slice(), opts.as_slice());
1015989
match rs {
1016-
Err(f) => check_fail_type(f, OptionMissing_),
990+
Err(OptionMissing(_)) => {},
1017991
_ => panic!()
1018992
}
1019993
}
@@ -1024,12 +998,12 @@ mod tests {
1024998
let opts = vec!(reqopt("t", "test", "testing", "TEST"));
1025999
let rs = getopts(long_args.as_slice(), opts.as_slice());
10261000
match rs {
1027-
Err(f) => check_fail_type(f, ArgumentMissing_),
1001+
Err(ArgumentMissing(_)) => {},
10281002
_ => panic!()
10291003
}
10301004
let short_args = vec!("-t".to_string());
10311005
match getopts(short_args.as_slice(), opts.as_slice()) {
1032-
Err(f) => check_fail_type(f, ArgumentMissing_),
1006+
Err(ArgumentMissing(_)) => {},
10331007
_ => panic!()
10341008
}
10351009
}
@@ -1040,7 +1014,7 @@ mod tests {
10401014
let opts = vec!(reqopt("t", "test", "testing", "TEST"));
10411015
let rs = getopts(args.as_slice(), opts.as_slice());
10421016
match rs {
1043-
Err(f) => check_fail_type(f, OptionDuplicated_),
1017+
Err(OptionDuplicated(_)) => {},
10441018
_ => panic!()
10451019
}
10461020
}
@@ -1092,12 +1066,12 @@ mod tests {
10921066
let opts = vec!(optopt("t", "test", "testing", "TEST"));
10931067
let rs = getopts(long_args.as_slice(), opts.as_slice());
10941068
match rs {
1095-
Err(f) => check_fail_type(f, ArgumentMissing_),
1069+
Err(ArgumentMissing(_)) => {},
10961070
_ => panic!()
10971071
}
10981072
let short_args = vec!("-t".to_string());
10991073
match getopts(short_args.as_slice(), opts.as_slice()) {
1100-
Err(f) => check_fail_type(f, ArgumentMissing_),
1074+
Err(ArgumentMissing(_)) => {},
11011075
_ => panic!()
11021076
}
11031077
}
@@ -1108,7 +1082,7 @@ mod tests {
11081082
let opts = vec!(optopt("t", "test", "testing", "TEST"));
11091083
let rs = getopts(args.as_slice(), opts.as_slice());
11101084
match rs {
1111-
Err(f) => check_fail_type(f, OptionDuplicated_),
1085+
Err(OptionDuplicated(_)) => {},
11121086
_ => panic!()
11131087
}
11141088
}
@@ -1156,9 +1130,7 @@ mod tests {
11561130
let opts = vec!(optflag("t", "test", "testing"));
11571131
let rs = getopts(args.as_slice(), opts.as_slice());
11581132
match rs {
1159-
Err(f) => {
1160-
check_fail_type(f, UnexpectedArgument_);
1161-
}
1133+
Err(UnexpectedArgument(_)) => {},
11621134
_ => panic!()
11631135
}
11641136
}
@@ -1169,7 +1141,7 @@ mod tests {
11691141
let opts = vec!(optflag("t", "test", "testing"));
11701142
let rs = getopts(args.as_slice(), opts.as_slice());
11711143
match rs {
1172-
Err(f) => check_fail_type(f, OptionDuplicated_),
1144+
Err(OptionDuplicated(_)) => {},
11731145
_ => panic!()
11741146
}
11751147
}
@@ -1317,12 +1289,12 @@ mod tests {
13171289
let opts = vec!(optmulti("t", "test", "testing", "TEST"));
13181290
let rs = getopts(long_args.as_slice(), opts.as_slice());
13191291
match rs {
1320-
Err(f) => check_fail_type(f, ArgumentMissing_),
1292+
Err(ArgumentMissing(_)) => {},
13211293
_ => panic!()
13221294
}
13231295
let short_args = vec!("-t".to_string());
13241296
match getopts(short_args.as_slice(), opts.as_slice()) {
1325-
Err(f) => check_fail_type(f, ArgumentMissing_),
1297+
Err(ArgumentMissing(_)) => {},
13261298
_ => panic!()
13271299
}
13281300
}
@@ -1352,12 +1324,12 @@ mod tests {
13521324
let opts = vec!(optmulti("t", "test", "testing", "TEST"));
13531325
let rs = getopts(long_args.as_slice(), opts.as_slice());
13541326
match rs {
1355-
Err(f) => check_fail_type(f, UnrecognizedOption_),
1327+
Err(UnrecognizedOption(_)) => {},
13561328
_ => panic!()
13571329
}
13581330
let short_args = vec!("-u".to_string());
13591331
match getopts(short_args.as_slice(), opts.as_slice()) {
1360-
Err(f) => check_fail_type(f, UnrecognizedOption_),
1332+
Err(UnrecognizedOption(_)) => {},
13611333
_ => panic!()
13621334
}
13631335
}
@@ -1493,14 +1465,14 @@ mod tests {
14931465
#[test]
14941466
fn test_long_to_short() {
14951467
let mut short = Opt {
1496-
name: Long("banana".to_string()),
1497-
hasarg: Yes,
1498-
occur: Req,
1468+
name: Name::Long("banana".to_string()),
1469+
hasarg: HasArg::Yes,
1470+
occur: Occur::Req,
14991471
aliases: Vec::new(),
15001472
};
1501-
short.aliases = vec!(Opt { name: Short('b'),
1502-
hasarg: Yes,
1503-
occur: Req,
1473+
short.aliases = vec!(Opt { name: Name::Short('b'),
1474+
hasarg: HasArg::Yes,
1475+
occur: Occur::Req,
15041476
aliases: Vec::new() });
15051477
let verbose = reqopt("b", "banana", "some bananas", "VAL");
15061478

trunk/src/liblibc/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pub use funcs::bsd43::{shutdown};
192192
#[cfg(unix)] pub use types::os::arch::posix01::{stat, utimbuf};
193193
#[cfg(unix)] pub use types::os::common::bsd44::{ifaddrs};
194194
#[cfg(unix)] pub use funcs::posix88::unistd::{sysconf, setgid, setsid, setuid, pread, pwrite};
195-
#[cfg(unix)] pub use funcs::posix88::unistd::{getgid, getuid};
195+
#[cfg(unix)] pub use funcs::posix88::unistd::{getgid, getuid, getsid};
196196
#[cfg(unix)] pub use funcs::posix88::unistd::{_PC_NAME_MAX, utime, nanosleep, pathconf, link};
197197
#[cfg(unix)] pub use funcs::posix88::unistd::{chown};
198198
#[cfg(unix)] pub use funcs::posix88::mman::{mmap, munmap, mprotect};
@@ -4402,6 +4402,7 @@ pub mod funcs {
44024402
pub fn getpid() -> pid_t;
44034403
pub fn getppid() -> pid_t;
44044404
pub fn getuid() -> uid_t;
4405+
pub fn getsid(pid: pid_t) -> pid_t;
44054406
pub fn isatty(fd: c_int) -> c_int;
44064407
pub fn link(src: *const c_char, dst: *const c_char) -> c_int;
44074408
pub fn lseek(fd: c_int, offset: off_t, whence: c_int)

0 commit comments

Comments
 (0)