]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoRevert incorrect `usize` -> `u32` replacements from #22510
Tobias Bucher [Mon, 2 Mar 2015 22:56:13 +0000 (23:56 +0100)]
Revert incorrect `usize` -> `u32` replacements from #22510

Conflicts:
src/libstd/thread.rs

9 years agoRollup merge of #22977 - kmcallister:issue-15778, r=sfackler
Manish Goregaokar [Tue, 3 Mar 2015 08:43:46 +0000 (14:13 +0530)]
Rollup merge of #22977 - kmcallister:issue-15778, r=sfackler

 Fixes #15778.

r? @sfackler

9 years agoRollup merge of #22974 - nagisa:reintuint-std, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:35 +0000 (14:13 +0530)]
Rollup merge of #22974 - nagisa:reintuint-std, r=alexcrichton

 Reverts a small part of c74d49c804c3 because compilation pukes with warnings now.

9 years agoRollup merge of #22970 - pnkfelix:fsk-robust-backtrace-test-against-env, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:25 +0000 (14:13 +0530)]
Rollup merge of #22970 - pnkfelix:fsk-robust-backtrace-test-against-env, r=alexcrichton

 Make `test/run-pass/backtrace.rs` more robust about own host environment

Namely, I have been annoyed in the past when I have done `RUST_BACKTRACE=1 make check` only to discover (again) that such a trick causes this test to fail, because it assumes that the `RUST_BACKTRACE` environment variable is not set.

Fix #22870

9 years agoRollup merge of #22956 - ejjeong:aarch64-linux-android, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:17 +0000 (14:13 +0530)]
Rollup merge of #22956 - ejjeong:aarch64-linux-android, r=alexcrichton

 aarch64-linux-android build has been broken since #22839.
Aarch64 android has _Unwind_GetIPInfo, so re-define this only for arm32 android.
r? @alexcrichton

9 years agoRollup merge of #22952 - huonw:missing-stable, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:09 +0000 (14:13 +0530)]
Rollup merge of #22952 - huonw:missing-stable, r=alexcrichton

 Unstable is the conservative choice.

cc #22950.

9 years agoRollup merge of #22951 - huonw:weak-chuck-slice, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:01 +0000 (14:13 +0530)]
Rollup merge of #22951 - huonw:weak-chuck-slice, r=alexcrichton

 `#[derive(Clone)]` unnecessarily requires the element type to also be
`Clone`.

9 years agoRollup merge of #22876 - Florob:const, r=nikomatsakis
Manish Goregaokar [Tue, 3 Mar 2015 08:42:53 +0000 (14:12 +0530)]
Rollup merge of #22876 - Florob:const, r=nikomatsakis

 This changes the type of some public constants/statics in libunicode.
Notably some `&'static &'static [(char, char)]` have changed
to `&'static [(char, char)]`. The regexp crate seems to be the
sole user of these, yet this is technically a [breaking-change]

9 years agoRollup merge of #22990 - japaric:privATe, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:42:44 +0000 (14:12 +0530)]
Rollup merge of #22990 - japaric:privATe, r=alexcrichton

 Associated types are now treated as part of the public API by the privacy checker.

If you were exposing a private type in your public API via an associated type, make that type public:

``` diff
  pub struct PublicType { .. }

- struct Struct { .. }
+ pub struct Struct { .. }

  pub trait PublicTrait {
      type Output;

      fn foo(&self) -> Self::Output;
  }

  impl PublicTrait for PublicType {
      type Output = Struct;

      fn foo(&self) -> Struct {  // `Struct` is part of the public API, it must be marked as `pub`lic
          ..
      }
  }
```

[breaking-change]

---

r? @nikomatsakis
closes #22912

9 years agoRollup merge of #22989 - laijs:fix_FromStr_bool_comment, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:42:36 +0000 (14:12 +0530)]
Rollup merge of #22989 - laijs:fix_FromStr_bool_comment, r=alexcrichton

 Fix the return type in the comments.

