Commit Graph

70549 Commits

Author SHA1 Message Date
Corey Farwell
b9ffbff959 Rollup merge of #46260 - ExpHP:builtin-macro-doc-sync, r=steveklabnik
Make doc stubs for builtin macros reflect existing support for trailing commas

This modifies the `macro_rules!` stubs in `std` for some of the compiler builtin macros in order to better reflect their currently supported grammar.  To my understanding these stubs have no impact on compiler output whatsoever, and only exist so that they may appear in the documentation.

P.S. It is in fact true that `env!` supports trailing commas while `option_env!` currently does not.  (I have another issue for this)

I don't imagine there's any way to automatically test these stubs, but I did *informally* test the new definitions on the playpen to see that they accept the desired invocations, as well as inspect the updated doc output.
2017-12-03 17:43:44 -05:00
Corey Farwell
82ee209492 Rollup merge of #45957 - dereckson:unix-agnosticity, r=shepmaster
Use more convenient and UNIX-agnostic shebang

When using bash-specific features, scripts using env to call bash
are more convenient, as bash be installed in different places
according the OS.
2017-12-03 17:43:43 -05:00
bors
1956d5535a Auto merge of #46435 - cuviper:min-llvm-3.9, r=rkruppe
Assume at least LLVM 3.9 in rustllvm and rustc_llvm

We bumped the minimum LLVM to 3.9 in #45326.  This just cleans up the conditional code in the `rustllvm` C++ wrappers to assume that minimum, and similarly cleans up the `rustc_llvm` build script.
2017-12-03 20:31:21 +00:00
bors
f2b11f30b2 Auto merge of #46393 - kennytm:45861-step-2-3-make-tools-job-not-fail-fast, r=alexcrichton
[auto-toolstate][2+3/8] Move external tools tests into its own job with --no-fail-fast

This PR performs these  things:

1. The `aux` job now performs "cargotest" and "pretty" tests. The clippy/rustfmt/rls/miri tests are moved into its own job.
2. These tests are run with `--no-fail-fast`, so that we can get the maximum number of failures of all tools from a single CI run.
3. The test results are stored into a JSON file, ready to be uploaded in the future.

This is step 2 and 3/8 of automatic management of broken tools #45861.
2017-12-03 18:01:29 +00:00
Corey Farwell
a2d87d83bf Consistent parameter name for numeric ‘checked’ operations.
Some checked operations use `rhs` as a parameter name, and some use
`other`. For the sake of consistency, unify everything under the `rhs`
name.

Fixes https://github.com/rust-lang/rust/issues/46308.
2017-12-03 11:24:00 -05:00
bors
0d11e51993 Auto merge of #46334 - mikhail-m1:slice_pattern_array_drop, r=arielb1
create a drop ladder for an array if any value is moved out

r? @arielb1
first commit for fix https://github.com/rust-lang/rust/issues/34708 (note: this still handles the subslice case in a very broken manner)
2017-12-03 15:31:32 +00:00
bors
9da2112238 Auto merge of #46320 - arielb1:always-resume, r=nikomatsakis
Always unwind through a Resume and other fixes

Should fix most of the small MIR borrowck issues.

r? @nikomatsakis
2017-12-03 13:01:47 +00:00
Ariel Ben-Yehuda
ff0b84df58 fix tests in wasm 2017-12-03 14:50:47 +02:00
kennytm
183964505b
Update the tools CI to use --no-fail-fast and --save-toolstates. 2017-12-03 18:36:56 +08:00
kennytm
971b1ba42b
Record build and test result of extended tools into toolstates.json. 2017-12-03 18:36:56 +08:00
kennytm
128199e39c
Move the swap the tools test and cargotest within check-aux.
The cargotest job is renamed to tools for clarification.
2017-12-03 18:36:56 +08:00
bors
d0ebb4dead Auto merge of #46433 - GuillaumeGomez:dedup-items, r=QuietMisdreavus
Fix deduplication of items

