Commit Graph

916 Commits

Author SHA1 Message Date
Patrick Walton
a61a3678eb librustuv: Remove all non-proc uses of do from libextra and
`librustuv`.
2013-11-26 08:24:18 -08:00
Patrick Walton
9e610573ba librustc: Remove remaining uses of &fn() in favor of ||. 2013-11-26 08:20:58 -08:00
Marvin Löbel
24b316a3b9 Removed unneccessary _iter suffixes from various APIs 2013-11-26 10:02:26 +01:00
bors
e632c440f8 auto merge of #10658 : LeoTestard/rust/serialize-rc, r=cmr
Implement various traits (IterBytes and extra's Encodable and Decodable) for Rc<T> when T alreay implements the trait.
2013-11-25 13:11:43 -08:00
Léo Testard
b6ab4f2485 Add an implementation of Encodable and Decodable for Rc. This will be needed to use Rc in place of @ in libsyntax. 2013-11-25 19:45:51 +01:00
bors
f1bec46e15 auto merge of #10648 : sfackler/rust/base64-test, r=alexcrichton
We want a 1000 element array, not a 2 element array
2013-11-25 06:56:40 -08:00
Steven Fackler
98f47aa67d Fix typo in base64 test
We want a 1000 element array, not a 2 element array
2013-11-25 00:10:31 -08:00
bors
2cc1e16ac0 auto merge of #10603 : alexcrichton/rust/no-linked-failure, r=brson
The reasons for doing this are:

* The model on which linked failure is based is inherently complex
* The implementation is also very complex, and there are few remaining who
  fully understand the implementation
* There are existing race conditions in the core context switching function of
  the scheduler, and possibly others.
* It's unclear whether this model of linked failure maps well to a 1:1 threading
  model

Linked failure is often a desired aspect of tasks, but we would like to take a
much more conservative approach in re-implementing linked failure if at all.

Closes #8674
Closes #8318
Closes #8863
2013-11-24 21:32:13 -08:00
Alex Crichton
acca9e3834 Remove linked failure from the runtime
The reasons for doing this are:

* The model on which linked failure is based is inherently complex
* The implementation is also very complex, and there are few remaining who
  fully understand the implementation
* There are existing race conditions in the core context switching function of
  the scheduler, and possibly others.
* It's unclear whether this model of linked failure maps well to a 1:1 threading
  model

Linked failure is often a desired aspect of tasks, but we would like to take a
much more conservative approach in re-implementing linked failure if at all.

Closes #8674
Closes #8318
Closes #8863
2013-11-24 21:21:12 -08:00
Luqman Aden
2431ac3080 libextra: Remove @mut from term. 2013-11-24 18:22:50 -05:00
Huon Wilson
b052f28fd6 extra: improve the errors for the JSON Decoder.
Fixes #4244.
2013-11-24 10:34:27 +11:00
Steven Fackler
3e637d505e Remove NonCopyable::new
The issue that required it has been fixed.
2013-11-19 20:27:48 -08:00
Patrick Walton
18a30aff45 libextra: Convert uses of &fn(A)->B to |A|->B. 2013-11-19 12:40:19 -08:00
bors
f4c22f75d4 auto merge of #10561 : pcwalton/rust/procify, r=alexcrichton
r? @alexcrichton
2013-11-18 23:06:29 -08:00
bors
ab7fe9dd06 auto merge of #10458 : yichoi/rust/make_check_pass_android2, r=brson
To enable test on android bot #9120

 workcache::test disabled and run-pass/core-run-destroy.rs fixed on android
2013-11-18 18:56:31 -08:00
Patrick Walton
ba739b2135 librustc: Convert ~fn() to proc() everywhere. 2013-11-18 18:27:31 -08:00
Patrick Walton
6a5736d704 libextra: Remove ~fn() from libextra. 2013-11-18 18:27:30 -08:00
Brian Anderson
f4c222f7a3 rt: Namespace all C functions under rust_ 2013-11-18 16:17:43 -08:00
Young-il Choi
88831383b4 temporarily disable tests on android and tagging issue number #10455 2013-11-19 09:08:47 +09:00
bors
8eda5d8315 auto merge of #10443 : alexcrichton/rust/meaninless-pub-priv, r=cmr
Closes #10111
2013-11-17 22:21:23 -08:00
Alex Crichton
dab8fec4af Forbid privacy in inner functions
Closes #10111
2013-11-17 21:28:18 -08:00
bors
2c9e56f0ed auto merge of #10532 : dhodder/rust/master, r=alexcrichton
Hello.  This is just a tiny doc update -- I'm new here, so apologies if I'm doing it wrong.
2013-11-17 15:11:41 -08:00
Dave Hodder
48f76a0577 Add doc comment for extra::url::query_to_str 2013-11-17 16:52:14 +00:00
Huon Wilson
c8e6a38693 extra: handle an edge case in BigUint.to_str().
If any of the digits was one past the maximum (e.g. 10**9 for base 10),
then this wasn't detected correctly and so the length of the digit was
one more than expected, causing a very large allocation.

Fixes #10522.
Fixes #10288.
2013-11-17 16:05:01 +11:00
Kiet Tran
d902e7148b Add lru_cache to libextra 2013-11-13 21:06:18 -05:00
bors
2b2a89d97f auto merge of #10447 : alexcrichton/rust/flaky-time-test, r=catamorphism
This test was failing periodically on windows and other platforms, and in
debugging the issue locally I've found that the previous test was failing
at the assertion `ns0 <= ns1`. Upon inspecting the values, the two numbers were
very close to one another, but off by a little bit.

I believe that this is because `precise_time_s` goes from `u64` -> `f64` and
then we go again back to `u64` for the assertion. This conversion is a lossy one
that's not always guaranteed to succeed, so instead I've changed the test to
only compare against u64 instances.
2013-11-13 13:31:24 -08:00
Alex Crichton
b9b908f62f Make a time test less flaky
This test was failing periodically on windows and other platforms, and in
debugging the issue locally I've found that the previous test was failing
at the assertion `ns0 <= ns1`. Upon inspecting the values, the two numbers were
very close to one another, but off by a little bit.

I believe that this is because `precise_time_s` goes from `u64` -> `f64` and
then we go again back to `u64` for the assertion. This conversion is a lossy one
that's not always guaranteed to succeed, so instead I've changed the test to
only compare against u64 instances.
2013-11-12 11:44:14 -08:00
Alex Crichton
49ee49296b Move std::rt::io to std::io 2013-11-11 20:44:07 -08:00
Alex Crichton
7755ffd013 Remove #[fixed_stack_segment] and #[rust_stack]
These two attributes are no longer useful now that Rust has decided to leave
segmented stacks behind. It is assumed that the rust task's stack is always
large enough to make an FFI call (due to the stack being very large).

There's always the case of stack overflow, however, to consider. This does not
change the behavior of stack overflow in Rust. This is still normally triggered
by the __morestack function and aborts the whole process.

C stack overflow will continue to corrupt the stack, however (as it did before
this commit as well). The future improvement of a guard page at the end of every
rust stack is still unimplemented and is intended to be the mechanism through
which we attempt to detect C stack overflow.

Closes #8822
Closes #10155
2013-11-11 10:40:34 -08:00
Huon Wilson
8e719bdfb5 extra::getopts: update docs for minor renaming. 2013-11-10 23:28:26 +11:00
bors
8379890c05 auto merge of #10153 : nikomatsakis/rust/issue-4846-multiple-lifetime-parameters-7, r=pnkfelix
Fully support multiple lifetime parameters on types and elsewhere, removing special treatment for `'self`. I am submitting this a touch early in that I plan to push a new commit with more tests specifically targeting types with multiple lifetime parameters -- but the current code bootstraps and passes `make check`.

Fixes #4846
2013-11-09 08:36:09 -08:00
bors
dc5d9b908f auto merge of #10372 : catamorphism/rust/rustpkg-issue-9311, r=catamorphism
and use opt_str instead of opt_val in rustpkg

Closes #9311
2013-11-09 06:11:10 -08:00
Niko Matsakis
5e54a7323d Update various tests and libraries that were incorrectly
annotated.
2013-11-08 19:45:50 -05:00
Tim Chevalier
06b2905ee1 extra / rustpkg: Make getopts::opt_val private again
and use opt_str instead of opt_val in rustpkg

Closes #9311
2013-11-08 16:20:25 -08:00
Andrei Formiga
455de85163 Specify package_id for rust libs, to avoid spurious warnings 2013-11-08 17:42:46 -03:00
bors
57d1ed819b auto merge of #10303 : niftynif/rust/master, r=catamorphism
r? @catamorphism
First contribution; contains struct definitions and some useful traits.  Can possibly be improved by removing the dependence on the Clone trait.  This is intended to be the beginning of a long-term project.
2013-11-08 00:11:07 -08:00
niftynif
2f1b4335cb Added proper //! documentation to the beginning of btree.rs. 2013-11-08 02:41:09 -05:00
bors
075347b445 auto merge of #10281 : klutzy/rust/rt-timezone, r=alexcrichton
Previously #9418 fixed utf-8 assertion issue by wcsftime,
but the function didn't work as expected: it follows the locale
set by setlocale(), not the system code page.
This patch fixes it by manual multibyte-to-unicode conversion.
2013-11-07 21:41:07 -08:00
klutzy
fe18fe0f88 extra::time: Fix test on Windows
Closes #10307
2013-11-08 14:19:25 +09:00
bors
d26776a775 auto merge of #10340 : eholk/rust/url, r=brson
According to http://tools.ietf.org/html/rfc3986, ~ is a legal character in URLs.
2013-11-07 20:26:10 -08:00
Huon Wilson
b95a8c63fd std::ascii: Provide a copyless [Ascii] -> str method.
This renames to_str_ascii to as_str_ascii and makes it non-copying,
which is possible now that strings no longer have a hidden extra
byte/null terminator.

Fixes #6120.
2013-11-08 10:20:06 +11:00
Eric Holk
0a478b4ac6 Add ~ to the list of allowable URL characters. 2013-11-07 17:21:33 -05:00
niftynif
fbde419b38 Addressed style concerns in btree.rs and added it to the lib file.
Added documentation within btree.rs.
2013-11-07 13:34:20 -05:00
niftynif
058d785369 Re-arranging some things in btree.rs to accommodate testing. 2013-11-05 19:44:21 -05:00
niftynif
e6dde28c95 Added skeleton implementation of a B-tree with a few bells and
whistles.  No major functionality added yet (such as insertion and
removal).
2013-11-04 19:45:49 -05:00
Alex Crichton
3c3ed1499a Move io::file to io::fs and fns out of File
This renames the `file` module to `fs` because that more accurately describes
its current purpose (manipulating the filesystem, not just files).

Additionally, this adds an UnstableFileStat structure as a nested structure of
FileStat to signify that the fields should not be depended on. The structure is
currently flagged with #[unstable], but it's unlikely that it has much meaning.

Closes #10241
2013-11-04 10:28:55 -08:00
Alex Crichton
f19d083362 Fill out the remaining functionality in io::file
This adds bindings to the remaining functions provided by libuv, all of which
are useful operations on files which need to get exposed somehow.

Some highlights:

* Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type
* Moved all file-related methods to be static methods under `File`
* All directory related methods are still top-level functions
* Created `io::FilePermission` types (backed by u32) that are what you'd expect
* Created `io::FileType` and refactored `FileStat` to use FileType and
  FilePermission
* Removed the expanding matrix of `FileMode` operations. The mode of reading a
  file will not have the O_CREAT flag, but a write mode will always have the
  O_CREAT flag.

Closes #10130
Closes #10131
Closes #10121
2013-11-03 15:15:42 -08:00
Alex Crichton
9c1851019f Remove all blocking std::os blocking functions
This commit moves all thread-blocking I/O functions from the std::os module.
Their replacements can be found in either std::rt::io::file or in a hidden
"old_os" module inside of native::file. I didn't want to outright delete these
functions because they have a lot of special casing learned over time for each
OS/platform, and I imagine that these will someday get integrated into a
blocking implementation of IoFactory. For now, they're moved to a private module
to prevent bitrot and still have tests to ensure that they work.

I've also expanded the extensions to a few more methods defined on Path, most of
which were previously defined in std::os but now have non-thread-blocking
implementations as part of using the current IoFactory.

The api of io::file is in flux, but I plan on changing it in the next commit as
well.

Closes #10057
2013-11-03 15:15:42 -08:00
Chris Morgan
0369a41f0e Rename files to match current recommendations.
New standards have arisen in recent months, mostly for the use of
rustpkg, but the main Rust codebase has not been altered to match these
new specifications. This changeset rectifies most of these issues.

- Renamed the crate source files `src/libX/X.rs` to `lib.rs`, for
  consistency with current styles; this affects extra, rustc, rustdoc,
  rustpkg, rustuv, std, syntax.

- Renamed `X/X.rs` to `X/mod.rs,` as is now recommended style, for
  `std::num` and `std::terminfo`.

- Shifted `src/libstd/str/ascii.rs` out of the otherwise unused `str`
  directory, to be consistent with its import path of `std::ascii`;
  libstd is flat at present so it's more appropriate thus.

While this removes some `#[path = "..."]` directives, it does not remove
all of them, and leaves certain other inconsistencies, such as `std::u8`
et al. which are actually stored in `src/libstd/num/` (one subdirectory
down). No quorum has been reached on this issue, so I felt it best to
leave them all alone at present. #9208 deals with the possibility of
making libstd more hierarchical (such as changing the crate to match the
current filesystem structure, which would make the module path
`std::num::u8`).

There is one thing remaining in which this repository is not
rustpkg-compliant: rustpkg would have `src/std/` et al. rather than
`src/libstd/` et al. I have not endeavoured to change that at this point
as it would guarantee prompt bitrot and confusion. A change of that
magnitude needs to be discussed first.
2013-11-03 23:49:01 +11:00
Alex Crichton
9df164c145 Register new snapshots
Closes #2240
2013-11-01 16:51:33 -07:00
Alex Crichton
e2a68b6867 Give test and main tasks better names
Tests now have the same name as the test that they're running (to allow for
easier diagnosing of failure sources), and the main task is now specially named
<main> instead of <unnamed>.

