Commit Graph

153 Commits

Author SHA1 Message Date
Eduard Burtescu
b2d30b72bf Removed @self and @Trait. 2014-02-07 00:38:33 +02:00
bors
f039d10cf7 auto merge of #12048 : sanxiyn/rust/crate-config, r=alexcrichton 2014-02-06 08:06:33 -08:00
Jeff Olson
b8852e89ce pull extra::{serialize, ebml} into a separate libserialize crate
- `extra::json` didn't make the cut, because of `extra::json` required
   dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`,
   then `extra::json` could move into `serialize`
- `libextra`, `libsyntax` and `librustc` depend on the newly created
  `libserialize`
- The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap`
  and `TreeSet` for `Encodable`/`Decodable` were moved into the respective
  modules in `extra`
- There is some trickery, evident in `src/libextra/lib.rs` where a stub
  of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for
  use in the stage0 build, where the snapshot rustc is still making
  deriving for `Encodable` and `Decodable` point at extra. Big props to
  @huonw for help working out the re-export solution for this

extra: inline extra::serialize stub

fix stuff clobbered in rebase + don't reexport serialize::serialize

no more globs in libserialize

syntax: fix import of libserialize traits

librustc: fix bad imports in encoder/decoder

add serialize dep to librustdoc

fix failing run-pass tests w/ serialize dep

adjust uuid dep

more rebase de-clobbering for libserialize

fixing tests, pushing libextra dep into cfg(test)

fix doc code in extra::json

adjust index.md links to serialize and uuid library
2014-02-05 10:38:22 -08:00
Seo Sanghyeon
b653fa0c4a Avoid cloning ast::CrateConfig 2014-02-06 02:26:00 +09:00
Alex Crichton
b211b00d21 syntax: Remove io_error usage 2014-02-03 09:32:34 -08:00
Patrick Walton
b890237e79 libsyntax: Fix tests. 2014-02-02 01:44:48 +11:00
Patrick Walton
8d6ef2e1b1 libsyntax: De-@str pathnames 2014-02-02 01:44:48 +11:00
Patrick Walton
e68108b3e8 librustc: Stop using @str for source. 2014-02-02 01:44:48 +11:00
Steven Fackler
d908e97da3 Redo exported macro serialization
The old method of serializing the AST gives totally bogus spans if the
expansion of an imported macro causes compilation errors. The best
solution seems to be to serialize the actual textual macro definition
and load it the same way the std-macros are. I'm not totally confident
that getting the source from the CodeMap will always do the right thing,
but it seems to work in simple cases.
2014-01-23 09:01:36 -08:00
Simon Sapin
05ae134ace [std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old from_utf8_owned() behavior 2014-01-21 15:48:48 -08:00
bors
9bf85a250c auto merge of #11598 : alexcrichton/rust/io-export, r=brson
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered
  private modules
* Remove with_mem_writer
* Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered)

cc #11119
2014-01-17 12:02:07 -08:00
Alex Crichton
295b46fc08 Tweak the interface of std::io
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered
  private modules