Fixes #45968.

r? @QuietMisdreavus
2017-12-03 10:33:15 +00:00
Kenjiro Nakayama
cac199fb27 Fix invalid link to lint_plugin_test.rs 2017-12-03 18:13:54 +09:00
Shotaro Yamada
17d6631c02 Fix MIR CopyPropagation regression 2017-12-03 17:42:52 +09:00
bors
0bae745cd8 Auto merge of #46290 - scottmcm:i128-from-compiler-builtins, r=nagisa
Update compiler-builtins and use it in the 128-bit lowering MIR test

This picks up the lang item implementations from https://github.com/rust-lang-nursery/compiler-builtins/pull/210

cc #45676 @est31 @nagisa
2017-12-03 07:42:31 +00:00
Scott McMurray
c0654ce815 Add ignore-emscripten too 2017-12-02 23:24:11 -08:00
bors
7e251390c7 Auto merge of #46428 - eddyb:scalar-pair-unpacking, r=arielb1
rustc: don't unpack newtypes of scalar-pairs with mismatched alignment.

This PR fixes a potential problem where a packed newtype of a pair was also considered a pair, even though it didn't have the required alignment of the pair.
cc @oli-obk It's possible miri hit something like this, with an unstable feature, but it's more general.
2017-12-03 05:14:24 +00:00
Scott McMurray
ad2a8e8356 Ignore the lower_128bit tests on asmjs 2017-12-02 20:21:50 -08:00
Scott McMurray
49ee16131e Remove the unneeded #![feature(lang_items)]s 2017-12-02 20:16:44 -08:00
Scott McMurray
d775d79a01 Update compiler-builtins and use it the 128-bit lowering MIR test 2017-12-02 20:16:44 -08:00
bors
16ba4591d7 Auto merge of #46384 - ollie27:rustdoc_inline_assoc, r=QuietMisdreavus
rustdoc: Fix issues with cross-crate inlined associated items

* Visibility was missing from impl items.
* Attributes and docs were missing from consts and types in impls.
* Const default values were missing from traits.

This unifies the code that handles associated items from impls and traits.
2017-12-03 00:54:52 +00:00
Ariel Ben-Yehuda
6594799b2d add and unignore tests 2017-12-03 02:47:44 +02:00
Ariel Ben-Yehuda
9dc396747b funnel all unwind paths through a single Resume block
This simplifies analysis and borrow-checking because liveness at the
resume point can always be simply propagated.

Later on, the "dead" Resumes are removed.
2017-12-03 02:47:44 +02:00
Ariel Ben-Yehuda
485476c25a add a pass to remove no-op landing pads 2017-12-03 02:47:44 +02:00
Ariel Ben-Yehuda
25416c7081 don't track borrows for empty regions
Region inference can create borrows for an empty region if the borrow is
dead. In that case, there's no reason to track the borrow, but because
there's no such thing as an EndRegion(ReEmpty) these borrows used to live
for the entire function.

Fixes #46161.
2017-12-03 02:29:04 +02:00
Ariel Ben-Yehuda
a6e24fc31f initialize the destination in unit statements
Fixes #46159.
2017-12-03 02:21:13 +02:00
Ariel Ben-Yehuda
af8c2339cf fix handling of borrows at a function's end 2017-12-03 02:21:13 +02:00
bors
088f328ec5 Auto merge of #46382 - alexcrichton:thinlto-default, r=michaelwoerister
rustc: Prepare to enable ThinLTO by default

This commit *almost* enables ThinLTO and multiple codegen units in release mode by
default but is blocked on #46346 now before pulling the trigger.
2017-12-02 22:27:24 +00:00
Guillaume Gomez
6afff9699a Fix search results overlap 2017-12-02 22:14:19 +01:00
bors
f9b0897c5d Auto merge of #46381 - estebank:expected-span, r=nikomatsakis
Point to next token when it is in the expected line