Closes #10195
Closes #10073
2013-11-01 09:16:11 -07:00
bors
c7d5a52144 auto merge of #10189 : alexcrichton/rust/inner-statics, r=cmr
Closes #9186
2013-10-31 04:46:34 -07:00
Alex Crichton
0db50056ae Forbid type parameters in inner statics
Closes #9186
2013-10-30 19:52:00 -07:00
bors
f73a48e9fd auto merge of #10120 : Kimundi/rust/remove_sys, r=alexcrichton
- `begin_unwind` and `fail!` is now generic over any `T: Any + Send`.
- Every value you fail with gets boxed as an `~Any`.
- Because of implementation issues, `&'static str` and `~str` are still
  handled specially behind the scenes.
- Changed the big macro source string in libsyntax to a raw string
  literal, and enabled doc comments there.
2013-10-30 18:31:26 -07:00
Marvin Löbel
54f4dcd76a Prepared std::sys for removal, and made begin_unwind simpler
- `begin_unwind` is now generic over any `T: Any + Send`.
- Every value you fail with gets boxed as an `~Any`.
- Because of implementation details, `&'static str` and `~str` are still
  handled specially behind the scenes.
- Changed the big macro source string in libsyntax to a raw string
  literal, and enabled doc comments there.
2013-10-30 21:19:18 +01:00
Jed Davis
727731f89e Assorted cleanups suggested by reviewers. 2013-10-29 09:09:20 -07:00
Jed Davis
c8c08763ec Add repr attributes in various places that need them. 2013-10-29 09:09:20 -07:00
Alex Crichton
2290131543 Register new snapshots 2013-10-28 16:56:24 -07:00
Alex Crichton
72557d8312 Remove the extension traits for Readers/Writers
These methods are all excellent candidates for default methods, so there's no
need to require extra imports of various traits.
2013-10-28 10:16:45 -07:00
Marvin Löbel
fa8e71a825 Allow fail messages to be caught, and introduce the Any trait
Some code cleanup, sorting of import blocks

