Commit Graph

65638 Commits

Author SHA1 Message Date
Mark Simulacrum
7ed4ee272e Clean up and restructure sanity checking. 2017-07-04 07:31:55 -06:00
Mark Simulacrum
01e83a362c Don't allocate args in order to run find. 2017-07-04 07:31:55 -06:00
bors
de7f061768 Auto merge of #43025 - est31:nan_cross_platform, r=BurntSushi
Make sNaN removal code tolerate different sNaN encodings

IEEE 754-1985 specifies the encoding of NaN floating point numbers,
but while it mentions that NaNs can be subdivided into signaling
and quiet ones, it doesn't fix the encoding of signaling NaNs in binary
formats. This led to different implementations (CPUs) having different
encodings. IEEE 754-2008 finally specified the encoding of signaling NaNs
but some architectures are compatible with it, while others aren't.
Certain MIPS and PA-RISC CPUs have different encodings for signaling
NaNs.

In order to have the float <-> binary cast feature of the std library be
portable to them, we don't mask any quiet NaNs like we did before (only
being compliant to IEEE 754-2008 and nothing else), but instead we
simply pass a known good NaN instead.

Note that in the code removed there was a bug; the 64 bit mask for quiet
NaNs should have been `0x0008000000000000` instead of the specified
`0x0001000000000000`.
2017-07-04 13:21:20 +00:00
Stjepan Glavina
558ce91e09 Minor fix in docs for Vec 2017-07-04 15:14:08 +02:00
Masaki Hara
728d26c886
Add a test for unsized tuple impls. 2017-07-04 21:26:46 +09:00
bors
7a75d2bec4 Auto merge of #43012 - scottmcm:delete-range-step-by, r=alexcrichton
Delete deprecated & unstable range-specific `step_by`

Using the new one is annoying while this one exists, since the inherent method hides the one on iterator.

Tracking issue: #27741
Replacement: #41439
Deprecation: #42310 for 1.19
Fixes #41477
2017-07-04 04:49:59 +00:00
Lee Bousfield
857d9dbaba
README: note how to enable debugging for rustc 2017-07-03 22:06:43 -04:00
bors
ed1ef191b5 Auto merge of #42993 - stepancheg:editorconfig, r=brson
Add .editorconfig to src/rustllvm

... which uses 2 space indent instead of common 4 spaces.
2017-07-04 01:08:15 +00:00
Steven Fackler
dcd7c5f4e8 Add a stability marker for core::cmp::Reverse.0
Closes #43027
2017-07-03 13:46:37 -10:00
Anders Kaseorg
d68c3ab17b Document unintuitive argument order for Vec::dedup_by relation
When trying to use dedup_by to merge some auxiliary information from
removed elements into kept elements, I was surprised to observe that
vec.dedup_by(same_bucket) calls same_bucket(a, b) where b appears
before a in the vector, and discards a when true is returned.  This
argument order is probably a bug, but since it has already been
stabilized, I guess we should document it as a feature and move on.

(Vec::dedup also uses == with this unexpected argument order, but I
figure that’s not important since == is expected to be symmetric with
no side effects.)

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2017-07-03 18:38:53 -04:00
est31
3ba0f07f08 Make sNaN removal code tolerate different sNaN encodings
IEEE 754-1985 specifies the encoding of NaN floating point numbers,
but while it mentions that NaNs can be subdivided into signaling
and quiet ones, it doesn't fix the encoding of signaling NaNs in binary
formats. This led to different implementations (CPUs) having different
encodings. IEEE 754-2008 finally specified the encoding of signaling NaNs
but some architectures are compatible with it, while others aren't.
Certain MIPS and PA-RISC CPUs have different encodings for signaling
NaNs.

In order to have the float <-> binary cast feature of the std library be
portable to them, we don't mask any quiet NaNs like we did before (only
being compliant to IEEE 754-2008 and nothing else), but instead we
simply pass a known good NaN instead.

