Commit Graph

613 Commits

Author SHA1 Message Date
Patrick Walton
ed819c9a81 librustc: De-@mut the crate cache in the crate reader 2013-12-26 15:54:37 -08:00
Patrick Walton
620be9235d librustc: De-@mut the cnum_map 2013-12-26 15:54:34 -08:00
Patrick Walton
df0c13d2ea librustc: De-@mut the encoding stats 2013-12-26 15:54:34 -08:00
Patrick Walton
2551344928 librustc: De-@mut all remaining uses of MemWriter 2013-12-26 15:54:33 -08:00
Patrick Walton
b9568cdf36 librustc: De-@mut creader::Env 2013-12-26 15:54:32 -08:00
Patrick Walton
473d048095 librustc: De-@mut several instances of io::Writer.
There are a few more related to pretty printing.
2013-12-26 15:54:31 -08:00
Patrick Walton
8ee8d2b4b9 librustc: De-@mut arrays of entry used in the encoder 2013-12-26 15:54:31 -08:00
Patrick Walton
02d31b7d1a librustc: De-@mut the additional library search paths 2013-12-26 15:54:31 -08:00
Patrick Walton
ea63a18500 librustc: De-@mut Rib::bindings 2013-12-26 15:54:31 -08:00
Patrick Walton
f73dee17fc librustc: De-@mut the export map 2013-12-26 15:54:30 -08:00
Patrick Walton
2ae76e120a librustc: De-@mut the type_abbrevs table 2013-12-26 15:54:29 -08:00
Patrick Walton
fbb70d916f librustc: De-@mut the reachable map 2013-12-26 15:54:29 -08:00
Patrick Walton
43aee50798 librustc: De-@mut cstore::CStore 2013-12-26 15:54:29 -08:00
Patrick Walton
79d97ca4aa librustc: De-@mut CStore::used_link_args 2013-12-26 15:54:29 -08:00
Patrick Walton
af1184030b librustc: De-@mut CStore::used_libraries 2013-12-26 15:54:29 -08:00
Patrick Walton
3528f74335 librustc: De-@mut CStore::used_crate_sources 2013-12-26 15:54:29 -08:00
Patrick Walton
978b6bf5a1 librustc: De-@mut CStore::extern_mod_crate_map 2013-12-26 15:54:29 -08:00
Patrick Walton
df373e6fbe librustc: De-@mut CStore::metas 2013-12-26 15:54:28 -08:00
Patrick Walton
2fb33285e6 libextra: Stop using @mut MemWriter in the EBML module 2013-12-26 15:54:28 -08:00
Patrick Walton
ea5368ce6e librustc: De-@mut ty::ctxt_::rcache 2013-12-26 13:01:28 -08:00
Patrick Walton
55a7b2fedd librustc: De-@mut the impls table in the type context 2013-12-26 13:01:28 -08:00
Patrick Walton
42f7f7f437 librustc: De-@mut inherent_impls in the type context 2013-12-26 13:01:28 -08:00
Patrick Walton
c554d23a9a librustc: De-@mut trait_impls in the type context 2013-12-26 13:01:27 -08:00
Patrick Walton
b5aa6eb69f librustc: De-@mut CrateContext::non_inlineable_statics 2013-12-26 13:01:24 -08:00
Patrick Walton
5dcc5165a6 librustc: Remove unused discrim_symbols field from the crate context 2013-12-26 13:01:23 -08:00
Patrick Walton
df7f1374d7 librustc: De-@mut item_symbols 2013-12-26 13:01:23 -08:00
Patrick Walton
2e46ac6449 librustc: De-@mut the short names cache 2013-12-26 13:01:22 -08:00
Patrick Walton
02f13adaa3 librustc: De-@mut the trait_methods_cache 2013-12-26 13:01:22 -08:00
Steven Fackler
c7cf5dc270 Method-ify CStore 2013-12-25 21:50:36 -07:00
bors
55cbef611a auto merge of #11064 : huonw/rust/vec-sort, r=alexcrichton
This uses quite a bit of unsafe code for speed and failure safety, and allocates `2*n` temporary storage.