Removed std::unstable::UnsafeArc's use of Either

Added run-fail tests for the new FailWithCause impls

Changed future_result and try to return Result<(), ~Any>.

- Internally, there is an enum of possible fail messages passend around.
- In case of linked failure or a string message, the ~Any gets
  lazyly allocated in future_results recv method.
- For that, future result now returns a wrapper around a Port.
- Moved and renamed task::TaskResult into rt::task::UnwindResult
  and made it an internal enum.
- Introduced a replacement typedef `type TaskResult = Result<(), ~Any>`.
2013-10-28 08:50:32 +01:00
bors
cb5b21eba7 auto merge of #10050 : gifnksm/rust/ratio-methods, r=pcwalton
After merging 0ada7c7, user code have not been able to access to `Ratio`'s numerator and denominator fields.
In some algorithms, it is needed to get an rational number's numerator or denominator, but keeping these fields private is necessary for guaranteeing that `Ratio` numbers are irreducible.
So, I added the getter methods `numer()` and `denom()`.

As a bonus, this commit adds utility methods relating to the ratio-integer conversion.
2013-10-27 22:41:18 -07:00
Palmer Cox
ff9e573a67 Remove MD4. 2013-10-27 21:25:19 -04:00
Palmer Cox
653ee13839 Remove MD5 and Sha2. Move Sha1 and support code into librustpkg. 2013-10-27 21:25:19 -04:00
Palmer Cox
c5f10b47f3 Update workcache to no longer use Sha1. 2013-10-27 21:25:19 -04:00
bors
deeca5d586 auto merge of #10054 : alexcrichton/rust/basic-event-loop, r=brson
This is more progress towards #9128 and all its related tree of issues. This implements a new `BasicLoop` on top of pthreads synchronization primitives (wrapped in `LittleLock`). This also removes the wonky `callback_ms` function from the interface of the event loop.