r? @nikomatsakis
2017-12-02 20:06:42 +00:00
Mikhail Modin
7be2fd853a create a drop ladder for an array if any value is moved out 2017-12-02 22:57:40 +03:00
bors
377decc352 Auto merge of #46368 - michaelwoerister:incr-comp-type-debuginfo-spans, r=eddyb
incr.comp.: Remove an unnecessary HIR access which enables hashing spans for type definitions.

r? @nikomatsakis
2017-12-02 17:37:56 +00:00
bors
9053fdd411 Auto merge of #46349 - estebank:highlight-ref, r=arielb1
On type mismatch error highlight `&` when type matches

When the only difference between the two types in a type error is that
one is a reference to the other type (`T` vs `&T`) or both are
references differing only in their mutability (`&T` vs `&mut T`), don't
highlight the type (`T`).
2017-12-02 15:08:08 +00:00
est31
60a842f529 Remove an unstable and dead compiler flag
The last use has been removed by commit fb9ca16b3b .
2017-12-02 13:56:32 +01:00
bors
7a649872a9 Auto merge of #46347 - raventid:did-you-mean-increase-accuracy, r=estebank
Add case insensitive comparison, besides Levenstein for DYM

Closes #46332

Draft version. The idea is that Levenstein does not work for some cases when we have multiple equal weights for strings. I didn't understand the case with `if found != name => Some(found)` so it means that new code does not work correctly yet.

At least now I think that we might return all maximal weights from levenstein and think about next cases in priority order:

1) There is exact match -> None
2) There is exact match, but case insensitive -> Some(match)
3) There is some match from levenstein -> Some(matches.take_any)
4) There is no match -> None

@estebank WDYT?
2017-12-02 12:42:54 +00:00
bors
e0d11f39d8 Auto merge of #46343 - jseyfried:fix_hygiene_bug, r=nrc
Fix hygiene bug.

Fixes #42708.
r? @nrc
2017-12-02 10:15:21 +00:00
bors
8bcbf91a86 Auto merge of #46326 - GuillaumeGomez:sidebar-text, r=QuietMisdreavus
Fix invalid HTML escape

Fixes #46289.

r? @QuietMisdreavus
2017-12-02 07:49:32 +00:00
bors
c3942e751c Auto merge of #46288 - alexcrichton:bump-bootstrap, r=Mark-Simulacrum
Bump to 1.24.0

* Update the in-tree version number
* Update the bootstrap compiler
* Remove `cfg(stage0)` annotations
* Update crate dependencies
* Update Cargo itself
2017-12-02 05:21:58 +00:00
bors
b15a8eafcd Auto merge of #46256 - estebank:suggest-deref, r=arielb1
Use suggestions instead of notes ref mismatches

On type mismatch errors, use a suggestion when encountering minimal
differences in type differences due to refs, instead of a note.
2017-12-02 02:56:16 +00:00
Sébastien Santoro
a4b4a73328 Use more convenient and UNIX-agnostic shebang
When using bash-specific features, scripts using env to call bash
are more convenient, as bash be installed in different places
according the OS.

Same applies for other languages' interpreters.
2017-12-02 01:03:59 +00:00
bors
ddaebe938b Auto merge of #45904 - sunjay:gat-parser, r=nikomatsakis
Generic Associated Types Parsing & Name Resolution

Hi!
This PR adds parsing for generic associated types! 🎉 🎉 🎉

Tracking Issue: #44265

