Commit graph

35467 commits

Author SHA1 Message Date
bors
c141f223d4 auto merge of #19953 : sanxiyn/rust/privacy-span, r=alexcrichton
Fix #19062.
2014-12-21 13:22:48 +00:00
bors
ce468e643a auto merge of #19946 : cgaebel/rust/hashmap-drain-iter, r=gankro
It is useful to move all the elements out of a hashmap without deallocating
the underlying buffer. It came up in IRC, and this patch implements it as
`drain`.

r? @Gankro
cc: @frankmcsherry
2014-12-21 07:22:45 +00:00
bors
cc19e3380b auto merge of #19903 : cgaebel/rust/ringbuf-as-slice, r=Gankro
See: https://github.com/rust-lang/rfcs/pull/509

Not sure if this is allowed to land before the RFC. Either way,
it's here for review.

r? @Gankro
cc: @bfops
2014-12-20 20:00:36 +00:00
bors
8a33de89c4 auto merge of #20073 : nikomatsakis/rust/generalized-where-clause-parser, r=nikomatsakis
This is the same branch as #20002 but with the pretty-printing test fixed.
2014-12-20 16:12:37 +00:00
bors
f8f2c7a953 auto merge of #19900 : alexcrichton/rust/compiler-flags, r=cmr
This commit shuffles around some CLI flags of the compiler to some more stable
locations with some renamings. The changes made were:

* The `-v` flag has been repurposes as the "verbose" flag. The version flag has
  been renamed to `-V`.
* The `-h` screen has been split into two parts. Most top-level options (not
  all) show with `-h`, and the remaining options (generally obscure) can be
  shown with `--help -v` which is a "verbose help screen"
* The `-V` flag (version flag now) has lost its argument as it is now requested
  with `rustc -vV` "verbose version".
* The `--emit` option has had its `ir` and `bc` variants renamed to `llvm-ir`
  and `llvm-bc` to emphasize that they are LLVM's IR/bytecode.
* The `--emit` option has grown a new variant, `dep-info`, which subsumes the
  `--dep-info` CLI argument. The `--dep-info` flag is now deprecated.
* The `--parse-only`, `--no-trans`, `--no-analysis`, and `--pretty` flags have
  moved behind the `-Z` family of flags.
* The `--debuginfo` and `--opt-level` flags were moved behind the top-level `-C`
  flag.
* The `--print-file-name` and `--print-crate-name` flags were moved behind one
  global `--print` flag which now accepts one of `crate-name`, `file-names`, or
  `sysroot`. This global `--print` flag is intended to serve as a mechanism for
  learning various metadata about the compiler itself.
* The top-level `--pretty` flag was moved to a number of `-Z` options.

No warnings are currently enabled to allow tools like Cargo to have time to
migrate to the new flags before spraying warnings to all users.

cc https://github.com/rust-lang/rust/issues/19051
2014-12-20 13:52:27 +00:00
Niko Matsakis
acd31db229 patch up pretty-printing test 2014-12-20 08:41:33 -05:00
Jared Roesch
d87b308b67 Add support for multiple region bounds in where clauses 2014-12-20 03:54:39 -08:00
Jared Roesch
e0cac488ac Add parser support for generalized where clauses
Implement support in the parser for generalized where clauses,
as well as the conversion of ast::WherePredicates to
ty::Predicate in `collect.rs`.
2014-12-20 02:48:17 -08:00
bors
8f51ad2420 auto merge of #19511 : eddyb/rust/no-shadow, r=alexcrichton
r? @erickt
2014-12-20 08:10:23 +00:00
bors
8443b09e36 auto merge of #19995 : eddyb/rust/split-resolve, r=nikomatsakis
r? @nikomatsakis
2014-12-20 05:52:18 +00:00
Eduard Burtescu
b45d30da34 Fix fallout of removing import_shadowing in tests. 2014-12-20 07:49:37 +02:00
Eduard Burtescu
f95e0c21aa Fix more import_shadowing fallout in collections. 2014-12-20 07:49:37 +02:00
Eduard Burtescu
5193d542f6 Fix the fallout of removing feature(import_shadowing). 2014-12-20 07:49:37 +02:00
Eduard Burtescu
948cc666de rustc_resolve: move export recording into its own module. 2014-12-20 07:28:47 +02:00
Eduard Burtescu
1614d92f51 rustc_resolve: move unused import checking into its own module. 2014-12-20 07:28:47 +02:00
Eduard Burtescu
c54fc980f3 Split resolve from rustc::middle into rustc_resolve. 2014-12-20 07:28:47 +02:00
Eduard Burtescu
a74a050c44 rustc: middle: move some types from resolve to privacy. 2014-12-20 07:28:47 +02:00
Eduard Burtescu
5d1257a760 rustc: middle: move TraitItemKind from resolve to def. 2014-12-20 07:28:46 +02:00
Eduard Burtescu
d9504d4a47 rustc: middle: move Export and ExportMap from resolve to def. 2014-12-20 07:28:46 +02:00
Eduard Burtescu
10a862d4f4 rustc: middle: use cheaper Name in resolve::Export instead of String. 2014-12-20 07:25:42 +02:00
Eduard Burtescu
f0276072a3 rustc: middle: move TraitMap from resolve to ty. 2014-12-20 07:25:41 +02:00
Eduard Burtescu
d8f57c3804 rustc: middle: move DefMap from resolve to def. 2014-12-20 07:25:37 +02:00
Eduard Burtescu
fb1d6f24fc middle: resolve: fix inconsistencies around ExportMap and remove the 2 suffix. 2014-12-20 07:11:03 +02:00
Eduard Burtescu
533822207f rustc: don't allow(non_camel_case_types) in resolve. 2014-12-20 07:11:03 +02:00
Eduard Burtescu
d5267d5845 Remove feature(import_shadowing) from all crates. 2014-12-20 06:37:14 +02:00
bors
1c2df5cc3c auto merge of #19640 : aliblong/rust/power_of_two_reform, r=Gankro
The `is_power_of_two()` method of the `UnsignedInt` trait currently returns `true` for `self == 0`. Zero is not a power of two, assuming an integral exponent `k >= 0`. I've therefore moved this functionality to the new method `is_power_of_two_or_zero()` and reformed `is_power_of_two()` to return false for `self == 0`.