An old commit 082bfde41217 (\"Fallout of std::str stabilization\") removed
the example of FromStr::from_str(), this commit adds it back. But
the example of StrExt::parse() is still kept with an additinal note.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
9 years agoRollup merge of #22969 - dotdash:no_alloca_zeroed, r=huonw
Manish Goregaokar [Tue, 3 Mar 2015 08:42:27 +0000 (14:12 +0530)]
Rollup merge of #22969 - dotdash:no_alloca_zeroed, r=huonw

 Its only user was lvalue_scratch_datum which is called with zero=true
anymore, so it's effectively unused.

9 years agoRollup merge of #22960 - huonw:static-assert, r=huonw
Manish Goregaokar [Tue, 3 Mar 2015 08:42:18 +0000 (14:12 +0530)]
Rollup merge of #22960 - huonw:static-assert, r=huonw

 The API this exposes is a little strange (being attached to `static`s),
so it makes sense to conservatively feature gate it. If it is highly
popular, it is possible to reverse this gating.

9 years agoRollup merge of #22943 - ipetkov:lint-recursion, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:42:12 +0000 (14:12 +0530)]
Rollup merge of #22943 - ipetkov:lint-recursion, r=alexcrichton

 * The lint visitor's visit_ty method did not recurse, and had a
  reference to the now closed #10894
* The newly enabled recursion has only affected the `deprectated` lint
  which now detects uses of deprecated items in trait impls and
  function return types
* Renamed some references to `CowString` and `CowVec` to `Cow<str>` and
  `Cow<[T]>`, respectively, which appear outside of the crate which
  defines them
* Replaced a few instances of `InvariantType<T>` with
  `PhantomData<Cell<T>>`
* Disabled the `deprecated` lint in several places that
  reference/implement traits on deprecated items which will get cleaned
  up in the future
* Unfortunately, this means that if a library declares
  `#![deny(deprecated)]` and marks anything as deprecated, it will have
  to disable the lint for any uses of said item, e.g. any impl the now
  deprecated item

For any library that denies deprecated items but has deprecated items
of its own, this is a [breaking-change]

I had originally intended for the lint to ignore uses of deprecated items that are declared in the same crate, but this goes against some previous test cases that expect the lint to capture *all* uses of deprecated items, so I maintained the previous approach to avoid changing the expected behavior of the lint.

Tested locally on OS X, so hopefully there aren't any deprecated item uses behind a `cfg` that I may have missed.

9 years agoRollup merge of #22916 - rprichard:fmt-num-cleanup, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:42:05 +0000 (14:12 +0530)]
Rollup merge of #22916 - rprichard:fmt-num-cleanup, r=alexcrichton

  * Make num::UpperHex private.  I was unable to determine why this struct
   is public.  The num module itself is not public, and the UpperHex struct
   is not referenced anywhere in the core::fmt module.  (Only the UpperHex
   trait is reference.)  num::LowerHex is not public.

 * Remove the suffix parameters from the macros that generate integral
   display traits.

   The code to print the Debug::fmt suffixes was removed when Show was
   renamed to Debug.  It was an intentional change.  From RFC 0565:

    * Focus on the *runtime* aspects of a type; repeating information such
      as suffixes for integer literals is not generally useful since that
      data is readily available from the type definition.

 * Because Show was renamed to Debug, rename show! to debug!.

9 years agoAuto merge of #22971 - lifthrasiir:metadata-reform, r=huonw
bors [Tue, 3 Mar 2015 08:06:59 +0000 (08:06 +0000)]
Auto merge of #22971 - lifthrasiir:metadata-reform, r=huonw

This is a series of individual but correlated changes to the metadata format. The changes are significant enough that it (finally) bumps the metadata encoding version. In brief, they altogether reduce the total size of stage1 binaries by 27% (!!!!). Almost every low-hanging fruit has been considered and fixed; see the individual commits for details.

Detailed library (not just metadata) size changes for x86_64-unknown-linux-gnu stage1 binaries (baseline being 3a96d6a9818fe2affc98a187fb1065120458cee9):

````
   before     after  delta path
--------- --------- ------ --------------------------------
  1706146   1050412  38.4% liballoc-4e7c5e5c.rlib
   398576    152454  61.8% libarena-4e7c5e5c.rlib
    71441     56892  20.4% libarena-4e7c5e5c.so
 14424754   5084102  64.8% libcollections-4e7c5e5c.rlib
 39143186  14743118  62.3% libcore-4e7c5e5c.rlib
   195574    188150   3.8% libflate-4e7c5e5c.rlib
   153123    152603   0.3% libflate-4e7c5e5c.so
   477152    215262  54.9% libfmt_macros-4e7c5e5c.rlib
    77728     66601  14.3% libfmt_macros-4e7c5e5c.so
  1216936    684104  43.8% libgetopts-4e7c5e5c.rlib
   207846    181116  12.9% libgetopts-4e7c5e5c.so
   349722    147530  57.8% libgraphviz-4e7c5e5c.rlib
    60196     49197  18.3% libgraphviz-4e7c5e5c.so
   729842    259906  64.4% liblibc-4e7c5e5c.rlib
   349358    247014  29.3% liblog-4e7c5e5c.rlib
    88878     83163   6.4% liblog-4e7c5e5c.so
  1968508    732840  62.8% librand-4e7c5e5c.rlib
  1968204    696326  64.6% librbml-4e7c5e5c.rlib
   283207    206589  27.1% librbml-4e7c5e5c.so
 72369394  46401230  35.9% librustc-4e7c5e5c.rlib
 11941372  10498483  12.1% librustc-4e7c5e5c.so
  2717894   1983272  27.0% librustc_back-4e7c5e5c.rlib
   501900    464176   7.5% librustc_back-4e7c5e5c.so
    15058     12588  16.4% librustc_bitflags-4e7c5e5c.rlib
  4008268   2961912  26.1% librustc_borrowck-4e7c5e5c.rlib
   837550    785633   6.2% librustc_borrowck-4e7c5e5c.so
  6473348   6095470   5.8% librustc_driver-4e7c5e5c.rlib
  1448785   1433945   1.0% librustc_driver-4e7c5e5c.so
 95483688  94779704   0.7% librustc_llvm-4e7c5e5c.rlib
 43516815  43487809   0.1% librustc_llvm-4e7c5e5c.so
   938140    817236  12.9% librustc_privacy-4e7c5e5c.rlib
   182653    176563   3.3% librustc_privacy-4e7c5e5c.so
  4390288   3543284  19.3% librustc_resolve-4e7c5e5c.rlib
   872981    831824   4.7% librustc_resolve-4e7c5e5c.so
 18176426  14795426  18.6% librustc_trans-4e7c5e5c.rlib
  3657354   3480026   4.8% librustc_trans-4e7c5e5c.so
 16815076  13868862  17.5% librustc_typeck-4e7c5e5c.rlib
  3274439   3123898   4.6% librustc_typeck-4e7c5e5c.so
 21372308  14890582  30.3% librustdoc-4e7c5e5c.rlib
  4501971   4172202   7.3% librustdoc-4e7c5e5c.so
  8055028   2951044  63.4% libserialize-4e7c5e5c.rlib
   958101    710016  25.9% libserialize-4e7c5e5c.so
 30810208  15160648  50.8% libstd-4e7c5e5c.rlib
  6819003   5967485  12.5% libstd-4e7c5e5c.so
 58850950  31949594  45.7% libsyntax-4e7c5e5c.rlib
  9060154   7882423  13.0% libsyntax-4e7c5e5c.so
  1474310   1062102  28.0% libterm-4e7c5e5c.rlib
   345577    323952   6.3% libterm-4e7c5e5c.so
  2827854   1643056  41.9% libtest-4e7c5e5c.rlib
   517811    452519  12.6% libtest-4e7c5e5c.so
  2274106   1761240  22.6% libunicode-4e7c5e5c.rlib
--------- --------- ------ --------------------------------
499359187 363465583  27.2% total
````

Some notes:

* Uncompressed metadata compacts very well. It is less visible for compressed metadata but still it achieves about 5~10% reduction.
* *Every* commit is designed to reduce the metadata in one way. There is absolutely no negative impact associated to changes (that's why the table above doesn't contain a minus delta).
* I've confirmed that this compiles through `make all`, making it almost correct. Other platforms have to be tested though.
* Oh, I'll rebase this as soon as I have spare time, but I guess this needs an extensive review anyway.
* I haven't rigorously checked the encoder and decoder performance. I tried to minimize the impact (some encodings are actually simpler than the original), but I'm not sure.

Fixes #2743, #9303 (partially) and #21482.

9 years agofix fallout
Jorge Aparicio [Tue, 3 Mar 2015 05:25:14 +0000 (00:25 -0500)]
fix fallout

9 years agoprivacy: walk associated types in trait impls
Jorge Aparicio [Tue, 3 Mar 2015 04:26:14 +0000 (23:26 -0500)]
privacy: walk associated types in trait impls

9 years agometadata: Reordered integral tags in the ascending order.
Kang Seonghoon [Tue, 3 Mar 2015 02:18:12 +0000 (11:18 +0900)]
metadata: Reordered integral tags in the ascending order.

Also clarified the mysterious `_next_int` method.

9 years agostr: fix comments for FromStr for bool
Lai Jiangshan [Mon, 2 Mar 2015 10:01:01 +0000 (18:01 +0800)]
str: fix comments for FromStr for bool

Fix the return type in the comments.

An old commit 082bfde41217 ("Fallout of std::str stabilization") removed
the example of FromStr::from_str(), this commit adds it back. But
the example of StrExt::parse() is still kept with an additinal note.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
9 years agometadata: Bump the metadata encoding version.
Kang Seonghoon [Mon, 2 Mar 2015 16:54:49 +0000 (01:54 +0900)]
metadata: Bump the metadata encoding version.

We have changed the encoding enough to bump that.
Also added some notes about metadata encoding to librbml/lib.rs.

9 years agometadata: Compact integer encoding.
Kang Seonghoon [Mon, 2 Mar 2015 15:34:50 +0000 (00:34 +0900)]
metadata: Compact integer encoding.

Previously every auto-serialized tags are strongly typed. However
this is not strictly required, and instead it can be exploited
to provide the optimal encoding for smaller integers. This commit
repurposes `EsI8`/`EsU8` through `EsI64`/`EsU64` tags to represent
*any* integers with given ranges: It is now possible to encode
`42u64` as two bytes `EsU8 0x2a`, for example.

There are some limitations:

* It does not apply to non-auto-serialized tags for obvious reasons.
  Fortunately, we have already eliminated the biggest source of
  such tag in favor of auto-serialized tags: `tag_table_id`.
* Bigger tags cannot be used to represent smaller types.
* Signed tags and unsigned tags do not mix.

9 years agometadata: Flatten `tag_table_id` and `tag_table_val` tags.
Kang Seonghoon [Mon, 2 Mar 2015 11:26:36 +0000 (20:26 +0900)]
metadata: Flatten `tag_table_id` and `tag_table_val` tags.

This avoids a biggish eight-byte `tag_table_id` tag in favor of
autoserialized integer tags, which are smaller and can be later
used to encode them in the optimal number of bytes. `NodeId` was
u32 after all.

Previously:

                       <------------- len1 -------------->
    tag_table_* <len1> tag_table_id 88 <nodeid in 8 bytes>
                       tag_table_val <len2> <actual data>
                                            <-- len2 --->

Now:

                      <--------------- len --------------->
    tag_table_* <len> U32 <nodeid in 4 bytes> <actual data>

9 years agometadata: Space-optimize empty vectors and maps.
Kang Seonghoon [Mon, 2 Mar 2015 09:54:51 +0000 (18:54 +0900)]
metadata: Space-optimize empty vectors and maps.

So that `EsVec 82 EsSub8 00` becomes `EsVec 80` now.

9 years agometadata: Implement relaxation of short RBML lengths.
Kang Seonghoon [Mon, 2 Mar 2015 05:34:16 +0000 (14:34 +0900)]
metadata: Implement relaxation of short RBML lengths.

We try to move the data when the length can be encoded in
the much smaller number of bytes. This interferes with indices and
type abbreviations however, so this commit introduces a public
interface to get and mark a "stable" (i.e. not affected by
relaxation) position of the current pointer.

The relaxation logic only moves a small data, currently at most
256 bytes, as moving the data can be costly. There might be
further opportunities to allow more relaxation by moving fields
around, which I didn't seriously try.

9 years agometadata: Introduce `EsSub8` and `EsSub32` tags.
Kang Seonghoon [Sun, 1 Mar 2015 17:46:53 +0000 (02:46 +0900)]
metadata: Introduce `EsSub8` and `EsSub32` tags.

They replace the existing `EsEnumVid`, `EsVecLen` and `EsMapLen`
tags altogether; the meaning of them can be easily inferred
from the enclosing tag. It also has an added benefit of
encodings for smaller variant ids or lengths being more compact
(5 bytes to 2 bytes).

9 years agometadata: Bye bye `EsLabel`. No regrets.
Kang Seonghoon [Sun, 1 Mar 2015 17:20:46 +0000 (02:20 +0900)]
metadata: Bye bye `EsLabel`. No regrets.

For the reference, while it is designed to be selectively enabled,
it was essentially enabled throughout every snapshot and nightly
as far as I can tell. This makes the usefulness of `EsLabel` itself
questionable, as it was quite rare that `EsLabel` broke the build.
It had consumed about 20~30% of metadata (!) and so this should be
a huge win.

9 years agometadata: Eliminate the `EsEnumBody` tag.
Kang Seonghoon [Sun, 1 Mar 2015 15:37:14 +0000 (00:37 +0900)]
metadata: Eliminate the `EsEnumBody` tag.

It doesn't serve any useful purpose. It *might* be useful when
there are some tags that are generated by `Encodable` and
not delimited by any tags, but IIUC it's not the case.

Previous:

                  <-------------------- len1 ------------------->
    EsEnum <len1> EsEnumVid <vid> EsEnumBody <len2> <arg1> <arg2>
                                                    <--- len2 -->

Now:

                  <----------- len1 ---------->
    EsEnum <len1> EsEnumVid <vid> <arg1> <arg2>

9 years agometadata: Introduce implicit lengths for auto-serialization.
Kang Seonghoon [Sun, 1 Mar 2015 02:57:20 +0000 (11:57 +0900)]
metadata: Introduce implicit lengths for auto-serialization.

Many auto-serialization tags are fixed-size (note: many ordinary
tags are also fixed-size but for now this commit ignores them),
so having an explicit length is a waste. This moves any
auto-serialization tags with an implicit length before other tags,
so a test for them is easy. A preliminary experiment shows this
has at least 1% gain over the status quo.

9 years agometadata: New tag encoding scheme.
Kang Seonghoon [Sat, 28 Feb 2015 16:09:39 +0000 (01:09 +0900)]
metadata: New tag encoding scheme.

EBML tags are encoded in a variable-length unsigned int (vuint),
which is clever but causes some tags to be encoded in two bytes
while there are really about 180 tags or so. Assuming that there
wouldn't be, say, over 1,000 tags in the future, we can use much
more efficient encoding scheme. The new scheme should support
at most 4,096 tags anyway.

This also flattens a scattered tag namespace (did you know that
0xa9 is followed by 0xb0?) and makes a room for autoserialized tags
in 0x00 through 0x1f.

9 years agometadata: Avoid the use of raw `wr_str` or `write_all`.
Kang Seonghoon [Sun, 1 Mar 2015 06:09:58 +0000 (15:09 +0900)]
metadata: Avoid the use of raw `wr_str` or `write_all`.

They are, with a conjunction of `start_tag` and `end_tag`, commonly
used to write a document with a binary data of known size. However
the use of `start_tag` makes the length always 4 bytes long, which
is almost not optimal (requiring the relaxation step to remedy).
Directly using `wr_tagged_*` methods is better for both readability
and resulting metadata size.

9 years agoAuto merge of #22600 - brson:num, r=Gankro
bors [Tue, 3 Mar 2015 02:05:18 +0000 (02:05 +0000)]
Auto merge of #22600 - brson:num, r=Gankro

* count_ones/zeros, trailing_ones/zeros return u32, not usize
* rotate_left/right take u32, not usize
* RADIX, MANTISSA_DIGITS, DIGITS, BITS, BYTES are u32, not usize

Doesn't touch pow because there's another PR for it.

cc https://github.com/rust-lang/rust/issues/22240

r? @Gankro

9 years agoFeature gate `#[static_assert]`.
Huon Wilson [Mon, 2 Mar 2015 10:46:31 +0000 (21:46 +1100)]
Feature gate `#[static_assert]`.

The API this exposes is a little strange (being attached to `static`s),
so it makes sense to conservatively feature gate it. If it is highly
popular, it is possible to reverse this gating.

9 years agocore: Audit num module for int/uint
Brian Anderson [Fri, 20 Feb 2015 05:05:35 +0000 (21:05 -0800)]
core: Audit num module for int/uint

* count_ones/zeros, trailing_ones/zeros return u32, not usize
* rotate_left/right take u32, not usize
* RADIX, MANTISSA_DIGITS, DIGITS, BITS, BYTES are u32, not usize

Doesn't touch pow because there's another PR for it.

[breaking-change]

9 years agoEnable recursion for visit_ty in lint visitor
Ivan Petkov [Sun, 1 Mar 2015 07:24:05 +0000 (23:24 -0800)]
Enable recursion for visit_ty in lint visitor

* The lint visitor's visit_ty method did not recurse, and had a
  reference to the now closed #10894
* The newly enabled recursion has only affected the `deprectated` lint
  which now detects uses of deprecated items in trait impls and
  function return types
* Renamed some references to `CowString` and `CowVec` to `Cow<str>` and
  `Cow<[T]>`, respectively, which appear outside of the crate which
  defines them
* Replaced a few instances of `InvariantType<T>` with
  `PhantomData<Cell<T>>`
* Disabled the `deprecated` lint in several places that
  reference/implement traits on deprecated items which will get cleaned
  up in the future
* Disabled the `exceeding_bitshifts` lint for
  compile-fail/huge-array-simple test so it doesn't shadow the expected
  error on 32bit systems
* Unfortunately, this means that if a library declares
  `#![deny(deprecated)]` and marks anything as deprecated, it will have
  to disable the lint for any uses of said item, e.g. any impl the now
  deprecated item

For any library that denies deprecated items but has deprecated items
of its own, this is a [breaking-change]

9 years agoAuto merge of #22882 - alexcrichton:stabilize-process, r=aturon
bors [Mon, 2 Mar 2015 23:18:36 +0000 (23:18 +0000)]
Auto merge of #22882 - alexcrichton:stabilize-process, r=aturon

This commits blanket marks the API of the `std::process` module as `#[stable]`.
The module's API is very similar to the old `std::old_io::process` API and has
generally had quite a bit of time to bake both before and after the new module
landed.

9 years agoAdd regression tests for #15778
Keegan McAllister [Mon, 2 Mar 2015 21:21:40 +0000 (13:21 -0800)]
Add regression tests for #15778

Fixes #15778.

9 years agoReadd int_uint feature to libstd
Simonas Kazlauskas [Mon, 2 Mar 2015 20:54:39 +0000 (22:54 +0200)]
Readd int_uint feature to libstd

Reverts a small part of c74d49c804c3 because compilation pukes with warnings now.

9 years agoAuto merge of #22963 - Manishearth:rollup, r=Manishearth
bors [Mon, 2 Mar 2015 20:26:39 +0000 (20:26 +0000)]
Auto merge of #22963 - Manishearth:rollup, r=Manishearth

9 years agoRollup merge of #22966 - nikomatsakis:closure-region-hierarchy, r=pnkfelix
Manish Goregaokar [Mon, 2 Mar 2015 16:06:33 +0000 (21:36 +0530)]
Rollup merge of #22966 - nikomatsakis:closure-region-hierarchy, r=pnkfelix

 Remove the synthetic \"region bound\" from closures and instead update how
type-outlives works for closure types so that it ensures that all upvars
outlive the region in question. This gives the same guarantees but
without introducing artificial regions (and gives better error messages
to boot). This is refactoring towards #3696.

r? @pnkfelix

9 years agoRollup merge of #22961 - dotdash:branch_drop, r=eddyb
Manish Goregaokar [Mon, 2 Mar 2015 16:06:23 +0000 (21:36 +0530)]
Rollup merge of #22961 - dotdash:branch_drop, r=eddyb

9 years agoAdd cfg_attr to known attributes
Manish Goregaokar [Mon, 2 Mar 2015 12:14:01 +0000 (17:44 +0530)]
Add cfg_attr to known attributes

9 years agoRollup merge of #22961 - dotdash:branch_drop, r=eddyb
Manish Goregaokar [Mon, 2 Mar 2015 11:24:01 +0000 (16:54 +0530)]
Rollup merge of #22961 - dotdash:branch_drop, r=eddyb

9 years agoRollup merge of #22925 - leonardinius:issue-22646-fmt, r=steveklabnik
Manish Goregaokar [Mon, 2 Mar 2015 08:08:57 +0000 (13:38 +0530)]
Rollup merge of #22925 - leonardinius:issue-22646-fmt, r=steveklabnik

 Addresses rust-lang/rust#22646

Removes deprecated `{:08d}` format from the module documentation.
`{:08}` should be used instead now.

9 years agoRollup merge of #22911 - djmally:master, r=steveklabnik
Manish Goregaokar [Mon, 2 Mar 2015 08:08:50 +0000 (13:38 +0530)]
Rollup merge of #22911 - djmally:master, r=steveklabnik

 ... example that actually does use an Option

9 years agoRollup merge of #22906 - alexandercampbell:readme_typo_fix, r=steveklabnik
Manish Goregaokar [Mon, 2 Mar 2015 08:08:43 +0000 (13:38 +0530)]
Rollup merge of #22906 - alexandercampbell:readme_typo_fix, r=steveklabnik

 Typo fix for the \"30 Minute Intro\".

CONTRIBUTING guide says I should do this:

r? @steveklabnik

9 years agoRollup merge of #22689 - tshepang:thread-doc-improvements, r=steveklabnik
Manish Goregaokar [Mon, 2 Mar 2015 08:08:36 +0000 (13:38 +0530)]
Rollup merge of #22689 - tshepang:thread-doc-improvements, r=steveklabnik

9 years agoMake `test/run-pass/backtrace.rs` more robust about own host environment.
Felix S. Klock II [Thu, 19 Feb 2015 11:41:10 +0000 (12:41 +0100)]
Make `test/run-pass/backtrace.rs` more robust about own host environment.

Namely, I have been annoyed in the past when I have done
`RUST_BACKTRACE=1 make check` only to discover (again) that such a
trick causes this test to fail, because it assumes that the
`RUST_BACKTRACE` environment variable is not set.

Fix #22870

9 years agoDrop alloca_zeroed
Björn Steinbrink [Mon, 2 Mar 2015 16:11:02 +0000 (17:11 +0100)]
Drop alloca_zeroed

Its only user was lvalue_scratch_datum which is called with zero=true
anymore, so it's effectively unused.

9 years agoUse `const`s instead of `static`s where appropriate
Florian Zeitz [Fri, 27 Feb 2015 14:36:53 +0000 (15:36 +0100)]
Use `const`s instead of `static`s where appropriate

This changes the type of some public constants/statics in libunicode.
Notably some `&'static &'static [(char, char)]` have changed
to `&'static [(char, char)]`. The regexp crate seems to be the
sole user of these, yet this is technically a [breaking-change]

9 years agoProperly propagate block changes while translating drop glue
Björn Steinbrink [Mon, 2 Mar 2015 11:11:46 +0000 (12:11 +0100)]
Properly propagate block changes while translating drop glue

9 years agoAuto merge of #22510 - GuillaumeGomez:audit-integer-libstd-thread, r=alexcrichton
bors [Mon, 2 Mar 2015 11:21:26 +0000 (11:21 +0000)]
Auto merge of #22510 - GuillaumeGomez:audit-integer-libstd-thread, r=alexcrichton

Part of #22240.

9 years agoProperly propagate block changes while translating drop glue
Björn Steinbrink [Mon, 2 Mar 2015 11:11:46 +0000 (12:11 +0100)]
Properly propagate block changes while translating drop glue

9 years agoRemove the synthetic "region bound" from closures and instead update how
Niko Matsakis [Sun, 1 Mar 2015 00:34:16 +0000 (19:34 -0500)]
Remove the synthetic "region bound" from closures and instead update how
type-outlives works for closure types so that it ensures that all upvars
outlive the region in question. This gives the same guarantees but
without introducing artificial regions (and gives better error messages
to boot).

9 years agoAuto merge of #22797 - alexcrichton:io-stdio, r=aturon
bors [Mon, 2 Mar 2015 07:10:14 +0000 (07:10 +0000)]
Auto merge of #22797 - alexcrichton:io-stdio, r=aturon

This is an implementation of RFC 899 and adds stdio functionality to the new
`std::io` module. Details of the API can be found on the RFC, but from a high
level:

* `io::{stdin, stdout, stderr}` constructors are now available. There are also
  `*_raw` variants for unbuffered and unlocked access.
* All handles are globally shared (excluding raw variants).
* The stderr handle is no longer buffered.
* All handles can be explicitly locked (excluding the raw variants).

The `print!` and `println!` machinery has not yet been hooked up to these
streams just yet. The `std::fmt::output` module has also not yet been
implemented as part of this commit.

9 years agoAdd missing stability attributes on struct fields.
Huon Wilson [Mon, 2 Mar 2015 07:04:11 +0000 (18:04 +1100)]
Add missing stability attributes on struct fields.

Unstable is the conservative choice.

cc #22950.

9 years agoManual Clone for Windows/Chunks.
Huon Wilson [Mon, 2 Mar 2015 06:50:47 +0000 (17:50 +1100)]
Manual Clone for Windows/Chunks.

`#[derive(Clone)]` unnecessarily requires the element type to also be
`Clone`.

9 years agoFix broken aarch64 build
Eunji Jeong [Mon, 2 Mar 2015 05:07:07 +0000 (14:07 +0900)]
Fix broken aarch64 build

9 years agostd: Stabilize the `process` module
Alex Crichton [Sat, 28 Feb 2015 00:23:21 +0000 (16:23 -0800)]
std: Stabilize the `process` module

This commits blanket marks the API of the `std::process` module as `#[stable]`.
The module's API is very similar to the old `std::old_io::process` API and has
generally had quite a bit of time to bake both before and after the new module
landed.

The one modification made to the API is that `Stdio::capture` is now named
`stdio::piped`.

[breaking-change]

9 years agoAuto merge of #22940 - Manishearth:rollup, r=Manishearth
bors [Mon, 2 Mar 2015 00:37:24 +0000 (00:37 +0000)]
Auto merge of #22940 - Manishearth:rollup, r=Manishearth

9 years agoRollup merge of #22944 - Manishearth:patch-1, r=sfackler
Manish Goregaokar [Mon, 2 Mar 2015 00:34:39 +0000 (06:04 +0530)]
Rollup merge of #22944 - Manishearth:patch-1, r=sfackler

 Been breaking tests lately. Somehow nondeterministic?

9 years agoFix unknown attribute in test
Manish Goregaokar [Mon, 2 Mar 2015 00:01:34 +0000 (05:31 +0530)]
Fix unknown attribute in test

9 years agoRollup merge of #22941 - sfackler:re-disable, r=sfackler
Manish Goregaokar [Sun, 1 Mar 2015 23:13:32 +0000 (04:43 +0530)]
Rollup merge of #22941 - sfackler:re-disable, r=sfackler

 Seems to be blocking forever

9 years agoIgnore issue #16671 test on android (again)
Steven Fackler [Sat, 6 Dec 2014 04:22:35 +0000 (20:22 -0800)]
Ignore issue #16671 test on android (again)

Seems to be blocking forever

9 years agoReplace int/uint by isize/usize
GuillaumeGomez [Wed, 18 Feb 2015 23:23:55 +0000 (00:23 +0100)]
Replace int/uint by isize/usize

9 years agoRollup merge of #22935 - dotdash:method_attr, r=eddyb
Manish Goregaokar [Sun, 1 Mar 2015 22:24:33 +0000 (03:54 +0530)]
Rollup merge of #22935 - dotdash:method_attr, r=eddyb

 ... objects

For method calls through trait objects, we currently generate the llvm
function argument attributes using the non-opaque method signature that
still has the trait object fat pointer for the self pointer. This leads
to attributes that are plain wrong, e.g. noalias. As we don't know
anything about the concrete type of the underlying object, we must
replace the self argument with an opaque i8 pointer before applying the
attributes.

9 years agoRollup merge of #22931 - semarie:dragonfly-ino_t, r=alexcrichton
Manish Goregaokar [Sun, 1 Mar 2015 22:24:27 +0000 (03:54 +0530)]
Rollup merge of #22931 - semarie:dragonfly-ino_t, r=alexcrichton

 this is the same problem as openbsd (#22792).
without the patch, liblibc don't build.

@mneumann please comment.
I have encountered this problem while building some rust libs with `target=x86_64-unknown-dragonfly` (while working on #22794)

9 years agoRollup merge of #22923 - dotdash:trans_arg, r=eddyb
Manish Goregaokar [Sun, 1 Mar 2015 22:24:14 +0000 (03:54 +0530)]
Rollup merge of #22923 - dotdash:trans_arg, r=eddyb

 The logic for the argument translation was duplicated here.

9 years agoRollup merge of #22922 - dotdash:closure_env_attr, r=eddyb
Manish Goregaokar [Sun, 1 Mar 2015 22:24:07 +0000 (03:54 +0530)]
Rollup merge of #22922 - dotdash:closure_env_attr, r=eddyb

9 years agoRollup merge of #22893 - Ms2ger:lints, r=huonw
Manish Goregaokar [Sun, 1 Mar 2015 22:24:00 +0000 (03:54 +0530)]
Rollup merge of #22893 - Ms2ger:lints, r=huonw

9 years agoRollup merge of #22821 - ipetkov:lint-method-rename, r=eddyb
Manish Goregaokar [Sun, 1 Mar 2015 22:23:54 +0000 (03:53 +0530)]
Rollup merge of #22821 - ipetkov:lint-method-rename, r=eddyb

 Traits can have associated types and not just methods. This
clarification reflects the the type of the input the method accepts.

[breaking-change]

9 years agoRollup merge of #22777 - pnkfelix:issue-22443, r=nikomatsakis
Manish Goregaokar [Sun, 1 Mar 2015 22:23:48 +0000 (03:53 +0530)]
Rollup merge of #22777 - pnkfelix:issue-22443, r=nikomatsakis

 Check for unbounded recursion during dropck.

Such recursion can be introduced by the erroneous use of non-regular types (aka types employing polymorphic recursion), which Rust does not support.

Fix #22443

9 years agoRollup merge of #22504 - GuillaumeGomez:audit-integer-libcore, r=Manishearth
Manish Goregaokar [Sun, 1 Mar 2015 22:23:41 +0000 (03:53 +0530)]
Rollup merge of #22504 - GuillaumeGomez:audit-integer-libcore, r=Manishearth

 Part of #22240.

9 years agoEmit proper attributes for the self pointer in method call through trait objects
Björn Steinbrink [Sun, 1 Mar 2015 17:19:07 +0000 (18:19 +0100)]
Emit proper attributes for the self pointer in method call through trait objects

For method calls through trait objects, we currently generate the llvm
function argument attributes using the non-opaque method signature that
still has the trait object fat pointer for the self pointer. This leads
to attributes that are plain wrong, e.g. noalias. As we don't know
anything about the concrete type of the underlying object, we must
replace the self argument with an opaque i8 pointer before applying the
attributes.

9 years agounbreak dragonfly build after nacl integration
Sébastien Marie [Sun, 1 Mar 2015 15:03:28 +0000 (16:03 +0100)]
unbreak dragonfly build after nacl integration

this is the same problem as openbsd (#22792).

without the patch, liblibc don't build.

9 years agoAuto merge of #22880 - alexcrichton:deprecate-io-extensions, r=huonw
bors [Sun, 1 Mar 2015 14:22:58 +0000 (14:22 +0000)]
Auto merge of #22880 - alexcrichton:deprecate-io-extensions, r=huonw

The `u64_from_be_bytes` and `u64_to_be_bytes` functions are being deprecated
with no replacement for now.

[breaking-change]

9 years agoAddresses rust-lang/rust#22646
Leonids Maslovs [Sun, 1 Mar 2015 12:11:12 +0000 (14:11 +0200)]
Addresses rust-lang/rust#22646

Removes deprecated `{:08d}` format from the module documentation.
`{:08}` should be used instead now.

9 years agoRemove int/uint from libstd/lib.rs
Guillaume Gomez [Fri, 27 Feb 2015 00:43:55 +0000 (01:43 +0100)]
Remove int/uint from libstd/lib.rs

9 years agoUse trans_arg_datum in trans_args_under_call_abi
Björn Steinbrink [Sat, 28 Feb 2015 20:41:26 +0000 (21:41 +0100)]
Use trans_arg_datum in trans_args_under_call_abi

The logic for the argument translation was duplicated here.

9 years agoEmit proper function argument attributes for closure environments
Björn Steinbrink [Sat, 28 Feb 2015 20:38:49 +0000 (21:38 +0100)]
Emit proper function argument attributes for closure environments

9 years agoAdd regression tests for issue 22443.
Felix S. Klock II [Tue, 24 Feb 2015 17:34:39 +0000 (18:34 +0100)]
Add regression tests for issue 22443.

Fix #22443.

9 years agoAdd check for unbounded due to non-regular types in dropck.
Felix S. Klock II [Tue, 24 Feb 2015 17:20:41 +0000 (18:20 +0100)]
Add check for unbounded due to non-regular types in dropck.

Count recursion across phantom data separately from all recursion,
and treat `Box<T>` just as if it were carrying `PhantomData<T>`.

(Regression tests are in followup commit.)

The practical effect of this is just to increment the `xref_depth`
counter, the same way that `Vec` and other types carrying
`PhantomData` do.

9 years agoAuto merge of #22087 - GuillaumeGomez:int-pow, r=alexcrichton
bors [Sun, 1 Mar 2015 08:59:29 +0000 (08:59 +0000)]
Auto merge of #22087 - GuillaumeGomez:int-pow, r=alexcrichton

Fixes issue #22016

9 years agostd: Implement stdio for `std::io`
Alex Crichton [Wed, 25 Feb 2015 07:27:20 +0000 (23:27 -0800)]
std: Implement stdio for `std::io`

This is an implementation of RFC 899 and adds stdio functionality to the new
`std::io` module. Details of the API can be found on the RFC, but from a high
level:

* `io::{stdin, stdout, stderr}` constructors are now available. There are also
  `*_raw` variants for unbuffered and unlocked access.
* All handles are globally shared (excluding raw variants).
* The stderr handle is no longer buffered.
* All handles can be explicitly locked (excluding the raw variants).

The `print!` and `println!` machinery has not yet been hooked up to these
streams just yet. The `std::fmt::output` module has also not yet been
implemented as part of this commit.

9 years agoAuto merge of #22909 - Manishearth:rollup, r=Manishearth
bors [Sun, 1 Mar 2015 06:32:54 +0000 (06:32 +0000)]
Auto merge of #22909 - Manishearth:rollup, r=Manishearth

r? @Manishearth

9 years agoRollup merge of #22910 - dotdash:time_llvm_passes, r=cmr
Manish Goregaokar [Sun, 1 Mar 2015 04:20:30 +0000 (09:50 +0530)]
Rollup merge of #22910 - dotdash:time_llvm_passes, r=cmr

 The timing code break when using multiple codegen units, but that
shouldn't stop us from using it with a single codegen unit.

9 years agoRollup merge of #22908 - mdinger:fix_link, r=Gankro
Manish Goregaokar [Sun, 1 Mar 2015 04:20:18 +0000 (09:50 +0530)]
Rollup merge of #22908 - mdinger:fix_link, r=Gankro

 The markdown listing the link in [StrExt::width](http://doc.rust-lang.org/std/str/trait.StrExt.html#tymethod.width) isn't being parsed properly. I'm expecting it's because the `[ ]` is across 2 lines so this changes that. This is untested though.

9 years agoAdd import of usize (fixup #22901)
Manish Goregaokar [Sat, 28 Feb 2015 20:15:53 +0000 (01:45 +0530)]
Add import of usize (fixup #22901)

9 years agoRollup merge of #22907 - dotdash:static_assert_bool, r=eddyb
Manish Goregaokar [Sat, 28 Feb 2015 19:49:26 +0000 (01:19 +0530)]
Rollup merge of #22907 - dotdash:static_assert_bool, r=eddyb

 static_assert is documented as working on static with type `bool`, but
we currently accept it on any const static and crash when the const has
an non-integral type.

This is a breaking-change for anyone who used static_assert on types
likes i32, which happened to work but seems like an unintended
consequence of the missing error checking.

[breaking-change]

Fixes #22056

9 years agoRollup merge of #22904 - dotdash:drop_old_clang, r=alexcrichton
Manish Goregaokar [Sat, 28 Feb 2015 19:49:19 +0000 (01:19 +0530)]
Rollup merge of #22904 - dotdash:drop_old_clang, r=alexcrichton

 Fixes #20467

9 years agoRollup merge of #22903 - semarie:openbsd-stack, r=alexcrichton
Manish Goregaokar [Sat, 28 Feb 2015 19:49:12 +0000 (01:19 +0530)]
Rollup merge of #22903 - semarie:openbsd-stack, r=alexcrichton

 some commits in OpenBSD OS have corrected a problem of stack position.
Now, we can adjust more accurately the page guard in rust.

@dhuseby I am not sure that bitrig have already integrated these changes (the `$OpenBSD$` header in sys/kern/kern_exec.c is too old). But when they do, you may want this patch too.

9 years agoRollup merge of #22901 - thepowersgang:patch-1, r=eddyb
Manish Goregaokar [Sat, 28 Feb 2015 19:49:05 +0000 (01:19 +0530)]
Rollup merge of #22901 - thepowersgang:patch-1, r=eddyb

 A misplaced uint->u32 instead of usize in fmt::Pointer. Added a basic test.

9 years agoRollup merge of #22898 - edwardw:one-less-unsafe-impl, r=huonw
Manish Goregaokar [Sat, 28 Feb 2015 19:48:59 +0000 (01:18 +0530)]
Rollup merge of #22898 - edwardw:one-less-unsafe-impl, r=huonw

 These implementations were temporary workaround. Now #22828 has been
fixed, they can be removed.

9 years agoRollup merge of #22896 - Ms2ger:InlineAttr, r=huonw
Manish Goregaokar [Sat, 28 Feb 2015 19:48:52 +0000 (01:18 +0530)]
Rollup merge of #22896 - Ms2ger:InlineAttr, r=huonw

9 years agoAuto merge of #22898 - edwardw:one-less-unsafe-impl, r=huonw
bors [Sun, 1 Mar 2015 04:06:03 +0000 (04:06 +0000)]
Auto merge of #22898 - edwardw:one-less-unsafe-impl, r=huonw

These implementations were temporary workaround. Now #22828 has been
fixed, they can be removed.

9 years agoCleanup in the fmt::num module
Ryan Prichard [Sun, 1 Mar 2015 03:30:06 +0000 (19:30 -0800)]
Cleanup in the fmt::num module

 * Make num::UpperHex private.  I was unable to determine why this struct
   is public.  The num module itself is not public, and the UpperHex struct
   is not referenced anywhere in the core::fmt module.  (Only the UpperHex
   trait is reference.)  num::LowerHex is not public.

 * Remove the suffix parameters from the macros that generate integral
   display traits.

   The code to print the Debug::fmt suffixes was removed when Show was
   renamed to Debug.  It was an intentional change.  From RFC 0565:

    * Focus on the *runtime* aspects of a type; repeating information such
      as suffixes for integer literals is not generally useful since that
      data is readily available from the type definition.

 * Because Show was renamed to Debug, rename show! to debug!.

9 years agoFix errors, remove unused files
GuillaumeGomez [Thu, 19 Feb 2015 00:12:45 +0000 (01:12 +0100)]
Fix errors, remove unused files

9 years agoRemove int/uint
GuillaumeGomez [Wed, 18 Feb 2015 22:46:22 +0000 (23:46 +0100)]
Remove int/uint

9 years agoAuto merge of #22896 - Ms2ger:InlineAttr, r=huonw
bors [Sun, 1 Mar 2015 01:39:07 +0000 (01:39 +0000)]
Auto merge of #22896 - Ms2ger:InlineAttr, r=huonw

9 years agoMake Int::pow() take exp as u32 instead usize
Guillaume Gomez [Fri, 27 Feb 2015 20:04:15 +0000 (21:04 +0100)]
Make Int::pow() take exp as u32 instead usize

9 years agoChanged wording to use Result instead of Option in several places, fixed example...
David Mally [Sat, 28 Feb 2015 22:40:04 +0000 (17:40 -0500)]
Changed wording to use Result instead of Option in several places, fixed example that actually does use an Option