Commit Graph

66396 Commits

Author SHA1 Message Date
QuietMisdreavus
612081a78d print associated types in traits "implementors" section 2017-07-29 09:21:48 -05:00
Guillaume Gomez
5636d325ed Update cargo version 2017-07-29 15:11:31 +02:00
bors
ad36f8feba Auto merge of #43534 - alexcrichton:cargo-target-runner, r=Mark-Simulacrum
rustbuild: Use Cargo's "target runner"

This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the `target.$target.runner` configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.
2017-07-29 12:30:12 +00:00
gaurikholkar
cb93cc6299 changing E0623 error message 2017-07-29 17:40:16 +05:30
bors
91aff5775d Auto merge of #43530 - alexcrichton:update-freebsd-compilers, r=Mark-Simulacrum,cuviper
rustbuild: Update cross-compilers for FreeBSD

When working through bugs for the LLVM 5.0 upgrade it looks like the FreeBSD
cross compilers we're currently using are unable to build LLVM, failing with
references to the function `std::to_string` claiming it doesn't exist. I don't
actually know what this function is, but assuming that it was added in a more
recent version of a C++ standard I've updated the gcc versions for the
toolchains we're using. This made the error go away!
2017-07-29 08:48:57 +00:00
bors
8d0ad26b95 Auto merge of #43527 - alexcrichton:different-llvm-cross, r=Mark-Simulacrum
rustbuild: Tweak how we cross-compile LLVM

In preparation for upgrading to LLVM 5.0 it looks like we need to tweak how we
cross compile LLVM slightly. It's using `CMAKE_SYSTEM_NAME` to infer whether to
build libFuzzer which only works on some platforms, and then once we configure
that it needs to apparently reach into the host build area to try to compile
`llvm-config` as well. Once these are both configured, though, it looks like we
can successfully cross-compile LLVM.
2017-07-29 06:13:55 +00:00
bors
6dd8744a11 Auto merge of #43492 - lu-zero:master, r=alexcrichton
More Altivec Intrinsics
2017-07-29 03:58:18 +00:00
bors
42a09c01f0 Auto merge of #43518 - cuviper:aapcs_vfp, r=eddyb
Support homogeneous aggregates for hard-float ARM

Hard-float ARM targets use the AAPCS-VFP ABI, which passes and returns
homogeneous float/vector aggregates in the VFP registers.

Fixes #43329.

r? @eddyb
2017-07-29 01:43:03 +00:00
Alex Crichton
8e7849e766 rustbuild: Use Cargo's "target runner"
This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the `target.$target.runner` configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.
2017-07-28 18:00:31 -07:00
Alex Crichton
122fd188ae rustbuild: Update cross-compilers for FreeBSD
When working through bugs for the LLVM 5.0 upgrade it looks like the FreeBSD
cross compilers we're currently using are unable to build LLVM, failing with
references to the function `std::to_string` claiming it doesn't exist. I don't
actually know what this function is, but assuming that it was added in a more
recent version of a C++ standard I've updated the gcc versions for the
toolchains we're using. This made the error go away!
2017-07-28 14:26:27 -07:00
Alex Crichton
9285a61413 Remove IsGenerator in favor of a boolean
No need to be mixed!
2017-07-28 13:24:28 -07:00
Alex Crichton
06ce77cb39 Merge remote-tracking branch 'origin/master' into gen 2017-07-28 13:07:15 -07:00
Alex Crichton
069a1b3c8f rustbuild: Tweak how we cross-compile LLVM
In preparation for upgrading to LLVM 5.0 it looks like we need to tweak how we
cross compile LLVM slightly. It's using `CMAKE_SYSTEM_NAME` to infer whether to
build libFuzzer which only works on some platforms, and then once we configure
that it needs to apparently reach into the host build area to try to compile
`llvm-config` as well. Once these are both configured, though, it looks like we
can successfully cross-compile LLVM.
2017-07-28 12:20:47 -07:00
bors
126321e2e5 Auto merge of #43230 - alexcrichton:more-tokenstream, r=nrc,jseyfried
Implement tokenization for some items in proc_macro

This PR is a partial implementation of https://github.com/rust-lang/rust/issues/43081 targeted towards preserving span information in attribute-like procedural macros. Currently all attribute-like macros will lose span information with the input token stream if it's iterated over due to the inability of the compiler to losslessly tokenize an AST node. This PR takes a strategy of saving off a list of tokens in particular AST nodes to return a lossless tokenized version. There's a few limitations with this PR, however, so the old fallback remains in place.
2017-07-28 18:31:52 +00:00
Alex Crichton
4886ec8665 syntax: Capture a TokenStream when parsing items
This is then later used by `proc_macro` to generate a new
`proc_macro::TokenTree` which preserves span information. Unfortunately this
isn't a bullet-proof approach as it doesn't handle the case when there's still
other attributes on the item, especially inner attributes.

Despite this the intention here is to solve the primary use case for procedural
attributes, attached to functions as outer attributes, likely bare. In this
situation we should be able to now yield a lossless stream of tokens to preserve
span information.
2017-07-28 10:47:01 -07:00
bors
eba9d7f08c Auto merge of #43298 - gaurikholkar:lifetime_errors, r=estebank
improve case with both anonymous lifetime parameters #43269