To illustrate the usefulness of the existence of both functions, consider `HashMap`. Its capacity must be zero or a power of two; conversely, it also requires a (non-zero) power of two for key and val alignment.

Also, added a small amount of documentation regarding #18604.
2014-12-20 01:12:19 +00:00
Aaron Liblong
f6328b60da Reform power_of_two methods for perf increase & semantic change to consider 0 not a power of 2.
Vec panics when attempting to reserve capacity > int::MAX (uint::MAX / 2).
2014-12-19 18:21:24 -05:00
bors
cbe9fb45bc auto merge of #19463 : kali/rust/master, r=alexcrichton
parse_ty() no longer takes a boolean parameter. quote_ty! implementation has not yet been modified accordingly. 

As a matter of fact, quote_ty! was not covered by tests. One test (called qquotes) references it, but it has been ignored for nearly one year and now need heavy refactoring.

quote_token.rs seemed like a good place to test quote_ty!, many other quote_*! macros were asserted there.
2014-12-19 20:22:17 +00:00
Alex Crichton
117984b884 rustc: Start "stabilizing" some flags
This commit shuffles around some CLI flags of the compiler to some more stable
locations with some renamings. The changes made were:

* The `-v` flag has been repurposes as the "verbose" flag. The version flag has
  been renamed to `-V`.
* The `-h` screen has been split into two parts. Most top-level options (not
  all) show with `-h`, and the remaining options (generally obscure) can be
  shown with `--help -v` which is a "verbose help screen"
* The `-V` flag (version flag now) has lost its argument as it is now requested
  with `rustc -vV` "verbose version".
* The `--emit` option has had its `ir` and `bc` variants renamed to `llvm-ir`
  and `llvm-bc` to emphasize that they are LLVM's IR/bytecode.
* The `--emit` option has grown a new variant, `dep-info`, which subsumes the
  `--dep-info` CLI argument. The `--dep-info` flag is now deprecated.
* The `--parse-only`, `--no-trans`, and `--no-analysis` flags have
  moved behind the `-Z` family of flags.
* The `--debuginfo` and `--opt-level` flags were moved behind the top-level `-C`
  flag.
* The `--print-file-name` and `--print-crate-name` flags were moved behind one
  global `--print` flag which now accepts one of `crate-name`, `file-names`, or
  `sysroot`. This global `--print` flag is intended to serve as a mechanism for
  learning various metadata about the compiler itself.

No warnings are currently enabled to allow tools like Cargo to have time to
migrate to the new flags before spraying warnings to all users.
2014-12-19 11:38:24 -08:00
bors
95c2ed31ae auto merge of #19867 : japaric/rust/deriving-copy, r=acrichto
r? @alexcrichton
2014-12-19 16:02:31 +00:00
Jorge Aparicio
f975b10310 windows: remove unused import 2014-12-19 10:51:01 -05:00
Jorge Aparicio
4c6e76b7c8 libtime: use #[deriving(Copy)] 2014-12-19 10:51:01 -05:00
Jorge Aparicio
ce92437769 libtest: use #[deriving(Copy)] 2014-12-19 10:51:01 -05:00
Jorge Aparicio
64234b3541 libterm: use #[deriving(Copy)] 2014-12-19 10:51:01 -05:00
Jorge Aparicio
86f8c127dd libsyntax: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
a77e8a63d5 libstd: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
2df30a47e2 libserialize: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
1d25271e05 librustrt: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
4c007568bf librustdoc: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
fa0383f38d librustc_typeck: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
5e2bca9e86 librustc_trans: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
463475b7fa librustc_llvm: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
db45be2616 librustc_driver: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
392ea799b8 librustc_borrowck: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
e64a0072d6 librustc: use #[deriving(Copy)] 2014-12-19 10:51:00 -05:00
Jorge Aparicio
f2ef2cda52 libregex: use #[deriving(Copy)] 2014-12-19 10:43:24 -05:00
Jorge Aparicio
fd4a5d9ef1 librbml: use #[deriving(Copy)] 2014-12-19 10:43:24 -05:00
Jorge Aparicio
a18d090c3c librand: use #[deriving(Copy)] 2014-12-19 10:43:24 -05:00
Jorge Aparicio
e0a88a78da liblog: use #[deriving(Copy)] 2014-12-19 10:43:24 -05:00
Jorge Aparicio
c407785ac0 libgetopts: use #[deriving(Copy)] 2014-12-19 10:43:24 -05:00