After #9901 is taking forever to land, I'm going to try to do all this runtime work in much smaller chunks than before. Right now this will not work unless #9901 lands first, but I'm close to landing it (hopefully), and I wanted to go ahead and get this reviewed before throwing it at bors later on down the road.

This "pausible idle callback" is also a bit of a weird idea, but it wasn't as difficult to implement as callback_ms so I'm more semi-ok with it.
2013-10-25 00:46:11 -07:00
Alex Crichton
64a5c3bc1e Implement a basic event loop built on LittleLock
It's not guaranteed that there will always be an event loop to run, and this
implementation will serve as an incredibly basic one which does not provide any
I/O, but allows the scheduler to still run.

cc #9128
2013-10-24 23:49:11 -07:00
bors
b0c475229a auto merge of #10055 : pcwalton/rust/arc-clone-inline, r=alexcrichton
r? @thestinger
2013-10-24 17:36:07 -07:00
Alex Crichton
188e471339 Another round of test fixes and merge conflicts 2013-10-24 14:22:35 -07:00
Alex Crichton
6bb1df9251 Remove std::io once and for all! 2013-10-24 14:22:34 -07:00
Alex Crichton
c4907cfd14 Remove std::io from ebml 2013-10-24 14:21:58 -07:00
Alex Crichton
61ed2cfb55 Remove even more of std::io
Big fish fried here:

    extra::json
    most of the compiler
    extra::io_util removed
    extra::fileinput removed