This is a fix to #43269.

Sample output message-

```

error[E0623]: lifetime mismatch
  --> $DIR/ex3-both-anon-regions.rs:12:12
   |
11 | fn foo(x: &mut Vec<&u8>, y: &u8) {
   |                    ---      --- these references must have the same lifetime
12 |     x.push(y);
   |            ^ data from `y` flows into `x` here

error: aborting due to 2 previous errors

```
r? @nikomatsakis
2017-07-28 16:03:32 +00:00
topecongiro
6375b77ebb Add Span to ast::WhereClause 2017-07-29 00:43:35 +09:00
Alex Crichton
036300aadd Add a failing test for errors in proc macros
This test currently fails because the tokenization of an AST item during the
expansion of a procedural macro attribute rounds-trips through strings, losing
span information.
2017-07-28 07:58:20 -07:00
Alex Crichton
36f2816a1e proc_macro: Use an item's tokens if available
This partly resolves the `FIXME` located in `src/libproc_macro/lib.rs` when
interpreting interpolated tokens. All instances of `ast::Item` which have a list
of tokens attached to them now use that list of tokens to losslessly get
converted into a `TokenTree` instead of going through stringification and losing
span information.

cc #43081
2017-07-28 07:58:20 -07:00
Alex Crichton
9b2f7624ec syntax: Add tokens: Option<TokenStream> to Item
This commit adds a new field to the `Item` AST node in libsyntax to optionally
contain the original token stream that the item itself was parsed from. This is
currently `None` everywhere but is intended for use later with procedural
macros.
2017-07-28 07:58:20 -07:00
Luca Barbato
c4710203c0 Make LLVMRustHasFeature more robust
The function should accept feature strings that old LLVM might not
support.

Simplify the code using the same approach used by
LLVMRustPrintTargetFeatures.

Dummify the function for non 4.0 LLVM and update the tests accordingly.
2017-07-28 14:30:06 +00:00
John Kåre Alsaker
416096d0fd Update comment 2017-07-28 15:47:55 +02:00
Alex Crichton
ff996853fe Fix more tests with GeneratorState rename 2017-07-28 15:47:55 +02:00
John Kåre Alsaker
be0a9b8958 Fix tests 2017-07-28 15:47:55 +02:00
John Kåre Alsaker
ae1856cb9e Update rename State in docs 2017-07-28 15:47:55 +02:00
John Kåre Alsaker
93b9b1a2b1 Fix tests 2017-07-28 15:47:55 +02:00
John Kåre Alsaker
9556faca68 Fix error message string 2017-07-28 15:47:55 +02:00
John Kåre Alsaker
0f8897cc35 Fix error code 2017-07-28 15:47:55 +02:00
John Kåre Alsaker
9a6a8668ae Remove visit_body from YieldFinder 2017-07-28 15:47:14 +02:00
John Kåre Alsaker
5da9a8aa19 Rename some variables in lowering.rs and add an error number for the error 2017-07-28 15:47:14 +02:00
John Kåre Alsaker
df0496a620 Rename State to GeneratorState 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
62e210fb3c Derive traits for State. 2017-07-28 15:46:27 +02:00
Niko Matsakis
39478e8ab1 update references due to removing tabs 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
d32428bc5f Remove tabs 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
b2d931abbb Fix error message tests again 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
6106f6c5c1 Fix error message tests 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
0a8b81a568 Ignore drop check bools when testing for legal generator types 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
4628f8534f Fix error message tests 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
f5ec50358a Fix tidy errors 2017-07-28 15:46:27 +02:00
Niko Matsakis
3fdc3fa1ec change how we report err_out_of_scope borrowck errors
Also, remove the explicit code detecting borrows over a yield.  It
turns out not to be necessary -- any such borrow winds up with a
lifetime that is part of the generator type, and therefore which will
outlive the generator expression itself, which yields an
`err_out_of_scope`. So instead we intercept those errors and display
them in a nicer way.
2017-07-28 15:46:27 +02:00
Niko Matsakis
188cdf499f combine bckerr_to_diag and note_and_explain_bckerr 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
5a6e0694da Remove a FIXME and apply the same hack as closures 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
14c747678e Fix a string literal 2017-07-28 15:46:27 +02:00
John Kåre Alsaker
e4fdbcbc9f Update FIXME 2017-07-28 15:46:26 +02:00
John Kåre Alsaker
b744b1cfe3 Convert to spaces 2017-07-28 15:46:26 +02:00
John Kåre Alsaker
cbdb18650e Add some comments 2017-07-28 15:46:26 +02:00
John Kåre Alsaker
eea290d7fd Convert to spaces 2017-07-28 15:46:26 +02:00
Alex Crichton
09a5d319ab Remove support for gen arg 2017-07-28 15:46:26 +02:00
John Kåre Alsaker
93172045c8 Fix a bug with yielding subtypes of the yield type. 2017-07-28 15:46:25 +02:00
John Kåre Alsaker
dcddd80729 Remove debug code 2017-07-28 15:46:25 +02:00