Commit Graph

74095 Commits

Author SHA1 Message Date
David Wood
71b7500241
Fix new test from rebase. 2018-01-27 11:46:28 +00:00
David Wood
be465b0b85
next_point now handles creating spans over multibyte characters. 2018-01-27 11:46:28 +00:00
David Wood
62356471b3
Replaced multi-byte character handling in end_point with potentially more performant variant. 2018-01-27 11:46:28 +00:00
David Wood
c71cec8834
end_point handling multibyte characters correctly. 2018-01-27 11:46:27 +00:00
David Wood
c6e6428d1a
Moved overflow check into end_point function. 2018-01-27 11:46:26 +00:00
David Wood
f6fee2a479
Fixed off-by-one spans in MIR borrowck errors. 2018-01-27 11:46:26 +00:00
David Wood
6d00c9686b
Updated tests with fixed span location. 2018-01-27 11:46:22 +00:00
bors
6b99adeb11 Auto merge of #46450 - Gilnaa:libtest_json_output, r=nrc
Libtest json output

A revisit to my [last PR](https://github.com/rust-lang/rust/pull/45923).

Events are now more atomic, printed in a flat hierarchy.

For the normal test output:
```
running 1 test
test f ... FAILED

failures:

---- f stdout ----
	thread 'f' panicked at 'assertion failed: `(left == right)`
  left: `3`,
 right: `4`', f.rs:3:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.

failures:
    f

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
```

The JSON equivalent is:
```
{ "type": "suite", "event": "started", "test_count": "1" }
{ "type": "test", "event": "started", "name": "f" }
{ "type": "test", "event": "failed", "name": "f" }
{ "type": "suite", "event": "failed", "passed": 0, "failed": 1, "allowed_fail": 0, "ignored": 0,  "measured": 0, "filtered_out": "0" }
{ "type": "test_output", "name": "f", "output": "thread 'f' panicked at 'assertion failed: `(left == right)`
  left: `3`,
 right: `4`', f.rs:3:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
" }
```
2018-01-27 10:56:56 +00:00
Gilad Naaman
8b7f1d0cec libtest: Fixed call to python in run-make 2018-01-27 11:50:01 +02:00
bors
6272b60dca Auto merge of #47690 - estebank:for-block-277, r=nikomatsakis
For E0277 on `for` loops, point at the "head" expression

When E0277's span points at a `for` loop, the actual issue is in the
element being iterated. Instead of pointing at the entire loop, point
only at the first line (when possible) so that the span ends in the
element for which E0277 was triggered.
2018-01-27 08:04:12 +00:00
Pulkit Goyal
5ce2b02997 don't mention tasks in stability warnings of #[thread_local] #47755
This is a fix for issue #47755.
2018-01-27 13:28:09 +05:30
Ryan Cumming
ed7e4e1e27 Expand union test to include different types 2018-01-27 14:26:14 +11:00
Araam Borhanian
0984ee3051 Adding ICH to the glossary. 2018-01-26 21:10:35 -05:00
Ryan Cumming
75c79bdb02 Fix ICE on const eval of union field
MIR's `Const::get_field()` attempts to retrieve the value for a given
field in a constant. In the case of a union constant it was falling
through to a generic `const_get_elt` based on the field index. As union
fields don't have an index this caused an ICE in `llvm_field_index`.

Fix by simply returning the current value when accessing any field in a
union. This works because all union fields start at byte offset 0.

The added test uses `const_fn` it ensure the field is extracted using
MIR's const evaluation. The crash is reproducible without it, however.

Fixes #47788
2018-01-27 12:57:01 +11:00
Niko Matsakis
205eba83e2
pacify the mercilous tidy 2018-01-26 20:51:40 -05:00
Niko Matsakis
b57ca9d97f
change from dirty_bit_vec to clean_bit_vec
Otherwise the vector is initially out of sync
2018-01-26 20:13:51 -05:00
Niko Matsakis
44b666816b
Adjust comment spacing
I suspect the lines would be long for tidy.
2018-01-26 19:58:54 -05:00
Santiago Pastorino
da545cee60 Make region inference use a dirty list
Fixes #47602
2018-01-26 21:56:49 -03:00
Esteban Küber
ee06559576 Tweak presentation on lifetime trait mismatch 2018-01-26 16:38:07 -08:00
bors
5c41fcec4c Auto merge of #47571 - FenrirWolf:libunwind, r=alexcrichton
Match libunwind's EABI selection with libpanic_unwind

Currently, the `libunwind` crate will only select the ARM EABI if it is compiling for ARM/Linux or Android targets. `libpanic_unwind`, however, will choose the ARM EABI if the target arch is ARM and the OS is not iOS. This means that if one tries to enable unwinding for a non-standard ARM target (such as implementing a custom stdlib via Xargo, for example), then the two crates can potentially disagree about which EABI is being targeted.

This PR makes `libunwind` use the [same logic](https://github.com/rust-lang/rust/blob/master/src/libpanic_unwind/gcc.rs#L139-L146) as `libpanic_unwind` when choosing the EABI.

I noticed there are a few comments about certain functions only differing on Android or ARM/Linux, but I *think* that those differences apply to the ARM EABI in general. Let me know if I'm wrong about that.
2018-01-27 00:28:34 +00:00
Esteban Küber
445e404ba4 Instead of modifying the item's span synthesize it 2018-01-26 15:06:09 -08:00
Esteban Küber
fa7767e1ea review comment 2018-01-26 14:24:17 -08:00
Esteban Küber
d0bd090efb Consider all whitespace when preparing span 2018-01-26 14:24:17 -08:00
Esteban Küber
a8f77e12fc Include space in suggestion mut in bindings 2018-01-26 14:24:17 -08:00
Mark Mansi
e2d558ad56 A few more comments 2018-01-26 14:47:24 -06:00
Mark Mansi
02d1d92878 Still more comments 2018-01-26 14:47:24 -06:00
Mark Mansi
b01b481db3 Added/improved comments 2018-01-26 14:47:24 -06:00
Mark Mansi
6d4ed65585 Added lots of comments + minor reorganization 2018-01-26 14:47:24 -06:00
Mark Mansi
0d7f193dd3 Added a bunch of comments to macro_parser.rs 2018-01-26 14:47:24 -06:00
Mark Mansi
ac0c16d3b5 Run rustfmt on /libsyntax/ext/tt/macro_parser.rs 2018-01-26 14:47:24 -06:00
Esteban Küber
106e5c554d Don't add "in this macro invocation" label to desugared spans 2018-01-26 11:35:27 -08:00
Esteban Küber
f90c445637 Modify spans of expanded expression
Modify the spans used for `for`-loop expression expansion, instead of
creating a new span during error creation.
2018-01-26 11:05:02 -08:00
Gilad Naaman
100ead353a Updated Cargo commit hash 2018-01-26 19:57:02 +02:00
Gilad Naaman
cb86f38497 libtest: Failing benchmarks no longer crash the harness. 2018-01-26 19:46:04 +02:00
Gilad Naaman
360b26389c libtest: Split-up formatters.rs into smaller modules
libtest: Split HumanFormatter into {Pretty,Terse}

libtest: Fixed padding of benchmarks when not benchmarking

libtest: Fixed benchmarks' names not showing in terse-mode

libtest: Formatting
2018-01-26 19:46:04 +02:00
Gilad Naaman
adddb0f41a libtest: Added UI tests for --format=json
libtest: Remove usage of jq

libtest: Fixed UI tests

- Now comparing to the right file.
- A python script checks for validity of JSON documents
2018-01-26 19:46:04 +02:00
Gilad Naaman
8b3fd98f4c libtest: rustfmt run
libtest: Whoops
2018-01-26 19:46:04 +02:00
Gilad Naaman
94bd1216bb libtest: Fixed pretty-printing of test names in single-threaded code. 2018-01-26 19:46:04 +02:00
Gilad Naaman
e570e9e79a libtest: JSON formatting is now only available in unstable builds
libtest: Added the -Z option for unstable options
2018-01-26 19:46:04 +02:00
Gilad Naaman
588a6a35be Added JSON output to libtest.
libtest: Json format now outputs failed tests' stdouts.

libtest: Json format now outputs failed tests' stdouts.

libtest: Json formatter now spews individiual events, not as an array

libtest: JSON fixes

libtest: Better JSON escaping

libtest: Test start event is printed on time
2018-01-26 19:46:04 +02:00
Gilad Naaman
d24f9af31c Refactoring needed in order to have test json output. 2018-01-26 19:46:04 +02:00
bors
bacb5c58df Auto merge of #47748 - alexcrichton:rollup, r=alexcrichton
Rollup of 19 pull requests

- Successful merges: #47415, #47437, #47439, #47453, #47460, #47502, #47529, #47600, #47607, #47618, #47626, #47656, #47668, #47696, #47701, #47705, #47710, #47711, #47719
- Failed merges: #47455, #47521
2018-01-26 17:41:36 +00:00
Alex Crichton
a06d333a14 Ignore a test on emscripten 2018-01-26 09:41:00 -08:00
varkor
aa6cc6e189 Fix test in macro_backtrace 2018-01-26 16:56:37 +00:00
Niko Matsakis
c48f46ba36 add regression test
Fixes #47139
2018-01-26 11:44:24 -05:00
Corentin Henry
077d3434aa add test checking that process::Command is Send 2018-01-26 08:21:58 -08:00
varkor
adcb37e275 Add clarifying comment regarding the trailing type of a block 2018-01-26 15:39:19 +00:00
Alex Crichton
9bb18239de Fix a test case on Windows 2018-01-26 07:37:57 -08:00
varkor
0ac465924e Add line numbers and columns to error messages spanning multiple files
If an error message is emitted that spans several files, only the
primary file currently has line and column data attached. This is
useful information, even in files other than the one in which the error
occurs. We can often work out which line and column the error
corresponds to in other files — in this case it is helpful to add them
(in the case of ambiguity, the first relevant line/column is picked,
which is still helpful than none).
2018-01-26 15:33:05 +00:00
Corentin Henry
9e6ed17c4f make Command.argv Send on unix platforms
Implementing Send for a specific field rather than the whole struct is
safer: if a field is changed/modified and becomes non-Send, we can catch
it.
2018-01-26 07:22:58 -08:00