Fish left to fry

    extra::ebml
2013-10-24 14:21:57 -07:00
Patrick Walton
b13415cccc libextra: Make arc::get and arc::new inline too.
Should be a 2x improvement in a Servo test case.
2013-10-24 13:50:21 -07:00
Patrick Walton
76287ccbb0 libextra: Make arc clone inline 2013-10-24 13:21:49 -07:00
gifnksm
7d5c7b8083 extra: Add getter methods to extra::rational::Ratio
After merging 0ada7c7, user code have not been able to access to `Ratio`'s numerator and denominator fields.
In some algorithms, it is needed to get an rational number's numerator or denominator, but keeping these fields private is necessary for guaranteeing that `Ratio` numbers are irreducible.
So, I added the getter methods `numer()` and `denom()`.

As a bonus, this commit adds utility methods relating to the ratio-integer conversion.
2013-10-24 23:05:03 +09:00
bors
e2428b791c auto merge of #10032 : thestinger/rust/snapshot, r=huonw 2013-10-23 15:11:07 -07:00
Daniel Micay
142672dca4 register snapshots 2013-10-23 18:06:12 -04:00
bors
f09959361b auto merge of #10034 : sfackler/rust/time, r=alexcrichton
These are supposed to be raw C-like structs mirroring time.h's struct tm
and struct timespec.
2013-10-23 09:41:14 -07:00
Steven Fackler
870f3bc341 Re-make time struct fields public
These are supposed to be raw C-like structs mirroring time.h's struct tm
and struct timespec.
2013-10-23 09:06:31 -07:00
bors
a4ec8af4c5 auto merge of #9810 : huonw/rust/rand3, r=alexcrichton
- Adds the `Sample` and `IndependentSample` traits for generating numbers where there are parameters (e.g. a list of elements to draw from, or the mean/variance of a normal distribution). The former takes `&mut self` and the latter takes `&self` (this is the only difference).
- Adds proper `Normal` and `Exp`-onential distributions
- Adds `Range` which generates `[lo, hi)` generically & properly (via a new trait) replacing the incorrect behaviour of `Rng.gen_integer_range` (this has become `Rng.gen_range` for convenience, it's far more efficient to use `Range` itself)
- Move the `Weighted` struct from `std::rand` to `std::rand::distributions` & improve it
- optimisations and docs
2013-10-23 08:31:21 -07:00
Huon Wilson
148f737c19 std::rand: add distributions::Range for generating [lo, hi).
This reifies the computations required for uniformity done by
(the old) `Rng.gen_integer_range` (now Rng.gen_range), so that they can
be amortised over many invocations, if it is called in a loop.

Also, it makes it correct, but using a trait + impls for each type,
rather than trying to coerce `Int` + `u64` to do the right thing. This
also makes it more extensible, e.g. big integers could & should
implement SampleRange.
2013-10-23 10:40:06 +11:00
reedlepee
92662a9f91 Removed unnecessary comments and white spaces as suggested 2013-10-23 01:10:50 +05:30
reedlepee
ad465441ba Removed Unnecessary comments and white spaces #4386 2013-10-23 01:10:50 +05:30
reedlepee
0ada7c7ffe Making fields in std and extra : private #4386 2013-10-23 01:10:50 +05:30
Alex Crichton
daf5f5a4d1 Drop the '2' suffix from logging macros
Who doesn't like a massive renaming?
2013-10-22 08:09:56 -07:00
Georges Dubus
1dc3d0bf86 Add support for nested comments
Fixes #9468.
2013-10-21 21:58:34 +02:00
Tim Chevalier
1cf029c229 rustpkg: Make rustpkg tests stop comparing dates
Instead of scrutinizing modification times in rustpkg tests,
change output files to be read-only and detect attempts to write
to them (hack suggested by Jack). This avoids time granularity problems.

As part of this change, I discovered that some dependencies weren't
getting written correctly (involving built executables and library
files), so this patch fixes that too.

This partly addresses #9441, but one test (test_rebuild_when_needed)
is still ignored on Linux.
2013-10-18 18:36:17 -07:00
bors
a1848bc755 auto merge of #9927 : chris-morgan/rust/fix-url-to_str-so-it-includes-the-port, r=huonw
Fixes #9451.
Fixes chris-morgan/rust-http#16.
2013-10-18 07:21:25 -07:00
Chris Morgan
1093730d72 Fix extra::url::to_str to include the port.
Fixes #9451.
Fixes chris-morgan/rust-http#16.
2013-10-19 00:25:03 +11:00
bors
3f240fedec auto merge of #9926 : Kimundi/rust/future_result_bad_sig, r=huonw 2013-10-18 06:11:18 -07:00
Marvin Löbel
3011801256 Made std::task::TaskBuilder::future_result() easier to use 2013-10-18 10:43:41 +02:00
Brian Anderson
34d376f3cf std: Move size/align functions to std::mem. #2240 2013-10-17 17:31:35 -07:00
bors
386fa1d818 auto merge of #9897 : thestinger/rust/rusti, r=alexcrichton
Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
Closes #5038
2013-10-17 01:36:33 -07:00
bors
6c08cc2db4 auto merge of #9846 : cmr/rust/serialize_uuid, r=alexcrichton 2013-10-16 21:41:23 -07:00
Daniel Micay
f766acad62 drop the linenoise library
Closes #5038
2013-10-16 22:57:51 -04:00
Corey Richardson
75cedf8e62 uuid: serialize test and documentations 2013-10-16 21:36:41 -04:00
bors
c92f2168d4 auto merge of #9833 : alexcrichton/rust/fixes, r=brson
Commits have all the fun details
2013-10-16 18:11:22 -07:00
bors
40180cdbea auto merge of #9655 : kballard/rust/path-rewrite, r=alexcrichton
Rewrite the entire `std::path` module from scratch.

`PosixPath` is now based on `~[u8]`, which fixes #7225.
Unnecessary allocation has been eliminated.

There are a lot of clients of `Path` that still assume utf-8 paths.
This is covered in #9639.
2013-10-16 11:26:35 -07:00
Kevin Ballard
6eade9e914 path2: Update for latest master
Also fix some issues that crept into earlier commits during the conflict
resoution for the rebase.
2013-10-16 11:18:06 -07:00
Kevin Ballard
bab7eb20df path2: Update based on more review feedback
Standardize the is_sep() functions to be the same in both posix and
windows, and re-export from path. Update extra::glob to use this.

Remove the usage of either, as it's going away.

Move the WindowsPath-specific methods out of WindowsPath and make them
top-level functions of path::windows instead. This way you cannot
accidentally write code that will fail to compile on non-windows
architectures without typing ::windows anywhere.

Remove GenericPath::from_c_str() and just impl BytesContainer for
CString instead.

Remove .join_path() and .push_path() and just implement BytesContainer
for Path instead.

Remove FilenameDisplay and add a boolean flag to Display instead.

Remove .each_parent(). It only had one caller, so just inline its
definition there.
2013-10-16 10:26:48 -07:00
Alex Crichton
a84c2999c9 Require module documentation with missing_doc
Closes #9824
2013-10-15 22:27:10 -07:00