Commit Graph

66396 Commits

Author SHA1 Message Date
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
John Kåre Alsaker
8bcafc5e17 Fix hash impl for SimplifiedType 2017-07-28 15:46:24 +02:00
Alex Crichton
5d174f0035 Clarifying documentation for generator 2017-07-28 15:46:24 +02:00
John Kåre Alsaker
e62d9d5230 Fix tests 2017-07-28 15:46:24 +02:00
John Kåre Alsaker
a88e7506a6 Fix whitespace 2017-07-28 15:46:24 +02:00
John Kåre Alsaker
2afd04c009 Add some comments 2017-07-28 15:46:24 +02:00
John Kåre Alsaker
8cd0595602 Use FIXME instead of TODO 2017-07-28 15:46:24 +02:00
John Kåre Alsaker
df608e710c Rename suspend to yield 2017-07-28 15:46:24 +02:00
John Kåre Alsaker
66fc6dfbb6 Update error codes 2017-07-28 15:46:24 +02:00
John Kåre Alsaker
057b0adf47 Don't print gen in HIR 2017-07-28 15:46:23 +02:00
John Kåre Alsaker
075fd364d0 Ensure upvars are dropped when generators have never been resumed 2017-07-28 15:46:23 +02:00
Alex Crichton
facabcb85e Fill in generator tracking issue in a few more locations 2017-07-28 15:46:23 +02:00
Alex Crichton
55bb1c08d3 Add documentation for generators 2017-07-28 15:46:23 +02:00
John Kåre Alsaker
bc9b4deeb5 Make yield and gen arg outside generator literals an error and update tests 2017-07-28 15:46:23 +02:00
Alex Crichton
5efb0cbe04 Add some generator pass/fail tests 2017-07-28 15:46:23 +02:00
Alex Crichton
51bb31ad25 Fix tests 2017-07-28 15:46:23 +02:00
John Kåre Alsaker
cc40f58b8b Added some tests 2017-07-28 15:46:23 +02:00
John Kåre Alsaker
0b5b0122ae Consider all implementations of Generator, not just built in ones 2017-07-28 15:46:23 +02:00
John Kåre Alsaker
b5449b73e6 Ban explicit arguments on generators 2017-07-28 15:46:23 +02:00
Alex Crichton
81030176dd std: Add forwarding impls of Generator trait 2017-07-28 15:46:23 +02:00
Alex Crichton
17c749f3ee Fix tidy warnings 2017-07-28 15:46:23 +02:00
John Kåre Alsaker
d861982ca6 Generator literal support 2017-07-28 15:46:23 +02:00
bors
e2b5d7e6b3 Auto merge of #43324 - Nashenas88:visit_locations, r=arielb1
Provide positional information when visiting ty, substs and closure_substs in MIR

This will enable the region renumbering portion of #43234 (non-lexical lifetimes). @nikomatsakis's current plan [here](https://gist.github.com/nikomatsakis/dfc27b28cd024eb25054b52bb11082f2) shows that we need spans of the original code to create new region variables, e.g. `self.infcx.next_region_var(infer::MiscVariable(span))`. The current visitor impls did not pass positional information (`Location` in some, `Span` and `SourceInfo` for others) for all types. I did not expand this to all visits, just the ones necessary for the above-mentioned plan.
2017-07-28 12:55:12 +00:00
bors
6f815ca771 Auto merge of #43221 - MaulingMonkey:natvis-improvements, r=michaelwoerister
Embed MSVC .natvis files into .pdbs and mangle debuginfo for &str, *T, and [T].

No idea if these changes are reasonable - please feel free to suggest changes/rewrites.  And these are some of my first real commits to any rust codebase - *don't* be gentle, and nitpick away, I need to learn! ;)

### Overview
Embedding `.natvis` files into `.pdb`s allows MSVC (and potentially other debuggers) to automatically pick up the visualizers without having to do any additional configuration (other than to perhaps add the relevant .pdb paths to symbol search paths.)

The native debug engine for MSVC parses the type names, making various C++ish assumptions about what they mean and adding various limitations to valid type names.  `&str` cannot be matched against a visualizer, but if we emit `str&` instead, it'll be recognized as a reference to a `str`, solving the problem.  `[T]` is similarly problematic, but emitting `slice<T>` instead works fine as it looks like a template.  I've been unable to get e.g. `slice<u32>&` to match visualizers in VS2015u3, so I've gone with `str*` and `slice<u32>*` instead.

### Possible Issues
* I'm not sure if `slice<T>` is a great mangling for `[T]` or if I should worry about name collisions.
* I'm not sure if `linker.rs` is the right place to be enumerating natvis files.
* I'm not sure if these type name mangling changes should actually be MSVC specific.  I recall seeing gdb visualizer tests that might be broken if made more general?  I'm hesitant to mess with them without a gdb install.  But perhaps I'm just wracking up technical debt.
  Should I try `pacman -S mingw-w64-x86_64-gdb` and to make things consistent?