## Notes For Reviewers
* [x] I still need to add the stdout and stderr files to my ui tests. It takes me a *long* time to compile the compiler locally, so I'm going to add this as soon as possible in the next day or so.
* [ ] My current ui tests aren't very good or very thorough. I'm reusing the `parse_generics` and `parse_where_clause` methods from elsewhere in the parser, so my changes work without being particularly complex. I'm not sure if I should duplicate all of the generics test cases for generic associated types. It might actually be appropriate to duplicate everything here, since we don't want to rely on an implementation detail in case it changes in the future. If you think so too, I'll adapt all of the generics test cases into the generic associated types test cases.
* [ ] There is still more work required to make the run-pass tests pass here. In particular, we need to make the following errors disappear:
```
error[E0110]: lifetime parameters are not allowed on this type
  --> ./src/test/run-pass/rfc1598-generic-associated-types/streaming_iterator.rs:23:41
   |
23 |     bar: <T as StreamingIterator>::Item<'static>,
   |                                         ^^^^^^^ lifetime parameter not allowed on this type
```
```
error[E0261]: use of undeclared lifetime name `'a`
  --> ./src/test/run-pass/rfc1598-generic-associated-types/iterable.rs:15:47
   |
15 |     type Iter<'a>: Iterator<Item = Self::Item<'a>>;
   |                                               ^^ undeclared lifetime
```
There is a FIXME comment in streaming_iterator. If you uncomment that line, you get the following:
```
error: expected one of `!`, `+`, `,`, `::`, or `>`, found `=`
  --> ./src/test/run-pass/rfc1598-generic-associated-types/streaming_iterator.rs:29:45
   |
29 | fn foo<T: for<'a> StreamingIterator<Item<'a>=&'a [i32]>>(iter: T) { /* ... */ }
   |                                             ^ expected one of `!`, `+`, `,`, `::`, or `>` here
```

r? @nikomatsakis
2017-12-02 00:15:19 +00:00
Josh Stone
5c4452aaaf rustc_llvm: Assume at least LLVM 3.9 in build.rs 2017-12-01 14:37:23 -08:00
Josh Stone
51342f1fd7 rustllvm: Remove conditional code for LLVM < 3.9
We bumped the minimum LLVM to 3.9 in #45326.  This just cleans up the
conditional code in the rustllvm C++ wrappers to assume at least 3.9.
2017-12-01 14:37:23 -08:00
Eduard-Mihai Burtescu
d455955445 rustc: don't unpack newtypes of scalar-pairs with mismatched alignment. 2017-12-02 00:29:56 +02:00
bors
70517540da Auto merge of #46430 - kennytm:rollup, r=kennytm
Rollup of 13 pull requests

- Successful merges: #45880, #46280, #46373, #46376, #46385, #46386, #46387, #46392, #46400, #46401, #46405, #46412, #46421
- Failed merges:
2017-12-01 21:29:27 +00:00
Guillaume Gomez
30734c4e68 Fix deduplication of items 2017-12-01 20:55:25 +01:00
bors
bb42071f63 Auto merge of #46425 - eddyb:mir-place, r=nikomatsakis
MIR: change "lvalue" terminology to "place".

As pointed out elsewhere, "lvalue" vs "rvalue" is a misleading/obscure distinction and several other choices have been proposed, the one I prefer being "place" vs "value".

This PR only touches the "lvalue" side, and only in MIR-related code, as it's already a lot and could rot.
2017-12-01 18:48:20 +00:00
Esteban Küber
36faafee8d Use suggestions instead of notes ref mismatches
On type mismatch errors, use a suggestion when encountering minimal
differences in type differences due to refs, instead of a note.
2017-12-01 10:44:29 -08:00
Tom Tromey
47acc4bd84 Fix documentation for DecodeUtf16Error
Fixes #46307
2017-12-01 11:33:42 -07:00
kennytm
5617477502 Rollup merge of #46421 - mnd:fix-build-for-guix, r=alexcrichton
build_helper: destination file can't be up to date when not exists

Function "up_to_date" return incorrect result if mtime for all fetched sources is set to epoch time. Add existence check to function.

This fix required for a [Guix](https://www.gnu.org/software/guix/) package because a Nix builder set mtime of all sources to epoch time.
2017-12-02 01:39:04 +08:00