]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAdd a test
Nick Cameron [Wed, 23 Nov 2016 00:35:07 +0000 (13:35 +1300)]
Add a test

7 years agosave-analysis: fix ICE on partially resolved path
Nick Cameron [Mon, 21 Nov 2016 05:11:36 +0000 (18:11 +1300)]
save-analysis: fix ICE on partially resolved path

Occurs when we produce save-analysis before type checking is complete (due to errors).

7 years agoAuto merge of #37862 - shepmaster:llvm-4.0-always-set-eh-personality, r=eddyb
bors [Sun, 20 Nov 2016 19:50:47 +0000 (13:50 -0600)]
Auto merge of #37862 - shepmaster:llvm-4.0-always-set-eh-personality, r=eddyb

[LLVM 4.0] Set EH personality when resuming stack unwinding

To resume stack unwinding, the LLVM `resume` instruction must be used.

In order to use this instruction, the calling function must have an
exception handling personality set.

LLVM 4.0 adds a new IR validation check to ensure a personality is
always set in these cases.

This was introduced in [r277360](https://reviews.llvm.org/rL277360).

7 years agoAuto merge of #37896 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 20 Nov 2016 16:36:25 +0000 (10:36 -0600)]
Auto merge of #37896 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 8 pull requests

- Successful merges: #37835, #37840, #37841, #37848, #37876, #37880, #37881, #37882
- Failed merges:

7 years agoRollup merge of #37882 - ollie27:chars_last, r=bluss
Guillaume Gomez [Sun, 20 Nov 2016 14:00:05 +0000 (15:00 +0100)]
Rollup merge of #37882 - ollie27:chars_last, r=bluss

Optimise Chars::last()

The default implementation of last() goes through the entire iterator
but that's not needed here.

7 years agoRollup merge of #37881 - ollie27:rustdoc_stab_enum_macro, r=alexcrichton
Guillaume Gomez [Sun, 20 Nov 2016 14:00:05 +0000 (15:00 +0100)]
Rollup merge of #37881 - ollie27:rustdoc_stab_enum_macro, r=alexcrichton

rustdoc: Remove unnecessary stability versions

For some reason only on enum and macro pages, the stability version is
rendered after the summary unlike all other pages. As it is already
displayed at the top of the page for all items, this removes it for
consistency and to prevent it from overlapping the summary text.

Fixes #36093

7 years agoRollup merge of #37880 - GuillaumeGomez:socket-4-doc, r=frewsxcv
Guillaume Gomez [Sun, 20 Nov 2016 14:00:05 +0000 (15:00 +0100)]
Rollup merge of #37880 - GuillaumeGomez:socket-4-doc, r=frewsxcv

Add missing examples in SocketAddr

r? @frewsxcv

7 years agoRollup merge of #37876 - birkenfeld:patch-1, r=apasel422
Guillaume Gomez [Sun, 20 Nov 2016 14:00:05 +0000 (15:00 +0100)]
Rollup merge of #37876 - birkenfeld:patch-1, r=apasel422

reference: fix duplicate bullet points in feature list

7 years agoRollup merge of #37848 - nnethercote:UnificationTable-probe, r=arielb1
Guillaume Gomez [Sun, 20 Nov 2016 14:00:04 +0000 (15:00 +0100)]
Rollup merge of #37848 - nnethercote:UnificationTable-probe, r=arielb1

Don't clone in UnificationTable::probe().

This speeds up compilation of rustc-benchmarks/inflate-0.1.0 by 1%.

7 years agoRollup merge of #37841 - michaelwoerister:ich-loop-tests, r=nikomatsakis
Guillaume Gomez [Sun, 20 Nov 2016 14:00:04 +0000 (15:00 +0100)]
Rollup merge of #37841 - michaelwoerister:ich-loop-tests, r=nikomatsakis

ICH: Add regression tests for various kinds of loops.

r? @nikomatsakis

7 years agoRollup merge of #37840 - brcooley:patch-1, r=steveklabnik
Guillaume Gomez [Sun, 20 Nov 2016 14:00:04 +0000 (15:00 +0100)]
Rollup merge of #37840 - brcooley:patch-1, r=steveklabnik

Fix grammar error in lifetimes.md

7 years agoRollup merge of #37835 - ojsheikh:E0088, r=jonathandturner
Guillaume Gomez [Sun, 20 Nov 2016 14:00:04 +0000 (15:00 +0100)]
Rollup merge of #37835 - ojsheikh:E0088, r=jonathandturner

Update E0088 to new error format

Fixes #35226 which is part of #35233. Is based on #36208 from @yossi-k.

r? @jonathandturner

7 years agoAuto merge of #37861 - shepmaster:llvm-4.0-inline-pass, r=alexcrichton
bors [Sun, 20 Nov 2016 13:26:03 +0000 (07:26 -0600)]
Auto merge of #37861 - shepmaster:llvm-4.0-inline-pass, r=alexcrichton

[LLVM 4.0] Update AlwaysInliner pass header and constructor

7 years agoAuto merge of #37855 - tbu-:pr_fix_debug_str, r=alexcrichton
bors [Sun, 20 Nov 2016 09:13:58 +0000 (03:13 -0600)]
Auto merge of #37855 - tbu-:pr_fix_debug_str, r=alexcrichton

Fix `fmt::Debug` for strings, e.g. for Chinese characters

The problem occured due to lines like

```
3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;;
4DB5;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;;
```

in `UnicodeData.txt`, which the script previously interpreted as two
characters, although it represents the whole range.

Fixes #34318.

7 years agoAuto merge of #37842 - nikomatsakis:incremental-test, r=mw
bors [Sun, 20 Nov 2016 05:39:25 +0000 (23:39 -0600)]
Auto merge of #37842 - nikomatsakis:incremental-test, r=mw

Add tests for incremental reuse scenarios

These are microbenchmarks checking that we achieve the expected reuse in the scenarios covered by incremental beta.

r? @michaelwoerister

7 years agoAuto merge of #37833 - sfackler:process-abort, r=alexcrichton
bors [Sun, 20 Nov 2016 02:01:52 +0000 (20:01 -0600)]
Auto merge of #37833 - sfackler:process-abort, r=alexcrichton

Add std::process::abort

This calls libc abort on Unix and fastfail on Windows, first running
cleanups to do things like flush stdout buffers. This matches with libc
abort's behavior, which flushes open files.

r? @alexcrichton

7 years agoOptimise CharIndices::last()
Oliver Middleton [Sun, 20 Nov 2016 00:37:48 +0000 (00:37 +0000)]
Optimise CharIndices::last()

The default implementation of last() goes through the entire iterator
but that's not needed here.

7 years agoAuto merge of #37831 - rkruppe:llvm-attr-fwdcompat, r=eddyb
bors [Sat, 19 Nov 2016 22:39:25 +0000 (16:39 -0600)]
Auto merge of #37831 - rkruppe:llvm-attr-fwdcompat, r=eddyb

[LLVM 4.0] Use llvm::Attribute APIs instead of "raw value" APIs

The latter will be removed in LLVM 4.0 (see https://github.com/llvm-mirror/llvm/commit/4a6fc8bacf11d8066da72cf8481467167877ed16).

The librustc_llvm API remains mostly unchanged, except that llvm::Attribute is no longer a bitflag but represents only a *single* attribute.
The ability to store many attributes in a small number of bits and modify them without interacting with LLVM is only used in rustc_trans::abi and closely related modules, and only attributes for function arguments are considered there.
Thus rustc_trans::abi now has its own bit-packed representation of argument attributes, which are translated to rustc_llvm::Attribute when applying the attributes.

cc #37609

7 years agoAdd missing examples in SocketAddr
Guillaume Gomez [Sat, 19 Nov 2016 17:33:32 +0000 (18:33 +0100)]
Add missing examples in SocketAddr

7 years agoAuto merge of #37826 - keeperofdakeys:proc-macro-test, r=alexcrichton
bors [Sat, 19 Nov 2016 19:28:50 +0000 (13:28 -0600)]
Auto merge of #37826 - keeperofdakeys:proc-macro-test, r=alexcrichton

Show a better error when using --test with #[proc_macro_derive]

Fixes https://github.com/rust-lang/rust/issues/37480

Currently using `--test` with a crate that contains a `#[proc_macro_derive]` attribute causes an error. This PR doesn't attempt to fix the issue itself, or determine what tesing of a proc_macro_derive crate should be - just to provide a better error message.

7 years agoOptimise Chars::last()
Oliver Middleton [Sat, 19 Nov 2016 18:43:41 +0000 (18:43 +0000)]
Optimise Chars::last()

The default implementation of last() goes through the entire iterator
but that's not needed here.

7 years agorustdoc: Remove unnecessary stability versions
Oliver Middleton [Sat, 19 Nov 2016 17:22:33 +0000 (17:22 +0000)]
rustdoc: Remove unnecessary stability versions

For some reason only on enum and macro pages, the stability version is
rendered after the summary unlike all other pages. As it is already
displayed at the top of the page for all items, this removes it for
consistency and to prevent it from overlapping the summary text.

7 years agoAuto merge of #37822 - cuviper:llvm-link-shared, r=alexcrichton
bors [Sat, 19 Nov 2016 16:08:26 +0000 (08:08 -0800)]
Auto merge of #37822 - cuviper:llvm-link-shared, r=alexcrichton

rustbuild: allow dynamically linking LLVM

The makefiles and `mklldeps.py` called `llvm-config --shared-mode` to
find out if LLVM defaulted to shared or static libraries, and just went
with that.  But under rustbuild, `librustc_llvm/build.rs` was assuming
that LLVM should be static, and even forcing `--link-static` for 3.9+.

Now that build script also uses `--shared-mode` to learn the default,
which should work better for pre-3.9 configured for dynamic linking, as
it wasn't possible back then to choose differently via `llvm-config`.

Further, the configure script now has a new `--enable-llvm-link-shared`
option, which allows one to manually override `--link-shared` on 3.9+
instead of forcing static.

Update: There are now four static/shared scenarios that can happen
for the supported LLVM versions:

- 3.9+: By default use `llvm-config --link-static`
- 3.9+ and `--enable-llvm-link-shared`: Use `--link-shared` instead.
- 3.8: Use `llvm-config --shared-mode` and go with its answer.
- 3.7: Just assume static, maintaining the status quo.

7 years agoAuto merge of #37814 - japaric:aapcs, r=alexcrichton
bors [Sat, 19 Nov 2016 12:58:48 +0000 (04:58 -0800)]
Auto merge of #37814 - japaric:aapcs, r=alexcrichton

fix `extern "aapcs" fn`

to actually use the AAPCS calling convention

closes #37810

This is technically a [breaking-change] because it changes the ABI of
`extern "aapcs"` functions that (a) involve `f32`/`f64` arguments/return
values and (b) are compiled for arm-eabihf targets from
"aapcs-vfp" (wrong) to "aapcs" (correct).

Appendix:

What these ABIs mean?

- In the "aapcs-vfp" ABI or "hard float" calling convention: Floating
point values are passed/returned through FPU registers (s0, s1, d0, etc.)

- Whereas, in the "aapcs" ABI or "soft float" calling convention:
Floating point values are passed/returned through general purpose
registers (r0, r1, etc.)

Mixing these ABIs can cause problems if the caller assumes that the
routine is using one of these ABIs but it's actually using the other
one.

---

r? @alexcrichton We are going this `extern "aapcs" fn` thing to implement some intrinsics (floatundidf) for the eabihf targets in order to comply with LLVM's calling convention of intrinsics.

Oh, and the value of the enum came from [here](http://llvm.org/docs/doxygen/html/namespacellvm_1_1CallingConv.html).

cc @TimNN @parched

7 years agoreference: fix duplicate bullet points in feature list
Georg Brandl [Sat, 19 Nov 2016 12:57:48 +0000 (13:57 +0100)]
reference: fix duplicate bullet points in feature list

7 years agoAuto merge of #37797 - arielb1:inline-closure, r=michaelwoerister
bors [Sat, 19 Nov 2016 09:49:07 +0000 (01:49 -0800)]
Auto merge of #37797 - arielb1:inline-closure, r=michaelwoerister

instantiate closures on demand

this should fix compilation with `-C codegen-units=4` - tested locally
with `RUSTFLAGS='-C codegen-units=4' ../x.py test`

r? @michaelwoerister

7 years agoAuto merge of #37853 - TimNN:fix-travis, r=alexcrichton
bors [Sat, 19 Nov 2016 06:39:08 +0000 (22:39 -0800)]
Auto merge of #37853 - TimNN:fix-travis, r=alexcrichton

fix travis: update Cargo.lock

7 years agoAuto merge of #37787 - michaelwoerister:macro-def-ich, r=nikomatsakis
bors [Sat, 19 Nov 2016 03:21:47 +0000 (19:21 -0800)]
Auto merge of #37787 - michaelwoerister:macro-def-ich, r=nikomatsakis

ICH: Handle MacroDef HIR instances.

As of recently, `hir::MacroDef` instances are exported in crate metadata, which means we also store their ICH when doing incremental compilation. Even though exported macro definitions should not (yet) interact with incremental compilation, the ICH is also used for the general purpose crate hash, where macros should be included.

This PR implements ICH computation for `MacroDef`. In theory, the ICH of these MacroDefs is less stable than that of other HIR items, since I opted to just call the compiler-generated `Hash::hash()` for `Token::Interpolated` variants. `Token::Interpolated` contains AST data structures and it would have been a lot of effort to expand ICH computation to the AST too. Since quasi-quoting is rarely used *and* it would only make a difference if incremental compilation was extended to macros, the simpler implementation seemed like a good idea.

This fixes the problem reported in https://github.com/rust-lang/rust/issues/37756. The test still fails because of broken codegen-unit support though.

r? @nikomatsakis

7 years agoAuto merge of #37867 - brson:no-lexer-verify, r=alexcrichton
bors [Fri, 18 Nov 2016 23:04:27 +0000 (15:04 -0800)]
Auto merge of #37867 - brson:no-lexer-verify, r=alexcrichton

Don't build the lexer verifier during tidy

Tidy is not the right place to do this. Tidy is for running lints.
We should instead be running the lexer/grammar tests as part of the test
suite.

This may fix nightly breakage, but I don't understand why.

https://buildbot.rust-lang.org/builders/nightly-dist-rustc-linux/builds/715/steps/distcheck/logs/stdio

r? @alexcrichton

cc @dns2utf8

7 years agoAdd span to warning about incr. comp. vs Token::Interpolated.
Michael Woerister [Wed, 16 Nov 2016 15:18:46 +0000 (10:18 -0500)]
Add span to warning about incr. comp. vs Token::Interpolated.

7 years agoAdd test case for exported macros vs incremental compilation.
Michael Woerister [Tue, 15 Nov 2016 21:16:40 +0000 (16:16 -0500)]
Add test case for exported macros vs incremental compilation.

7 years agoRemove outdated comment about SVH.
Michael Woerister [Tue, 15 Nov 2016 20:22:15 +0000 (15:22 -0500)]
Remove outdated comment about SVH.

7 years agoICH: Hash MacroDefs in a mostly stable way.
Michael Woerister [Tue, 15 Nov 2016 20:20:39 +0000 (15:20 -0500)]
ICH: Hash MacroDefs in a mostly stable way.

7 years agoAdd error message when not finding the ICH of a DepNode.
Michael Woerister [Tue, 15 Nov 2016 16:55:34 +0000 (11:55 -0500)]
Add error message when not finding the ICH of a DepNode.

7 years agoDon't build the lexer verifier during tidy
Brian Anderson [Fri, 18 Nov 2016 20:37:25 +0000 (20:37 +0000)]
Don't build the lexer verifier during tidy

Tidy is not the right place to do this. Tidy is for running lints.
We should instead be running the lexer/grammar tests as part of the test
suite.

This may fix nightly breakage, but I don't know why.

7 years agoAuto merge of #37776 - nrc:save-double-angle, r=@brson
bors [Fri, 18 Nov 2016 19:45:53 +0000 (11:45 -0800)]
Auto merge of #37776 - nrc:save-double-angle, r=@brson

save-analysis: handle << and >> operators inside [] in types

Fixes #37700

7 years agoremove FIXMEs; issue fixed
Niko Matsakis [Fri, 18 Nov 2016 18:35:42 +0000 (13:35 -0500)]
remove FIXMEs; issue fixed

7 years ago[LLVM 4.0] Set EH personality when resuming stack unwinding
Dylan McKay [Sat, 1 Oct 2016 13:04:42 +0000 (02:04 +1300)]
[LLVM 4.0] Set EH personality when resuming stack unwinding

To resume stack unwinding, the LLVM `resume` instruction must be used.

In order to use this instruction, the calling function must have an
exception handling personality set.

LLVM 4.0 adds a new IR validation check to ensure a personality is
always set in these cases.

This was introduced in [r277360](https://reviews.llvm.org/rL277360).

7 years agoAuto merge of #37749 - keeperofdakeys:should-panic, r=alexcrichton
bors [Fri, 18 Nov 2016 16:24:00 +0000 (08:24 -0800)]
Auto merge of #37749 - keeperofdakeys:should-panic, r=alexcrichton

Improvements to the #[should_panic] feature

Add more error checking for the `#[should_panic]` attribute, and print the expected panic string when it does not match.

Fixes https://github.com/rust-lang/rust/issues/29000

Eg:
```running 3 tests
test test2 ... ok
test test1 ... FAILED
: Panic did not include expected string 'foo'
test test3 ... FAILED

failures:

---- test1 stdout ----
thread 'test1' panicked at 'bar', test.rs:7
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- test3 stdout ----
thread 'test3' panicked at 'bar', test.rs:18

```

7 years ago[LLVM 4.0] Update AlwaysInliner pass header and constructor
Jake Goulding [Sat, 24 Sep 2016 16:37:04 +0000 (12:37 -0400)]
[LLVM 4.0] Update AlwaysInliner pass header and constructor

7 years agoimprove comments
Niko Matsakis [Fri, 18 Nov 2016 14:42:47 +0000 (09:42 -0500)]
improve comments

7 years agoadd test for adding a field
Niko Matsakis [Thu, 17 Nov 2016 20:50:25 +0000 (15:50 -0500)]
add test for adding a field

7 years agoadd test for changing pub inherent method signature
Niko Matsakis [Thu, 17 Nov 2016 20:16:44 +0000 (15:16 -0500)]
add test for changing pub inherent method signature

7 years agoadd test for changing pub inherent method body
Niko Matsakis [Thu, 17 Nov 2016 20:07:17 +0000 (15:07 -0500)]
add test for changing pub inherent method body

Ideally, callers should not be affected, but they currently are.

7 years agoFix `fmt::Debug` for strings, e.g. for Chinese characters
Tobias Bucher [Fri, 18 Nov 2016 12:59:44 +0000 (13:59 +0100)]
Fix `fmt::Debug` for strings, e.g. for Chinese characters

The problem occured due to lines like

```
3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;;
4DB5;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;;
```

in `UnicodeData.txt`, which the script previously interpreted as two
characters, although it represents the whole range.

Fixes #34318.

7 years agoAuto merge of #37769 - alexcrichton:rustbuild-python, r=brson
bors [Fri, 18 Nov 2016 13:03:03 +0000 (05:03 -0800)]
Auto merge of #37769 - alexcrichton:rustbuild-python, r=brson

rustbuild: Allow configuration of python interpreter

Add a configuration key to `config.toml`, read it from `./configure`, and add
auto-detection if none of those were specified.

Closes #35760

7 years agoupdate Cargo.lock
Tim Neumann [Fri, 18 Nov 2016 10:31:44 +0000 (11:31 +0100)]
update Cargo.lock

7 years agoWarn when a #[should_panic] test has an unexpected message
Josh Driver [Fri, 18 Nov 2016 10:31:19 +0000 (21:01 +1030)]
Warn when a #[should_panic] test has an unexpected message

7 years agoinstantiate closures on demand
Ariel Ben-Yehuda [Wed, 16 Nov 2016 10:27:43 +0000 (12:27 +0200)]
instantiate closures on demand

this should fix compilation with `-C codegen-units=4` - tested locally
with `RUSTFLAGS='-C codegen-units=4' ../x.py test`

7 years agoAuto merge of #37763 - liigo:rustdoc-playground, r=alexcrichton
bors [Fri, 18 Nov 2016 09:47:01 +0000 (01:47 -0800)]
Auto merge of #37763 - liigo:rustdoc-playground, r=alexcrichton

rustdoc: add cli argument `--playground-url`

Add a new cli argument `--playground-url` for rustdoc:

`rustdoc lib.rs --playground-url="https://play.rust-lang.org/"`

`rustdoc book.md --playground-url="https://play.rust-lang.org/"`

This makes it possible for tools like https://docs.rs to generate crate docs that can submit samples code to run at https://play.rust-lang.org, even if the crate's author *forgot* putting `#![doc(html_playground_url = "https://play.rust-lang.org/")]` to crate root. By the way, I'd like to say, many crate authors are not aware of existing of `#![doc(html_playground_url = "https://play.rust-lang.org/")]`.

`--playground-url` may be reset by `--markdown-playground-url` or `#![doc(html_playground_url=...)]`, so it's backward compatible.

@alexcrichton since you implemented playground-url related features.

7 years agorustbuild: update the llvm link logic further
Josh Stone [Fri, 18 Nov 2016 05:50:59 +0000 (21:50 -0800)]
rustbuild: update the llvm link logic further

There are now four static/shared scenarios that can happen for the
supported LLVM versions:

- 3.9+: By default use `llvm-config --link-static`
- 3.9+ and `--enable-llvm-link-shared`: Use `--link-shared` instead.
- 3.8: Use `llvm-config --shared-mode` and go with its answer.
- 3.7: Just assume static, maintaining the status quo.

7 years agoAuto merge of #37846 - jseyfried:fix_proc_macro_dep, r=alexcrichton
bors [Fri, 18 Nov 2016 04:56:03 +0000 (20:56 -0800)]
Auto merge of #37846 - jseyfried:fix_proc_macro_dep, r=alexcrichton

Fix bug in proc_macro dependency loading

Fixes #37839.
r? @alexcrichton

7 years agoDon't clone in UnificationTable::probe().
Nicholas Nethercote [Thu, 17 Nov 2016 23:10:09 +0000 (10:10 +1100)]
Don't clone in UnificationTable::probe().

This speeds up compilation of rustc-benchmarks/inflate-0.1.0 by 1%.

7 years agoAuto merge of #37660 - nikomatsakis:incremental-36349, r=eddyb
bors [Fri, 18 Nov 2016 01:31:01 +0000 (17:31 -0800)]
Auto merge of #37660 - nikomatsakis:incremental-36349, r=eddyb

Separate impl items from the parent impl

This change separates impl item bodies out of the impl itself. This gives incremental more resolution. In so doing, it refactors how the visitors work, and cleans up a bit of the collect/check logic (mostly by moving things out of collect that didn't really belong there, because they were just checking conditions).

However, this is not as effective as I expected, for a kind of frustrating reason. In particular, when invoking `foo.bar()` you still wind up with dependencies on private items. The problem is that the method resolution code scans that list for methods with the name `bar` -- and this winds up touching *all* the methods, even private ones.

I can imagine two obvious ways to fix this:

- separating fn bodies from fn sigs (#35078, currently being pursued by @flodiebold)
- a more aggressive model of incremental that @michaelwoerister has been advocating, in which we hash the intermediate results (e.g., the outputs of collect) so that we can see that the intermediate result hasn't changed, even if a particular impl item has changed.

So all in all I'm not quite sure whether to land this or not. =) It still seems like it has to be a win in some cases, but not with the test cases we have just now. I can try to gin up some test cases, but I'm not sure if they will be totally realistic. On the other hand, some of the early refactorings to the visitor trait seem worthwhile to me regardless.

cc #36349 -- well, this is basically a fix for that issue, I guess

r? @michaelwoerister

NB: Based atop of @eddyb's PR https://github.com/rust-lang/rust/pull/37402; don't land until that lands.

7 years agoAdd regression test.
Jeffrey Seyfried [Fri, 18 Nov 2016 00:51:24 +0000 (00:51 +0000)]
Add regression test.

7 years agoAdd std::process::abort
Steven Fackler [Thu, 17 Nov 2016 17:31:14 +0000 (09:31 -0800)]
Add std::process::abort

This calls libc abort on Unix and fastfail on Windows.

7 years agosave-analysis: handle << and >> operators inside [] in types
Nick Cameron [Tue, 15 Nov 2016 04:03:27 +0000 (17:03 +1300)]
save-analysis: handle << and >> operators inside [] in types

Fixes #37700

7 years agoFix bug in loading proc macro dependencies.
Jeffrey Seyfried [Fri, 18 Nov 2016 00:03:10 +0000 (00:03 +0000)]
Fix bug in loading proc macro dependencies.

7 years agoAuto merge of #37424 - shiver:issue-37131, r=alexcrichton
bors [Thu, 17 Nov 2016 22:16:27 +0000 (14:16 -0800)]
Auto merge of #37424 - shiver:issue-37131, r=alexcrichton

Improved error reporting when target sysroot is missing.

Attempts to resolve #37131.
This is my first pull request on rust, so I would greatly appreciate any feedback you have on this.

Thanks!

7 years agoadd test for hashing trait impls
Niko Matsakis [Thu, 17 Nov 2016 20:12:43 +0000 (15:12 -0500)]
add test for hashing trait impls

7 years agoUse llvm::Attribute API instead of "raw value" APIs, which will be removed in LLVM...
Robin Kruppe [Wed, 16 Nov 2016 22:36:08 +0000 (23:36 +0100)]
Use llvm::Attribute API instead of "raw value" APIs, which will be removed in LLVM 4.0.

The librustc_llvm API remains mostly unchanged, except that llvm::Attribute is no longer a bitflag but represents only a *single* attribute.
The ability to store many attributes in a small number of bits and modify them without interacting with LLVM is only used in rustc_trans::abi and closely related modules, and only attributes for function arguments are considered there.
Thus rustc_trans::abi now has its own bit-packed representation of argument attributes, which are translated to rustc_llvm::Attribute when applying the attributes.

7 years agoICH: Add regression tests for various kinds of loops.
Michael Woerister [Thu, 17 Nov 2016 19:28:38 +0000 (14:28 -0500)]
ICH: Add regression tests for various kinds of loops.

7 years agoFix grammar error in lifetimes.md
Brett Cooley [Thu, 17 Nov 2016 19:23:57 +0000 (12:23 -0700)]
Fix grammar error in lifetimes.md

7 years agoAuto merge of #37837 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 17 Nov 2016 18:57:08 +0000 (10:57 -0800)]
Auto merge of #37837 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 8 pull requests

- Successful merges: #37752, #37757, #37759, #37766, #37772, #37799, #37806, #37821
- Failed merges: #37442

7 years agocanonicalize base incremental path on windows
Niko Matsakis [Thu, 17 Nov 2016 17:44:46 +0000 (12:44 -0500)]
canonicalize base incremental path on windows

This sidesteps problems with long paths because the canonical path
includes the "magic long path prefix" on Windows.

7 years agofix change_private_impl_method_cc test
Niko Matsakis [Tue, 15 Nov 2016 02:02:29 +0000 (21:02 -0500)]
fix change_private_impl_method_cc test

7 years agofix oversight in closure translation
Niko Matsakis [Mon, 14 Nov 2016 23:23:07 +0000 (18:23 -0500)]
fix oversight in closure translation

(Unrelated to this PR series)

7 years agohash the contents of impl-item-ref by adding them to visitor
Niko Matsakis [Mon, 14 Nov 2016 16:00:02 +0000 (11:00 -0500)]
hash the contents of impl-item-ref by adding them to visitor

Also simplify some of the `ty::AssociatedItem` representation,
in particular by folding `has_value` into `hir::Defaultness`

7 years agomove impl wf check so they occur earlier
Niko Matsakis [Fri, 11 Nov 2016 14:52:46 +0000 (09:52 -0500)]
move impl wf check so they occur earlier

Needed to keep coherence from freaking out.

7 years agowhen creating an AssociatedItem, read data from impl, not impl item
Niko Matsakis [Fri, 11 Nov 2016 23:22:41 +0000 (18:22 -0500)]
when creating an AssociatedItem, read data from impl, not impl item

Before, when we created an AssociatedItem for impl item X, we would read
the impl item itself. Now we instead load up the impl I that contains X
and read the data from the `ImplItemRef` for X; actually, we do it for
all impl items in I pre-emptively.

This kills the last source of edges between a method X and a call to a
method Y defined in the same impl.

Fixes #37121

7 years agoRollup merge of #37821 - tshepang:nits, r=steveklabnik
Guillaume Gomez [Thu, 17 Nov 2016 18:40:58 +0000 (19:40 +0100)]
Rollup merge of #37821 - tshepang:nits, r=steveklabnik

doc: nits and typos on comments

7 years agoRollup merge of #37806 - GuillaumeGomez:net_examples, r=frewsxcv
Guillaume Gomez [Thu, 17 Nov 2016 18:40:58 +0000 (19:40 +0100)]
Rollup merge of #37806 - GuillaumeGomez:net_examples, r=frewsxcv

Net examples

r? @steveklabnik

7 years agoRollup merge of #37799 - michaelwoerister:ich-type-def-tests, r=nikomatsakis
Guillaume Gomez [Thu, 17 Nov 2016 18:40:58 +0000 (19:40 +0100)]
Rollup merge of #37799 - michaelwoerister:ich-type-def-tests, r=nikomatsakis

ICH: Add test case for type alias definitions

r? @nikomatsakis

7 years agoRollup merge of #37772 - durka:patch-32, r=petrochenkov
Guillaume Gomez [Thu, 17 Nov 2016 18:40:58 +0000 (19:40 +0100)]
Rollup merge of #37772 - durka:patch-32, r=petrochenkov

add test for #37765

Adds a test for #37765, a path parsing fix which removes the need for a parenthesis workaround.

Closes #37765.
cc #37290 @withoutboats
r? @petrochenkov

7 years agoRollup merge of #37766 - tarka:book-testing-concurrency-capture, r=steveklabnik
Guillaume Gomez [Thu, 17 Nov 2016 18:40:57 +0000 (19:40 +0100)]
Rollup merge of #37766 - tarka:book-testing-concurrency-capture, r=steveklabnik

Add sections about testing concurrency and stdout/err capture

7 years agoRollup merge of #37759 - robinst:trait-use-message-add-semicolon, r=eddyb
Guillaume Gomez [Thu, 17 Nov 2016 18:40:57 +0000 (19:40 +0100)]
Rollup merge of #37759 - robinst:trait-use-message-add-semicolon, r=eddyb

Add semicolon to "perhaps add a `use` for one of them" help

Similar to pull request #37430, this makes the message more copy-paste
friendly and aligns it with other messages like:

    help: you can import it into scope: use foo::Bar;

r? @eddyb

7 years agoRollup merge of #37757 - rust-lang:E0002-precision, r=brson
Guillaume Gomez [Thu, 17 Nov 2016 18:40:57 +0000 (19:40 +0100)]
Rollup merge of #37757 - rust-lang:E0002-precision, r=brson

Uncomment some long error explanation

Retry of #37058.

r? @steveklabnik
cc @brson

7 years agoRollup merge of #37752 - arielb1:incoherent-error, r=nikomatsakis
Guillaume Gomez [Thu, 17 Nov 2016 18:40:57 +0000 (19:40 +0100)]
Rollup merge of #37752 - arielb1:incoherent-error, r=nikomatsakis

coherence: skip impls with an erroneous trait ref

Impls with a erroneous trait ref are already ignored in the first part
of coherence, so ignore them in the second part too. This avoids
cascading coherence errors when 1 impl of a trait has an error.

r? @nikomatsakis

7 years agoAuto merge of #37732 - jseyfried:use_extern_macros, r=nrc
bors [Thu, 17 Nov 2016 15:43:50 +0000 (07:43 -0800)]
Auto merge of #37732 - jseyfried:use_extern_macros, r=nrc

Support `use`ing externally defined macros behind `#![feature(use_extern_macros)]`

With `#![feature(use_extern_macros)]`,
 - A name collision between macros from different upstream crates is much less of an issue since we can `use` the macros in different submodules or rename with `as`.
 - We can reexport macros with `pub use`, so `#![feature(macro_reexport)]` is no longer needed.
 - These reexports are allowed in any module, so crates can expose a macro-modular interface.

If a macro invocation can resolve to both a `use` import and a `macro_rules!` or `#[macro_use]`, it is an ambiguity error.

r? @nrc

7 years agoAdd tests
Josh Driver [Thu, 17 Nov 2016 15:41:20 +0000 (02:11 +1030)]
Add tests

7 years agoAuto merge of #37793 - jseyfried:fix_proc_macro_def_ids, r=nrc
bors [Thu, 17 Nov 2016 12:38:08 +0000 (04:38 -0800)]
Auto merge of #37793 - jseyfried:fix_proc_macro_def_ids, r=nrc

Fix proc macro def ids

Update some `CStore` methods to also work correctly with proc macro def ids.
Fixes #37788.
r? @nrc

7 years agoShow a better error when using --test with #[proc_macro_derive]
Josh Driver [Thu, 17 Nov 2016 11:36:36 +0000 (22:06 +1030)]
Show a better error when using --test with #[proc_macro_derive]

7 years agoAuto merge of #37717 - nikomatsakis:region-obligations-pre, r=eddyb
bors [Thu, 17 Nov 2016 09:18:51 +0000 (01:18 -0800)]
Auto merge of #37717 - nikomatsakis:region-obligations-pre, r=eddyb

Refactoring towards region obligation

Two refactorings towards the intermediate goal of propagating region obligations through the `InferOk` structure (which in turn leads to the possibility of lazy normalization).

1. Remove `TypeOrigin` and add `ObligationCause`
    - as we converge subtyping and obligations and so forth, the ability to keep these types distinct gets harder
2. Propagate obligations from `InferOk` into the surrounding fulfillment context

After these land, I have a separate branch (which still needs a bit of work) that can make the actual change to stop directly adding subregion edges and instead propagate obligations. (This should also make it easier to fix the unsoundness in specialization around lifetimes.)

r? @eddyb

7 years agoCleanup formatting.
Jeffrey Seyfried [Thu, 17 Nov 2016 08:16:32 +0000 (08:16 +0000)]
Cleanup formatting.

7 years agoAdd tests.
Jeffrey Seyfried [Sat, 12 Nov 2016 09:38:12 +0000 (09:38 +0000)]
Add tests.

7 years agoAdd feature `use_extern_macros`.
Jeffrey Seyfried [Thu, 10 Nov 2016 10:29:36 +0000 (10:29 +0000)]
Add feature `use_extern_macros`.

7 years agoRefactor out `PerNS`.
Jeffrey Seyfried [Thu, 10 Nov 2016 06:19:54 +0000 (06:19 +0000)]
Refactor out `PerNS`.

7 years agoAdd field `expansion: Mark` to `NameBinding`.
Jeffrey Seyfried [Mon, 7 Nov 2016 22:23:26 +0000 (22:23 +0000)]
Add field `expansion: Mark` to `NameBinding`.

7 years agoRefactor `Resolver::builtin_macros` to use `NameBinding`s instead of `DefId`s.
Jeffrey Seyfried [Mon, 7 Nov 2016 22:08:26 +0000 (22:08 +0000)]
Refactor `Resolver::builtin_macros` to use `NameBinding`s instead of `DefId`s.

7 years agoResolve imports during expansion.
Jeffrey Seyfried [Thu, 10 Nov 2016 10:11:25 +0000 (10:11 +0000)]
Resolve imports during expansion.

7 years agoAdd field `module.unresolved_invocations`.
Jeffrey Seyfried [Fri, 11 Nov 2016 10:51:15 +0000 (10:51 +0000)]
Add field `module.unresolved_invocations`.

7 years agorustbuild: allow dynamically linking LLVM
Josh Stone [Thu, 17 Nov 2016 07:28:14 +0000 (23:28 -0800)]
rustbuild: allow dynamically linking LLVM

The makefiles and `mklldeps.py` called `llvm-config --shared-mode` to
find out if LLVM defaulted to shared or static libraries, and just went
with that.  But under rustbuild, `librustc_llvm/build.rs` was assuming
that LLVM should be static, and even forcing `--link-static` for 3.9+.

Now that build script also uses `--shared-mode` to learn the default,
which should work better for pre-3.9 configured for dynamic linking, as
it wasn't possible back then to choose differently via `llvm-config`.

Further, the configure script now has a new `--enable-llvm-link-shared`
option, which allows one to manually override `--link-shared` on 3.9+
instead of forcing static.

7 years agodoc: nits and typos on comments
Tshepang Lekhonkhobe [Thu, 17 Nov 2016 06:32:04 +0000 (08:32 +0200)]
doc: nits and typos on comments

7 years agoImproved error reporting when target sysroot is missing.
Robert Vally [Thu, 17 Nov 2016 05:59:28 +0000 (13:59 +0800)]
Improved error reporting when target sysroot is missing.

7 years agoAuto merge of #37607 - dns2utf8:doc_grammar, r=alexcrichton
bors [Thu, 17 Nov 2016 05:02:55 +0000 (21:02 -0800)]
Auto merge of #37607 - dns2utf8:doc_grammar, r=alexcrichton

Fix grammar verification

 * Use make check-lexer to verify the grammar.
 * Extend grammar/README
 * Add make clean-grammar rule
 * Add target check-build-lexer-verifier to make tidy, so it will build the verifier with every build and catch future errors

This is the continuation of #34994

r? @steveklabnik @jonathandturner @alexcrichton

7 years agoUse span of first unexpected lifetime in E0088.
Omer Sheikh [Thu, 17 Nov 2016 01:56:57 +0000 (20:56 -0500)]
Use span of first unexpected lifetime in E0088.

7 years agoAuto merge of #37375 - GuillaumeGomez:cast_message, r=arielb1
bors [Thu, 17 Nov 2016 00:30:27 +0000 (16:30 -0800)]
Auto merge of #37375 - GuillaumeGomez:cast_message, r=arielb1

Improve reference cast help message

Fixes #37338.

7 years agoRevert "Bump the bootstrap cargo to match the one paired with 1.13"
Brian Anderson [Thu, 17 Nov 2016 00:11:10 +0000 (00:11 +0000)]
Revert "Bump the bootstrap cargo to match the one paired with 1.13"

This reverts commit 5ad235c8c0416ebab0b80e4750b84c061ef6cc6b.

7 years agoMerge pull request #37635 from brson/bootstrap
Brian Anderson [Thu, 17 Nov 2016 00:08:41 +0000 (16:08 -0800)]
Merge pull request #37635 from brson/bootstrap

Bump the bootstrap cargo to match the one paired with 1.13

7 years agofix `extern "aapcs" fn`
Jorge Aparicio [Wed, 16 Nov 2016 22:33:23 +0000 (17:33 -0500)]
fix `extern "aapcs" fn`

to actually use the AAPCS calling convention

closes #37810

This is technically a [breaking-change] because it changes the ABI of
`extern "aapcs"` functions that (a) involve `f32`/`f64` arguments/return
values and (b) are compiled for arm-eabihf targets from
"aapcs-vfp" (wrong) to "aapcs" (correct).

Appendix:

What these ABIs mean?

- In the "aapcs-vfp" ABI or "hard float" calling convention: Floating
point values are passed/returned through FPU registers (s0, s1, d0, etc.)

- Whereas, in the "aapcs" ABI or "soft float" calling convention:
Floating point values are passed/returned through general purpose
registers (r0, r1, etc.)

Mixing these ABIs can cause problems if the caller assumes that the
routine is using one of these ABIs but it's actually using the other
one.