Commit Graph

42005 Commits

Author SHA1 Message Date
Peter Marheine
94c9bdeef6 Update SNAPs to latest snapshot. 2015-04-29 13:11:31 -06:00
Tamir Duberstein
7e2b09351d DRY Android targets 2015-04-29 11:15:27 -07:00
Felix S. Klock II
db3a58ae29 Add -g that I should have included in PR #24932.
Note it is safe, with respect to autobuilds, to land before #24945.

(In other words, landing this sooner won't break things for anyone any
worse than they were already broken, since there are *other* tests
that also add `-g` to their flags via `compile-flags: -g`.)
2015-04-29 18:58:42 +02:00
Felix S. Klock II
df82df8cf8 Unit test ensuring we accept repeated -g and -O. 2015-04-29 18:56:16 +02:00
Felix S. Klock II
2007169583 Allow -g and -O options to be specified multiple times at command line. 2015-04-29 18:56:10 +02:00
Tamir Duberstein
8c58fe1739 Fallout 2015-04-29 08:55:31 -07:00
Tamir Duberstein
9504d8cdae bitflags! uses associated constants 2015-04-29 08:55:30 -07:00
Tamir Duberstein
0c0d138739 bitflags! is no longer used in std 2015-04-29 08:55:30 -07:00
Felix S. Klock II
bd4b984537 add --enable-debuginfo-tests, analogous to --disable-optimize-tests.
Then, decouple the question of whether the compiler/stdlib carry
debuginfo (which is controlled via `--enable-debuginfo` and implied by
`--enable-debug`) from the question of whether the tests carry
debuginfo (which now no longer is implied by `--enable-debug` nor
`--enable-debuginfo`, and is off by default).
2015-04-29 17:18:44 +02:00
Alex Crichton
c1149edf7a std: Fix inheriting standard handles on windows
Currently if a standard I/O handle is set to inherited on Windows, no action is
taken and the slot in the process information description is set to
`INVALID_HANDLE_VALUE`. Due to our passing of `STARTF_USESTDHANDLES`, however,
this means that the handle is actually set to nothing and if a child tries to
print it will generate an error.

This commit fixes this behavior by explicitly creating stdio handles to be
placed in these slots by duplicating the current process's I/O handles. This is
presumably what previously happened silently by using a file-descriptor-based
implementation instead of a `HANDLE`-centric implementation.

Along the way this cleans up a lot of code in `Process::spawn` for Windows by
ensuring destructors are always run, using more RAII, and limiting the scope of
`unsafe` wherever possible.
2015-04-29 08:01:16 -07:00
Björn Steinbrink
36dccec2f3 Currently, LLVM lowers a cttz8 on x86_64 to these instructions:
```asm
    movzbl      %dil, %eax
    bsfl        %eax, %eax
    movl        $32, %ecx
    cmovnel     %eax, %ecx
    cmpl        $32, %ecx
    movl        $8, %eax
    cmovnel     %ecx, %eax
```

which has some unnecessary overhead, having two conditional moves.

To improve the codegen, we can zero extend the 8 bit integer, then set
bit 8 and perform a cttz operation on the extended value. That way
there's no conditional operation involved at all.
2015-04-29 14:45:23 +02:00
bors
551a74dddd Auto merge of #24932 - pnkfelix:fix-issue-24687, r=huonw
metdata: Fix zero-normalization of the pos of a `MultiByteChar`

Fix #24687

The source byte/character mappings for every crate track the collection of multi-characters from its source files specially.  When we import the source information for another file into the current compilation unit, we assign its byte-positions unique values by shifting them all by a fixed adjustment, tracked in the `start_pos` field.  But when we pull out the source span information for one function from one crate and into our own crate, we need to re-normalize the byte positions: subtracting the old `start_pos` and adding the new `start_pos`. The `new_imported_filemap(..)` method handles adding the new `start_pos`, so all `creader` needs to do is re-normalize each `pos` to zero.

It seems like it was indeed trying to do this, but it mistakenly added the old `start_pos` instead of subtracting it.
2015-04-29 10:40:03 +00:00
Oliver Schneider
d6043d1e71 fix broken link
compiler plugins are hosted unter "compiler-plugins.html" not "plugins.html"
2015-04-29 11:41:00 +02:00
Felix S. Klock II
2ae82fcd95 Regression test for issue 24687.
use visible characters for the multibyte character filler.
2015-04-29 10:53:09 +02:00
jooert
f99658d7c7 Adapt benchmark tests to unit test guidelines
Since #24783, the style guidelines recommend that unit tests should live in a submodule `tests` rather than `test` to not clash with the possible use of libtest. This is especially important for benchmark tests as they require libtest. Fixes #24923.
2015-04-29 10:36:43 +02:00
Felix S. Klock II
ecd3572f49 Fix zero-normalization of the pos of a MultiByteChar.
Fix #24687
2015-04-29 10:21:29 +02:00
bors
26c7635ccf Auto merge of #24893 - robinst:issue-24407-E0013, r=nrc
Part of #24407.
2015-04-29 07:37:58 +00:00
Nick Cameron
de2a4c0113 save-analysis: fix impl functions 2015-04-29 19:21:18 +12:00
Nick Cameron
7bfb5ed826 Reviewer changes 2015-04-29 18:56:13 +12:00
Nick Cameron
bb26aadaf3 Tidy up 2015-04-29 17:26:22 +12:00
Nick Cameron
88f840bdea debuginfo: extract adt.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
9756349d11 debuginfo: extract metadata.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
024e86fad5 debuginfo: extract types.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
488694cf0d debuginfo: extract namespace.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
5b53de1775 debuginfo: extract create.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
a015547894 debuginfo: extract utils.rs 2015-04-29 17:26:22 +12:00
Nick Cameron
5753c8d6ca debuginfo: extract gdb.rs 2015-04-29 17:23:36 +12:00
Nick Cameron
5993ae86b8 debuginfo: pull out docs 2015-04-29 17:23:36 +12:00
Nick Cameron
39e2e649cb Tidy up word-wrapping in debuginfo 2015-04-29 17:23:36 +12:00
Nick Cameron
3f025fe7b2 Move debuginfo.rs to its own directory 2015-04-29 17:23:36 +12:00
Tamir Duberstein
f7947bc936 Unstub some tests 2015-04-28 21:23:28 -07:00
Tamir Duberstein
8073af7399 Tests need not be public 2015-04-28 21:22:58 -07:00
Tamir Duberstein
cd5abe7635 Remove unused variable 2015-04-28 21:22:06 -07:00
bors
d4cedea80a Auto merge of #24681 - tamird:unignore-android, r=alexcrichton
There are still quite a few ignored Android tests kicking around, most of which were added in 445faca844, which has a pretty unfortunate commit message.