Note that in the code removed there was a bug; the 64 bit mask for quiet
NaNs should have been `0x0008000000000000` instead of the specified
`0x0001000000000000`.
2017-07-03 21:51:36 +02:00
bors
734c83642c Auto merge of #42999 - behnam:ucd10, r=alexcrichton
[libstd_unicode] Upgrade to Unicode 10.0.0

Update `libstd_unicode`'s data tables to Unicode 10.0.0, as released on 2017 June 20: http://www.unicode.org/versions/Unicode10.0.0/
2017-07-03 17:00:17 +00:00
bors
4c225c4d17 Auto merge of #42976 - ids1024:redoxfix, r=sfackler
Fix Redox build, apparently broken by #42687
2017-07-03 12:20:57 +00:00
Cengiz Can
06de114f89 remove isatty dependency 2017-07-03 14:13:02 +03:00
Cengiz Can
e1a91443cd use single line comments 2017-07-03 14:13:02 +03:00
Cengiz Can
0e18a9cd55 use embedded implementation instead of istty crate 2017-07-03 14:13:02 +03:00
Cengiz Can
7b0a7fdaf2 do not spawn pager if not tty 2017-07-03 14:13:02 +03:00
Cengiz Can
08b6bebbad use unwrap_or_else to prevent unnecessary alloc 2017-07-03 14:13:02 +03:00
Cengiz Can
1beeb5a277 do not append an extra newline char 2017-07-03 14:13:01 +03:00
Cengiz Can
3146e552d1 use PAGER to view --explain output #32665 2017-07-03 14:13:01 +03:00
bors
1d2db7b9e8 Auto merge of #43010 - stjepang:stabilize-sort-unstable, r=alexcrichton
Stabilize feature sort_unstable

Closes #40585
2017-07-02 23:54:32 +00:00
Stjepan Glavina
66f8cddae5 Remove the remaining feature gates 2017-07-02 21:29:39 +02:00
Stjepan Glavina
21149bcd53 Fix lint errors 2017-07-02 19:14:16 +02:00
Ryan Thomas
d1316b468f Add docs for Debug* structs. #29355
This adds docs for the Debug* structs as well as examples from the
Formatter::debug_* methods, so that a user knows how to construct them.

I added these examples as the builders module is not public and hence
the debug_*_new() functions are not available to a user.

r? @steveklabnik

Review comments.

Mainly adding in the links for all of the structs and functions.

Remove rust tag on code blocks.
2017-07-02 17:42:02 +01:00
bors
0679711398 Auto merge of #42938 - est31:col_number, r=eddyb
Output column number info when panicking

Outputs the column number when panicking. Useful when you e.g. have code like `foo[i] = bar[k] + bar[l]` and you get a panic with index out of bounds, or when you have an expression like `a = b + c + d + e` and the addition overflows. Now you know which operation to blame!

The format is `file:line:column`, just like for compiler errors. Example output with the patch:

```
thread 'main' panicked at 'index out of bounds: the len is 5 but the index is 8', src/main.rs:3:8
```

As some of the API between the compiler and the library landscape gets broken, this is a bit hackier than I'd originally wanted it to be.

* `panic` and `panic_bounds_check` lang items got an additional column param, on stage0 I still have to use the previous version. After a SNAP this should be resolved.
* For `#[derive(RustcDeserialze)]`, stage0 requires a fixed signature for `std::rt::begin_panic`, so we can't change it right away. What we need to do instead is to keep the signature, and add a `begin_panic_new` function that we use in later stages instead. After a SNAP we can change the `begin_panic` function and rely on it instead of `begin_panic_new`, and one SNAP later we can remove `begin_panic_new`.
* Fortunately I didn't have to break anything about the panic hook API, I could easily extend it.

