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
John Kåre Alsaker
a602fc06bd
Revert some whitespace changes
2017-07-28 15:46:25 +02:00
John Kåre Alsaker
10def9a6e0
Revert borrowck changes
2017-07-28 15:46:25 +02:00
John Kåre Alsaker
2ad0f89e86
Tweak docs
2017-07-28 15:46:25 +02:00
Niko Matsakis
d71fa9371c
fix yields-in-args test and add a reverse one
2017-07-28 15:46:25 +02:00
Niko Matsakis
264c3f4952
add some tests of yielding with outstanding borrows
...
No doubt there are more tests one might write, but it's a start.
2017-07-28 15:46:25 +02:00
Alex Crichton
8e82b19c6b
Convert tabs to spaces
2017-07-28 15:46:25 +02:00
Alex Crichton
12bbcd3c29
Add a test case for conditional drop
2017-07-28 15:46:25 +02:00
John Kåre Alsaker
77bf6e4461
Add a test
2017-07-28 15:46:25 +02:00
Alex Crichton
7eae8489fc
Touch up unstable docs for generators
2017-07-28 15:46:25 +02:00
John Kåre Alsaker
6e66dccc44
Remove a FIXME
2017-07-28 15:46:24 +02:00
John Kåre Alsaker
05fcef0b3e
Fix printing
2017-07-28 15:46:24 +02:00
John Kåre Alsaker
21f2d259e0
Consider StorageDead and StorageLive as gens for liveness analysis
2017-07-28 15:46:24 +02:00
John Kåre Alsaker
75eb59895f
Copy a comment
2017-07-28 15:46:24 +02:00
John Kåre Alsaker
098d6f0597
Move a FIXME around
2017-07-28 15:46:24 +02:00
John Kåre Alsaker
66b8a12a6d
Fix upstream changes
2017-07-28 15:46:24 +02:00
John Kåre Alsaker
bfd71c5b70
Fix examples
2017-07-28 15:46:24 +02:00