r? @alexcrichton
2015-04-29 04:09:45 +00:00
Corey Farwell
960f8006d2 Fix punctuation placement in doc-comment 2015-04-28 23:06:00 -04:00
bors
c48b499ea3 Auto merge of #24888 - tamird:snapshot, r=alexcrichton
r? @alexcrichton cc @brson
2015-04-29 02:16:01 +00:00
Carol Nichols
0ddee94cfe Move explanation that references lexical grammar to the grammar
Reword so that the references to things above/below are up to date and a
bit more specific.
2015-04-28 22:02:53 -04:00
Carol (Nichols || Goulding)
3e521bfd96 Add boolean literal to the grammar
To make this rule match the definition of Lit_ in
https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs
2015-04-28 21:46:49 -04:00
Nicholas Mazzuca
83814325b4 Add intrinsics for unchecked division and modulo
The "unchecked_" div and rem functions will give UB in case of rhs == 0, or,
in the signed versions, lhs == INT::min and rhs == -1
2015-04-28 18:20:30 -07:00
Tamir Duberstein
bd5afb406d Reference the correct issue 2015-04-28 17:52:38 -07:00
Tamir Duberstein
c6364abbc1 #10356: Warnings 2015-04-28 17:52:37 -07:00
Tamir Duberstein
54de911f35 #10381: Warnings 2015-04-28 17:51:43 -07:00
Tamir Duberstein
9768447b64 Reference the correct issue and clarify failure 2015-04-28 17:51:01 -07:00
Tamir Duberstein
41ff911ae8 #10393 & #13206: Warnings 2015-04-28 17:49:22 -07:00
Alex Crichton
0368abb0a4 std: Implement fs::DirBuilder
This is the last remaining portion of #24796
2015-04-28 17:38:26 -07:00
Tamir Duberstein
69abc12b00 Register new snapshots 2015-04-28 17:23:45 -07:00
bors
c4b23aec4c Auto merge of #24865 - bluss:range-size, r=alexcrichton
core: Fix size_hint for signed integer `Range<T>` iterators

There was an overflow bug in .size_hint() for signed iterators, which
produced an hilariously incorrect size or an overflow panic.

Incorrect size is a serious bug since the iterators are marked
ExactSizeIterator. (And leads to abort() on (-1i8..127).collect() when
the collection tries to preallocate too much).

> (-1i8..127).size_hint()
(18446744073709551488, Some(18446744073709551488))

Bug found using quickcheck.

Fixes #24851
2015-04-29 00:15:22 +00:00
J Bailey
abb61d99ad Extend the nullable pointer optimization to captured vars of closures 2015-04-28 19:24:16 -04:00
bors
8871c17b76 Auto merge of #24781 - bluss:vec-drain-range, r=alexcrichton
Implement Vec::drain(\<range type\>) from rust-lang/rfcs#574, tracking issue #23055.

This is a big step forward for vector usability. This is an introduction of an API for removing a range of *m* consecutive elements from a vector, as efficently as possible.

New features:

- Introduce trait `std::collections::range::RangeArgument` implemented by all four built-in range types.
- Change `Vec::drain()` to use `Vec::drain<R: RangeArgument>(R)`

Implementation notes:

- Use @Gankro's idea for memory safety: Use `set_len` on the source vector when creating the iterator, to make sure that the part of the vector that will be modified is unreachable. Fix up things in Drain's destructor — but even if it doesn't run, we don't expose any moved-out-from slots of the vector.
- This `.drain<R>(R)` very close to how it is specified in the RFC.
- Introduced as unstable
- Drain reuses the slice iterator — copying and pasting the same iterator pointer arithmetic again felt very bad
- The `usize` index as a range argument in the RFC is not included. The ranges trait would have to change to accomodate it.

Please help me with:

- Name and location of the new ranges trait.
- Design of the ranges trait
- Understanding Niko's comments about variance (Note: for a long time I was using a straight up &mut Vec in the iterator, but I changed this to permit reusing the slice iterator).

Previous PR and discussion: #23071
2015-04-28 22:13:42 +00:00
Nicholas
b2a38c3b91 Correct the entry point in librustc/README.md 2015-04-28 14:40:03 -07:00