Note that debuginfo remains unchanged, so RUST_BACKTRACE output won't contain any column info. See issue #42921 for discussion on including the column in debuginfo.
2017-07-02 15:40:26 +00:00
est31
3b91f9406c Update cargo
... to get https://github.com/rust-lang/cargo/pull/4244 and
https://github.com/rust-lang/cargo/pull/4246
2017-07-02 16:42:13 +02:00
bors
2a992167c5 Auto merge of #43015 - arielb1:every-error-counts, r=eddyb
report the total number of errors on compilation failure

Prior to this PR, when we aborted because a "critical pass" failed, we displayed the number of errors from that critical pass. While that's the number of errors that caused compilation to abort in *that place*, that's not what people really want to know. Instead, always report the total number of errors, and don't bother to track the number of errors from the last pass that failed.

This changes the compiler driver API to handle errors more smoothly, therefore is a compiler-api-[breaking-change].

Fixes #42793.

r? @eddyb
2017-07-02 13:22:23 +00:00
Ariel Ben-Yehuda
fb7ab9e43d report the total number of errors on compilation failure
Prior to this PR, when we aborted because a "critical pass" failed, we
displayed the number of errors from that critical pass. While that's the
number of errors that caused compilation to abort in *that place*,
that's not what people really want to know. Instead, always report the
total number of errors, and don't bother to track the number of errors
from the last pass that failed.

This changes the compiler driver API to handle errors more smoothly,
and therefore is a compiler-api-[breaking-change].

Fixes #42793.
2017-07-02 16:16:44 +03:00
est31
57f0514feb Style fix 2017-07-02 13:53:29 +02:00
est31
1561954ea4 Documentation 2017-07-02 13:53:29 +02:00
est31
eb5fb21bd5 Fix the test failure, add comment, and refactor a little bit 2017-07-02 13:53:29 +02:00
est31
da887074fc Output line column info when panicking 2017-07-02 13:53:29 +02:00
Ariel Ben-Yehuda
77f4022303 Revert "Change error count messages"
This reverts commit 5558c64f33.
2017-07-02 13:49:30 +03:00
Stjepan Glavina
bfbe4039f8 Fix tidy errors 2017-07-02 11:16:37 +02:00
Scott McMurray
dcd332ed94 Delete deprecated & unstable range-specific step_by
Replacement: 41439
Deprecation: 42310 for 1.19
Fixes 41477
2017-07-01 19:18:02 -07:00
bors
c3a130cffc Auto merge of #43003 - milmazz:bootstrap-pep8, r=alexcrichton
bootstrap: Fix all the pep-8 issues reported by flake8

This commit also adds a few missing docstrings.