[Performance](https://gist.github.com/huonw/5547f2478380288a28c2):

|      n |      new | priority_queue |   quick3 |
|-------:|---------:|---------------:|---------:|
|      5 |      200 |            155 |      106 |
|    100 |     6490 |           8750 |     5810 |
|  10000 |  1300000 |        1790000 |  1060000 |
| 100000 | 16700000 |       23600000 | 12700000 |
| sorted |   520000 |        1380000 | 53900000 |
|  trend |  1310000 |        1690000 |  1100000 |

(The times are in nanoseconds, having subtracted the set-up time (i.e. the `just_generate` bench target).)

I imagine that there is still significant room for improvement, particularly because both priority_queue and quick3 are doing a static call via `Ord` or `TotalOrd` for the comparisons, while this is using a (boxed) closure.

Also, this code does not `clone`, unlike `quick_sort3`; and is stable, unlike both of the others.
2013-12-22 00:41:39 -08:00
Huon Wilson
2e8c522c62 std::vec: make the sorting closure use Ordering rather than just being
(implicitly) less_eq.
2013-12-22 18:16:50 +11:00
Huon Wilson
1b1e4caa79 std::vec: add a sugary .sort() method for plain Ord sorting.
This moves the custom sorting to `.sort_by`.
2013-12-21 09:35:18 +11:00
bors
6023350082 auto merge of #11017 : alexcrichton/rust/faster-read, r=thestinger
We were previously reading metadata via `ar p`, but as learned from rustdoc
awhile back, spawning a process to do something is pretty slow. Turns out LLVM
has an Archive class to read archives, but it cannot write archives.

This commits adds bindings to the read-only version of the LLVM archive class
(with a new type that only has a read() method), and then it uses this class
when reading the metadata out of rlibs. When you put this in tandem of not
compressing the metadata, reading the metadata is 4x faster than it used to be
The timings I got for reading metadata from the respective libraries was:

    libstd-04ff901e-0.9-pre.dylib    => 100ms
    libstd-04ff901e-0.9-pre.rlib     => 23ms
    librustuv-7945354c-0.9-pre.dylib => 4ms
    librustuv-7945354c-0.9-pre.rlib  => 1ms
    librustc-5b94a16f-0.9-pre.dylib  => 87ms
    librustc-5b94a16f-0.9-pre.rlib   => 35ms
    libextra-a6ebb16f-0.9-pre.dylib  => 63ms
    libextra-a6ebb16f-0.9-pre.rlib   => 15ms
    libsyntax-2e4c0458-0.9-pre.dylib => 86ms
    libsyntax-2e4c0458-0.9-pre.rlib  => 22ms

In order to always take advantage of these faster metadata read-times, I sort
the files in filesearch based on whether they have an rlib extension or not
(prefer all rlib files first).

Overall, this halved the compile time for a `fn main() {}` crate from 0.185s to
0.095s on my system (when preferring dynamic linking). Reading metadata is still
the slowest pass of the compiler at 0.035s, but it's getting pretty close to
linking at 0.021s! The next best optimization is to just not copy the metadata
from LLVM because that's the most expensive part of reading metadata right now.
2013-12-20 02:06:34 -08:00
Alex Crichton
64faafba19 rustc: Optimize reading metadata by 4x
We were previously reading metadata via `ar p`, but as learned from rustdoc
awhile back, spawning a process to do something is pretty slow. Turns out LLVM
has an Archive class to read archives, but it cannot write archives.

This commits adds bindings to the read-only version of the LLVM archive class
(with a new type that only has a read() method), and then it uses this class
when reading the metadata out of rlibs. When you put this in tandem of not
compressing the metadata, reading the metadata is 4x faster than it used to be
The timings I got for reading metadata from the respective libraries was:

    libstd-04ff901e-0.9-pre.dylib    => 100ms
    libstd-04ff901e-0.9-pre.rlib     => 23ms
    librustuv-7945354c-0.9-pre.dylib => 4ms
    librustuv-7945354c-0.9-pre.rlib  => 1ms
    librustc-5b94a16f-0.9-pre.dylib  => 87ms
    librustc-5b94a16f-0.9-pre.rlib   => 35ms
    libextra-a6ebb16f-0.9-pre.dylib  => 63ms
    libextra-a6ebb16f-0.9-pre.rlib   => 15ms
    libsyntax-2e4c0458-0.9-pre.dylib => 86ms
    libsyntax-2e4c0458-0.9-pre.rlib  => 22ms

In order to always take advantage of these faster metadata read-times, I sort
the files in filesearch based on whether they have an rlib extension or not
(prefer all rlib files first).

Overall, this halved the compile time for a `fn main() {}` crate from 0.185s to
0.095s on my system (when preferring dynamic linking). Reading metadata is still
the slowest pass of the compiler at 0.035s, but it's getting pretty close to
linking at 0.021s! The next best optimization is to just not copy the metadata
from LLVM because that's the most expensive part of reading metadata right now.
2013-12-19 23:34:32 -08:00
bors
bb02d147fe auto merge of #11073 : klutzy/rust/issue-10978, r=alexcrichton
This patchset fixes small glitches which caused #10978.
2013-12-19 20:06:36 -08:00
Huon Wilson
48fedcb36f extra: remove sort in favour of the std method.
Fixes #9676.
2013-12-20 12:38:46 +11:00
bors
5c24bfa8c3 auto merge of #11057 : alexcrichton/rust/no-at-in-ebml, r=pcwalton
Now that the metadata is an owned value with a lifetime of a borrowed byte
slice, it's possible to have future optimizations where the metadata doesn't
need to be copied around (very expensive operation).
2013-12-19 17:11:40 -08:00
Alex Crichton
73fceca7d6 Purge @-boxes from the reading half of EBML
Now that the metadata is an owned value with a lifetime of a borrowed byte
slice, it's possible to have future optimizations where the metadata doesn't
need to be copied around (very expensive operation).
2013-12-19 17:08:05 -08:00
Patrick Walton
b982f08a66 librustc: Add missing case for the Pod bound in tydecode. 2013-12-19 14:13:19 -08:00
klutzy
2afa97a346 rustc: Handle #[link(name = "")] error 2013-12-20 01:53:41 +09:00
Corey Richardson
dee1107571 Rename pkgid to crate_id
Closes #11035
2013-12-19 10:10:23 -05:00
bors
dc65762d79 auto merge of #10990 : ktt3ja/rust/method-stability, r=huonw
If it's a trait method, this checks the stability attribute of the
method inside the trait definition. Otherwise, it checks the method
implementation itself.

Close #8961.
2013-12-17 02:31:55 -08:00
Patrick Walton
caf34b41c3 librustc: Implement a Pod kind for types that can be memcpy'd.
This will be used for the new `Cell`.
2013-12-16 22:38:02 -08:00
Kiet Tran
4f95dceb59 Detect stability attributes on methods.
If it's a trait method, this checks the stability attribute of the
method inside the trait definition. Otherwise, it checks the method
implementation itself.
2013-12-16 16:25:45 -05:00
Erik Price
5731ca3078 Make 'self lifetime illegal.
Also remove all instances of 'self within the codebase.

This fixes #10889.
2013-12-11 10:54:06 -08:00
Jack Moffitt
b349036e5f Make crate hash stable and externally computable.
This replaces the link meta attributes with a pkgid attribute and uses a hash
of this as the crate hash. This makes the crate hash computable by things
other than the Rust compiler. It also switches the hash function ot SHA1 since
that is much more likely to be available in shell, Python, etc than SipHash.

Fixes #10188, #8523.
2013-12-10 17:04:24 -07:00
Alex Crichton
52b835c5e7 Store metadata separately in rlib files
Right now whenever an rlib file is linked against, all of the metadata from the
rlib is pulled in to the final staticlib or binary. The reason for this is that
the metadata is currently stored in a section of the object file. Note that this
is intentional for dynamic libraries in order to distribute metadata bundled
with static libraries.

This commit alters the situation for rlib libraries to instead store the
metadata in a separate file in the archive. In doing so, when the archive is
passed to the linker, none of the metadata will get pulled into the result
executable. Furthermore, the metadata file is skipped when assembling rlibs into
an archive.

The snag in this implementation comes with multiple output formats. When
generating a dylib, the metadata needs to be in the object file, but when
generating an rlib this needs to be separate. In order to accomplish this, the
metadata variable is inserted into an entirely separate LLVM Module which is
then codegen'd into a different location (foo.metadata.o). This is then linked
into dynamic libraries and silently ignored for rlib files.

While changing how metadata is inserted into archives, I have also stopped
compressing metadata when inserted into rlib files. We have wanted to stop
compressing metadata, but the sections it creates in object file sections are
apparently too large. Thankfully if it's just an arbitrary file it doesn't
matter how large it is.

I have seen massive reductions in executable sizes, as well as staticlib output
sizes (to confirm that this is all working).
2013-12-09 08:25:58 -08:00
David Renshaw
d99efe84df encode trait lifetime params in metadata to allow cross-crate usage 2013-12-08 18:09:31 -05:00
Kiet Tran
1755408d1a Remove dead codes 2013-12-08 02:55:28 -05:00
Kevin Ballard
408dc5ad1b Revert "libstd: Change Path::new to Path::init."
This reverts commit c54427ddfb.

Leave the #[ignores] in that were added to rustpkg tests.

Conflicts:
	src/librustc/driver/driver.rs
	src/librustc/metadata/creader.rs
2013-12-04 22:33:53 -08:00
Huon Wilson
b0426edc0a std::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter. 2013-12-04 22:35:53 +11:00
Huon Wilson
9d64e46013 std::str: remove from_utf8.
This function had type &[u8] -> ~str, i.e. it allocates a string
internally, even though the non-allocating version that take &[u8] ->
&str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-12-04 22:35:53 +11:00
bors
c8b60a2d9e auto merge of #10742 : alexcrichton/rust/frameworks, r=cmr
Commits have the fun details, and scrutiny on the new documentation would be appreciated!
2013-12-02 13:36:41 -08:00
bors
df41115213 auto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichton 2013-12-01 05:42:06 -08:00
bors
b2aa00ba8b auto merge of #10676 : eddyb/rust/ast-box-in-enums, r=cmr
**Note**: I only tested on top of my #10670 PR, size reductions come from both change sets.

With this, [more enums are shrinked](https://gist.github.com/eddyb/08fef0dfc6ff54e890bc), the most significant one being `ast_node`, from 104 bytes (master) to 96 (#10670) and now to 32 bytes.

My own testcase requires **200MB** less when compiling (not including the other **200MB** gained in #10670), and rustc-stage2 is down by about **130MB**.

I believe there is more to gain by fiddling with the enums' layouts.
2013-12-01 03:11:58 -08:00
Philipp Brüschweiler
47ce981903 ast: Remove one @ and fix the fallout 2013-12-01 11:24:58 +01:00
Alex Crichton
f9d6fd20a5 Support OSX frameworks
This adds support to link to OSX frameworks via the new link attribute when
using `kind = "framework"`. It is a compiler error to request linkage to a
framework when the target is not macos because other platforms don't support
frameworks.

Closes #2023
2013-11-30 15:47:43 -08:00
Alex Crichton
56e4c82a38 Test fixes and merge conflicts 2013-11-30 14:34:59 -08:00
Eduard Burtescu
a9c4b18b18 Box Block, fn_decl, variant and Ty in the AST, as they were inflating critical enum sizes. 2013-12-01 00:00:39 +02:00
Alex Crichton
e338a4154b Add generation of static libraries to rustc
This commit implements the support necessary for generating both intermediate
and result static rust libraries. This is an implementation of my thoughts in
https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html.

When compiling a library, we still retain the "lib" option, although now there
are "rlib", "staticlib", and "dylib" as options for crate_type (and these are
stackable). The idea of "lib" is to generate the "compiler default" instead of
having too choose (although all are interchangeable). For now I have left the
"complier default" to be a dynamic library for size reasons.

Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an
rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a
dynamic object. I chose this for size reasons, but also because you're probably
not going to be embedding the rustc compiler anywhere any time soon.

Other than the options outlined above, there are a few defaults/preferences that
are now opinionated in the compiler:

* If both a .dylib and .rlib are found for a rust library, the compiler will
  prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option
* If generating a "lib", the compiler will generate a dynamic library. This is
  overridable by explicitly saying what flavor you'd like (rlib, staticlib,
  dylib).
* If no options are passed to the command line, and no crate_type is found in
  the destination crate, then an executable is generated

With this change, you can successfully build a rust program with 0 dynamic
dependencies on rust libraries. There is still a dynamic dependency on
librustrt, but I plan on removing that in a subsequent commit.

This change includes no tests just yet. Our current testing
infrastructure/harnesses aren't very amenable to doing flavorful things with
linking, so I'm planning on adding a new mode of testing which I believe belongs
as a separate commit.

Closes #552
2013-11-29 18:36:13 -08:00
Patrick Walton
c54427ddfb libstd: Change Path::new to Path::init. 2013-11-29 10:55:13 -08:00
Alex Crichton
ab387a6838 Register new snapshots 2013-11-28 20:27:56 -08:00
bors
faf4c939fb auto merge of #10670 : eddyb/rust/node-u32, r=alexcrichton
### Rationale
There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least **64GB**.
Meanwhile, some can't (or barely can) compile rustc because it requires almost **1.5GB**.

### Potential problems
Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it.

### Results
Some structures have a size reduction of 25% to 50%: [before](https://gist.github.com/luqmana/3a82a51fa9c86d9191fa) - [after](https://gist.github.com/eddyb/5a75f8973d3d8018afd3).
Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over **1.4GB** as [before](http://huonw.github.io/isrustfastyet/mem/), but I can barely see the difference).
However, my own testcase (previously peaking at **1.6GB** in typeck) shows a reduction of **200**-**400MB**.
2013-11-26 22:07:44 -08:00
Eduard Burtescu
7ed27b5531 Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64. 2013-11-27 07:02:25 +02:00
Patrick Walton
8ceb374ab7 librustc: Remove non-procedure uses of do from librustc, librustdoc,
and librustpkg.
2013-11-26 08:25:00 -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
Patrick Walton
7e3f20133a librustc: Change most uses of &fn() to ||. 2013-11-19 13:22:03 -08:00
Alex Crichton
49ee49296b Move std::rt::io to std::io 2013-11-11 20:44:07 -08: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
Niko Matsakis
98f79735c3 Merge failures 2013-11-08 20:59:43 -05:00
Niko Matsakis
195f1d77bd Rename and modernize region enum names 2013-11-08 19:47:57 -05:00
Niko Matsakis
5e54a7323d Update various tests and libraries that were incorrectly
annotated.
2013-11-08 19:45:50 -05:00
Niko Matsakis
9d3f57ef08 Introduce new variance inference pass that replaces (and generalizes) old
region-parameterization/variance inference. We now compute variance for
type parameters but do not make use of it (most of the way towards #3598).
2013-11-08 19:43:20 -05:00
Niko Matsakis
1f4faaee40 Generalize AST and ty::Generics to accept multiple lifetimes. 2013-11-08 19:42:46 -05:00
Andrei Formiga
ca22e94772 Added a FIXME with issue number to change package_id 2013-11-08 18:59:44 -03:00
Andrei Formiga
cf24280a3c Added default value for package_id attribute when encoding metadata for lib crates 2013-11-08 17:42:46 -03:00
Luqman Aden
c669ccf3d3 libsyntax/librustc: Allow calling variadic foreign functions. 2013-11-04 23:53:11 -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
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
Alex Crichton
2b9c7742b9 Stop propagating link arguments across crates
This is a fairly brittle modle that doesn't scale well across many crates. It's
unlikely that all of the downstream crates will have all of the original native
dependencies of all the upstream crates. In the case that FFI functions are
reachable, then it should be the responsibility of the downstream crate to link
against the correct library, or the upstream crate should prevent the functions
from being reachable.
2013-11-01 21:28:47 -07: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
Jed Davis
f1124a2f55 Add parser for #[repr(...)]; nothing uses it yet.
Also export enum attrs into metadata, and add a convenient interface for
obtaining the repr hint from either a local or remote definition.
2013-10-29 09:09:19 -07:00
bors
e6102fc2fa auto merge of #10079 : alexcrichton/rust/no-reader-util, r=brson
These methods are all excellent candidates for default methods, so there's no need to require extra imports of various traits. Additionally, this was able to remove all the weird underscores after the method names. Yay!
2013-10-28 10:56:34 -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
Joshua Yanovski
a239c0ed66 Make addl_lib_search_paths a HashSet (Closes #7718). 2013-10-26 10:46:38 -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
Luqman Aden
af163579ed libsyntax/librustc: Allow specifying mut on ~self. 2013-10-22 21:22:19 -04:00
Luqman Aden
5754848f8c libsyntax/librustc: Allow specifying mut on by-value self. 2013-10-22 21:21:21 -04:00
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
Kevin Ballard
0c7e8f7a92 path2: Remove some API functions
Delete the following API functions:
- set_dirname()
- with_dirname()
- set_filestem()
- with_filestem()
- add_extension()
- file_path()

Also change pop() to return a boolean instead of an owned copy of the
old filename.
2013-10-16 10:26:48 -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
Kevin Ballard
d6d9b92683 path2: Adjust the API to remove all the _str mutation methods
Add a new trait BytesContainer that is implemented for both byte vectors
and strings.

Convert Path::from_vec and ::from_str to one function, Path::new().

Remove all the _str-suffixed mutation methods (push, join, with_*,
set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15 22:18:30 -07:00
Kevin Ballard
73d3d00ec4 path2: Replace the path module outright
Remove the old path.
Rename path2 to path.
Update all clients for the new path.

Also make some miscellaneous changes to the Path APIs to help the
adoption process.
2013-10-15 21:56:54 -07:00
Alex Crichton
b70306158f Remove named extern blocks from the AST
There's currently a fair amount of code which is being ignored on unnamed blocks
(which are the default now), and I opted to leave it commented out for now. I
intend on very soon revisiting on how we perform linking with extern crates in
an effort to support static linking.
2013-10-10 18:04:58 -07:00
Daniel Micay
6a90e80b62 option: rewrite the API to use composition 2013-10-09 09:17:29 -04:00
bors
c9196290af auto merge of #9674 : ben0x539/rust/raw-str, r=alexcrichton
This branch parses raw string literals as in #9411.
2013-10-07 23:01:39 -07:00