* Remove with_mem_writer
* Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered)
2014-01-17 10:00:47 -08:00
klutzy
f30a9b3d5b rustc::driver: Capitalize structs and enums
driver::session::crate_metadata is unused; removed.
2014-01-17 13:27:47 +09:00
Patrick Walton
ff6c0af15b libsyntax: Remove the obsolete ability to parse from substrings.
This was used by the quasiquoter.
2014-01-15 10:59:48 -08:00
Eduard Burtescu
6b221768cf libsyntax: Renamed types, traits and enum variants to CamelCase. 2014-01-09 22:25:28 +02:00
Alex Crichton
6df57ec2e2 Remove the io::Decorator trait
This is just an unnecessary trait that no one's ever going to parameterize over
and it's more useful to just define the methods directly on the types
themselves. The implementors of this type almost always don't want
inner_mut_ref() but they're forced to define it as well.
2014-01-08 23:42:28 -08:00
Patrick Walton
4d66af2698 librustc: De-@mut the span handler 2014-01-03 14:01:57 -08:00
Patrick Walton
7e1b535eb1 libsyntax: De-@mut StringReader, TtReader, and reader 2014-01-03 14:01:57 -08:00
Patrick Walton
3aa19a6b86 librustc: De-@mut the parse session 2014-01-03 14:01:56 -08:00
Patrick Walton
f553701da6 libsyntax: De-@mut ParseSess::included_mod_stack 2014-01-03 14:01:56 -08:00
Patrick Walton
f3eee0ebad libsyntax: Fix test and merge fallout. 2014-01-02 14:42:06 -08:00
Patrick Walton
758d854436 libsyntax: De-@mut token in the parser 2014-01-02 14:16:07 -08:00
Patrick Walton
425a140485 libsyntax: De-@mut quote_depth in the parser 2014-01-02 14:16:07 -08:00
Patrick Walton
f499d365ad libsyntax: Make the parser mutable 2014-01-02 14:16:07 -08:00
klutzy
fe10c63326 syntax::diagnostic: Remove unnecessary traits
This removes trait `handler` and `span_handler`,
and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2014-01-01 19:10:43 +09:00
Alex Crichton
87add53327 rustc: Improve crate id extraction
Right now the --crate-id and related flags are all process *after* the entire
crate is parsed. This is less than desirable when used with makefiles because it
means that just to learn the output name of the crate you have to parse the
entire crate (unnecessary).

This commit changes the behavior to lift the handling of these flags much sooner
in the compilation process. This allows us to not have to parse the entire crate
and only have to worry about parsing the crate attributes themselves. The
related methods have all been updated to take an array of attributes rather than
a crate.

Additionally, this ceases duplication of the "what output are we producing"
logic in order to correctly handle things in the case of --test.

Finally, this adds tests for all of this functionality to ensure that it does
not regress.
2013-12-20 09:10:11 -08:00
Kevin Ballard
2c4a1b55e6 Rename extra::json::*::init() constructors to *::new() 2013-12-04 22:33:53 -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
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
Erick Tryzelaar
a7b311ac61 extra: missed a couple @ in json 2013-11-29 21:26:03 -08:00
Erick Tryzelaar
6818b96a66 extra: json::Encoder should take a &mut io::Writer 2013-11-29 11:19:19 -08:00
Erick Tryzelaar
f7b739c34c extra: Rename json constructors into *::init 2013-11-29 11:19:19 -08:00
bors
ea5d1dfb1c auto merge of #10567 : sanxiyn/rust/bytepos, r=alexcrichton 2013-11-20 23:31:27 -08:00
Seo Sanghyeon
f4c1f49049 Fix parsing tests 2013-11-21 01:32:29 +09:00
Patrick Walton
492677ec1e libsyntax: Change all uses of &fn to ||. 2013-11-19 12:40:19 -08:00
Alex Crichton
49ee49296b Move std::rt::io to std::io 2013-11-11 20:44:07 -08:00
Niko Matsakis
1f4faaee40 Generalize AST and ty::Generics to accept multiple lifetimes. 2013-11-08 19:42:46 -05:00
Luqman Aden
c669ccf3d3 libsyntax/librustc: Allow calling variadic foreign functions. 2013-11-04 23:53:11 -05: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
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
Luqman Aden
12308db3d2 libsyntax/librustc: Allow mut qualifier in patterns. 2013-10-25 01:21:07 -04:00
Alex Crichton
6b70ddfba1 Remove io::read_error
The general idea is to remove conditions completely from I/O, so in the meantime
remove the read_error condition to mean the same thing as the io_error condition.
2013-10-24 14:21:57 -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
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
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
af3b132285 syntax: Remove usage of fmt! 2013-09-30 23:21:19 -07:00
Alex Crichton
7b18976f08 Remove all usage of @ast::Crate 2013-09-29 16:21:25 -07:00
John Clements
0269850cc2 added test case for tokenization of macro_rules 2013-09-24 16:00:58 -07:00
John Clements
876fce2751 cleanup 2013-09-24 12:31:24 -07:00