Today, after reading this [article](https://blog.rust-lang.org/2017/06/27/Increasing-Rusts-Reach.html), I downloaded this project and started building from source. In the meantime, I began to read the `bootstrap.py`, to know more about the building process, and I made a few changes, this is my first contribution to the project, hope you like it.

BTW, I have a few doubts about the `bootstrap.py`, any guidance is more than welcome:

* Where can I find the unit tests for this script? In case it doesn't exist yet, do you like to include some unit tests with pytest?
* Some methods like `fix_executable`, `get_string`, and `exe_suffix` in the `RustBuild` class should be converted to a function because it doesn't use `self` anywhere. What do you think?
2017-07-02 01:51:30 +00:00
Stjepan Glavina
5350e22366 Stabilize feature sort_unstable 2017-07-02 02:09:21 +02:00
Masaki Hara
01b6c9459c
Implement Eq/Hash/Debug etc. for unsized tuples. 2017-07-02 08:41:39 +09:00
bors
a19693a54c Auto merge of #43002 - SergioBenitez:more-io-inner-stable, r=BurntSushi
Stabilize 'more_io_inner_methods' feature.

As in the title. Closes #41519.
2017-07-01 21:54:13 +00:00
bors
05b5797664 Auto merge of #42882 - stjepang:improve-sort-tests-and-benches, r=alexcrichton
Improve tests and benchmarks for slice::sort and slice::sort_unstable

This PR just hardens the tests and improves benchmarks.
More specifically:

1. Benchmarks don't generate vectors in `Bencher::iter` loops, but simply clone pregenerated vectors.
2. Benchmark `*_strings` doesn't allocate Strings in `Bencher::iter` loops, but merely clones a `Vec<&str>`.
3. Benchmarks use seeded `XorShiftRng` to be more consistent.
4. Additional tests for `slice::sort` are added, which test sorting on slices with several ascending/descending runs. The implementation identifies such runs so it's a good idea to test that scenario a bit.
5. More checks are added to `run-pass/vector-sort-panic-safe.rs`. Sort algorithms copy elements around a lot (merge sort uses an auxilliary buffer and pdqsort copies the pivot onto the stack before partitioning, then writes it back into the slice). If elements that are being sorted are internally mutable and comparison function mutates them, it is important to make sure that sort algorithms always use the latest "versions" of elements. New checks verify that this is true for both `slice::sort` and `slice::sort_unstable`.

As a side note, all of those improvements were made as part of the parallel sorts PR in Rayon (nikomatsakis/rayon#379) and now I'm backporting them into libcore/libstd.

r? @alexcrichton
2017-07-01 13:31:32 +00:00
Milton Mazzarri
44c6781cef
Simplify print arguments 2017-07-01 07:16:57 -05:00
bors
a5d34e1d03 Auto merge of #42991 - sfackler:unstable-rangeargument, r=alexcrichton
Revert "Stabilize RangeArgument"

This reverts commit 143206d54d.

From the discussion in #30877 it seems like this is premature.
2017-07-01 11:21:53 +00:00
bors
7a2c09b6f5 Auto merge of #42977 - Keruspe:master, r=alexcrichton
rustbuild: set __CARGO_DEFAULT_LIB_METADATA to channel

Also, update the cargo submodule to handle the new value.
2017-07-01 09:10:13 +00:00
bors
d41b791c1a Auto merge of #42971 - stepancheg:ir-demangle, r=nagisa
When writing LLVM IR output demangled fn name in comments

`--emit=llvm-ir` looks like this now:

```
; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut
; Function Attrs: inlinehint uwtable
define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 {
start:
  ...
```

cc https://github.com/integer32llc/rust-playground/issues/15
2017-07-01 05:52:08 +00:00
Milton Mazzarri
ebf24ad3e9
bootstrap: Fix some PEP8 issues
This commit also adds a few missing docstrings
2017-06-30 23:24:35 -05:00
bors
4a92ae2524 Auto merge of #42896 - llogiq:clippy_compiletest, r=alexcrichton
fixed some clippy warnings in compiletest

This is mainly readability stuff. Whenever the `clone_ref` lint asked me to clone the dereferenced object, I removed the `.clone()` instead, relying on the fact that it has worked so far and the immutable borrow ensures that the value won't change.
2017-07-01 03:26:29 +00:00
Sergio Benitez
d280b40b18 Stabilize 'more_io_inner_methods' feature. 2017-06-30 18:05:04 -07:00
Stepan Koltsov
b62bdaafe0 When writing LLVM IR output demangled fn name in comments
`--emit=llvm-ir` looks like this now:

```
; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut
; Function Attrs: inlinehint uwtable
define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 {
start:
  ...
```

cc https://github.com/integer32llc/rust-playground/issues/15
2017-07-01 03:16:43 +03:00
Behnam Esfahbod
a6994d7f3a [libstd_unicode] Upgrade to Unicode 10.0.0 2017-06-30 17:25:28 -06:00
bors
7d89b20669 Auto merge of #42995 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 6 pull requests

- Successful merges: #42669, #42911, #42925, #42957, #42985, #42987
- Failed merges: #42936
2017-06-30 22:14:56 +00:00