* I haven't touched `const` / `mut` yet, and I'm worried MSVC might trip up on `mut` or their placement.
* I may like terse oneliners too much.
* I don't know if there's broader implications for messing with debug type names here.
* I may have been mistaken about bellow test failures being ignorable / unrelated to this changelist.

### Test Failures on `x86_64-pc-windows-gnu`

```
---- [debuginfo-gdb] debuginfo-gdb\associated-types.rs stdout ----
        thread '[debuginfo-gdb] debuginfo-gdb\associated-types.rs' panicked at 'gdb not available but debuginfo gdb debuginfo test requested', src\tools\compiletest\src\runtest.rs:48:16
note: Run with `RUST_BACKTRACE=1` for a backtrace.

[...identical panic causes omitted...]

---- [debuginfo-gdb] debuginfo-gdb\vec.rs stdout ----
        thread '[debuginfo-gdb] debuginfo-gdb\vec.rs' panicked at 'gdb not available but debuginfo gdb debuginfo test requested', src\tools\compiletest\src\runtest.rs:48:16
```

### Relevant Issues
* https://github.com/rust-lang/rust/issues/40460 Metaissue for Visual Studio debugging Rust
* https://github.com/rust-lang/rust/issues/36503 Investigate natvis for improved msvc debugging
* https://github.com/PistonDevelopers/VisualRust/issues/160 Debug visualization of Rust data structures

### Pretty Pictures
![Collapsed Watch Window](https://user-images.githubusercontent.com/75894/28180998-e44c7516-67bb-11e7-8b48-d4f9605973ae.png)
![Expanded Watch Window](https://user-images.githubusercontent.com/75894/28181000-e8da252e-67bb-11e7-96b8-d613310c04dc.png)
2017-07-28 10:25:58 +00:00
bors
7167843748 Auto merge of #43505 - eddyb:poly-const-eval-layout-of, r=nikomatsakis
rustc_const_eval: always require Substs and a ParamEnv.

Fixes #43357 by tracking the `Substs` and `ParamEnv` for const-evaluation in generic contexts.
2017-07-28 08:01:02 +00:00
bors
4d5150ce19 Auto merge of #43238 - estebank:try-on-unimplemented-2, r=alexcrichton
Use `rustc_on_unimplemented`'s trait name argument in `try`

Follow up to #43000 and #43001. Fix #42694.
2017-07-28 05:39:41 +00:00
Nick Cameron
bbc00c9e9c format!: use a dummy span rather than callee span for the span base for temporary variables 2017-07-28 16:42:39 +12:00
Nick Cameron
e1206c4b67 save-anlaysis: fix filter_generated 2017-07-28 16:42:17 +12:00
Josh Stone
efc67646fa Support homogeneous aggregates for hard-float ARM
Hard-float ARM targets use the AACPS-VFP ABI, which passes and returns
homogeneous float/vector aggregates in the VFP registers.

Fixes #43329.
2017-07-27 20:40:24 -07:00
gaurikholkar
4fb1808ab6 Adding E0623, to detect missing lifetimes when both regions are anonymous 2017-07-28 08:51:58 +05:30
bors
a9a07078ba Auto merge of #43432 - pczarn:macro-parser-description, r=jseyfried
Make the macro parser theory description more accurate

The macro parser is described as an NFA, not an Earley parser.
2017-07-28 03:16:14 +00:00
Esteban Küber
4f7834e32c Use rustc_on_unimplemented's trait name argument in try 2017-07-27 19:18:22 -07:00
bors
63b3a03dc8 Auto merge of #43217 - pnkfelix:alloc-requires-align-it-in-u32, r=alexcrichton
Add precondition to `Layout` that the `align` fit in a u32.

Add precondition to `Layout` that the `align` not exceed 2^31.

This precondition takes the form of a behavorial change in `Layout::from_size_align` (so it returns `None` if the input `align` is too large) and a new requirement for safe usage of `Layout::from_size_align_unchecked`.

Fix #30170.
2017-07-28 00:49:39 +00:00
Paul Faria
4b9acad7c6 Squash Span into SourceInfo and rename enum and its inner types 2017-07-27 19:43:05 -04:00
bors
8a78a12a55 Auto merge of #43438 - petrochenkov:path, r=jseyfried
syntax: Simplify parsing of paths

Discern between `Path` and `Path<>` in AST (but not in HIR).
Give span to angle bracketed generic arguments (`::<'a, T>` in `path::segment::<'a, T>`).

This is a refactoring in preparation for https://internals.rust-lang.org/t/macro-path-uses-novel-syntax/5561/3, but it doesn't add anything to the grammar yet.

r? @jseyfried
2017-07-27 22:22:01 +00:00