Commit Graph

66476 Commits

Author SHA1 Message Date
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
Luca Barbato
cbce0aa341 Add support for Vector Minimum on PowerPC 2017-07-27 21:30:31 +00:00
Ariel Ben-Yehuda
e268ddf52d erase types in the move-path abstract domain
Leaving types unerased would lead to 2 types with a different "name"
getting different move-paths, which would cause major brokenness (see
e.g. #42903).

This does not fix any *known* issue, but is required if we want to use
abs_domain with non-erased regions (because the same can easily
have different names). cc @RalfJung.
2017-07-27 23:14:41 +03:00
Vadim Petrochenkov
1e8a7f68e9 Avoid duplicated errors for generic arguments in macro paths 2017-07-27 23:01:17 +03:00
Vadim Petrochenkov
128f565dae Give span to angle bracketed generic arguments 2017-07-27 22:59:35 +03:00
Vadim Petrochenkov
ce3beb609f Discern between Path and Path<> in AST 2017-07-27 22:59:35 +03:00
Vadim Petrochenkov
da77a1a0ac Simplify parsing of paths 2017-07-27 22:59:34 +03:00
bors
52a3309695 Auto merge of #43443 - bitshifter:issue-43317, r=nikomatsakis
Improve checking of conflicting packed and align representation hints on structs and unions.

Fixes #43317 and improves #33626.
2017-07-27 19:48:13 +00:00
Guillaume Gomez
2f2623b79d Update tests 2017-07-27 20:40:20 +02:00
Guillaume Gomez
1cebf98e4c Make a lint instead 2017-07-27 20:38:33 +02:00
Guillaume Gomez
b68a03bded Change doc comment to code comment 2017-07-27 20:38:32 +02:00
Guillaume Gomez
7e70a63e61 Throw errors when doc comments are added where they're unused 2017-07-27 20:38:32 +02:00
QuietMisdreavus
c9bdd518eb add [src] links to associated functions inside an impl block 2017-07-27 13:26:24 -05:00
Eduard-Mihai Burtescu
60cf5428b3 rustc_const_eval: keep track of the appropriate ParamEnv. 2017-07-27 20:59:40 +03:00
bors
5cc1baa290 Auto merge of #43482 - Mark-Simulacrum:single-rustdoc, r=alexcrichton
Compile rustdoc on-demand

Fixes #43284, fixes #38318, and fixes #39505.

Doesn't directly help with https://github.com/rust-lang/rust/issues/42686, since we need to rebuild just as much. In fact, this hurts it, since `./x.py doc --stage 0` will now fail. I'm not sure if it did before, but with these changes it runs into the problem where we attempt to use artifacts from bootstrap rustc with a non-bootstrap rustdoc, running into version conflicts. I believe this is solvable, but leaving for a future PR.

This means that rustdoc will no longer be compiled when compiling rustc, by default. However, it is still built from `./x.py build` (for hosts, but not targets, since we don't produce compiler toolchains for them) and will be built for doc tests and crate tests.

After this, the recommended workflow if you want a rustdoc is: `./x.py build --stage 1 src/tools/rustdoc` which will give you a working rustdoc in `build/triple/stage1/bin/rustdoc`. Note that you can add `src/libstd` onto the command to compile libstd as well so that the rustdoc can easily compile crates in the wild. `./x.py doc --stage 1 src/libstd` will document `libstd` with a freshly built rustdoc (if necessary), and will not rebuild rustc on modifications to rustdoc.

r? @alexcrichton
2017-07-27 17:07:58 +00:00
Luca Barbato
a718c813ed Add support for Vector Maximum on PowerPC 2017-07-27 15:59:12 +00:00
Mark Simulacrum
9ee877bbe6 Correct a few run.host invocations where run.target is intended. 2017-07-27 09:58:03 -06:00
bors
0565653eec Auto merge of #43498 - joshtriplett:fix-notices, r=aturon
Copyright/license headers

(As discussed with @aturon and @est31. CC @rust-lang/core.)

Currently, rust-lang/rust includes notices that say things like
```
The Rust Project is copyright 2010, The Rust Project
Developers.
```
or
```
Copyright (c) 2010 The Rust Project Developers
```
or
```
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
```

These notices aren't accurate. "Copyright YYYY Some Name" has a specific legal meaning, and "The Rust Project Developers" isn't a legal entity. In practice, the actual legal structure is that all Rust contributors retain their copyrights when contributing to Rust, and just license them under MIT/Apache-2.0. Our legal notices should reflect that.

This came up because of RFC 2044, which proposed fixing this for the RFC repository. That effort started out by copying the rust-lang/rust notices, propagating this issue.

Based on discussion with @aturon, the two of us propose the following:

- Delete the per-file notices entirely, for any files licensed under the standard terms. (Keep notices for anything that's *not* MIT/Apache-2.0.)
  - An alternative to that would be to just delete the first paragraph of the standard notice, and keep the second paragraph that points to the MIT and Apache 2.0 licenses.
- Delete the first paragraph of LICENSE-MIT (the inaccurate pseudo-copyright line), leaving only the text of the MIT license.
- Edit the COPYRIGHT file to more accurately describe the situation (changing the pseudo-copyright line immediately under "longer version", and editing the text that starts with "additional copyright may be ...", to just always state that copyrights are retained by the Rust contributors, and licensed under MIT/Apache-2.0 (with the exceptions to that explicitly noted in that file).

If @rust-lang/core is fine with this proposal, I'd be happy to provide a pull request with the proposed fixes.
2017-07-27 14:10:19 +00:00
Luca Barbato
ade5ead38e Add support for the Power8 and Power9 features on PowerPC 2017-07-27 13:30:51 +00:00
Mark Simulacrum
3c43163da7 Explain why we subtract one from the stage 2017-07-27 05:51:23 -06:00
Mark Simulacrum
cb27faf70f Make sure CFG_RELEASE_CHANNEL is always set.
Previously we'd build libsyntax without it when documenting and that'd
cause us to recompile it when building normally for no reason.
2017-07-27 05:51:23 -06:00
Mark Simulacrum
3b90551610 Allow changing rustdoc which builds the book. 2017-07-27 05:51:23 -06:00
Mark Simulacrum
4e5333cb2b Don't needlessly build rustdoc for compiletest.
For most tests, rustdoc isn't needed, so avoid building it.
2017-07-27 05:51:22 -06:00
Mark Simulacrum
e2e9b40e9a Build rustdoc on-demand.
Rustdoc is no longer compiled in every stage, alongside rustc, instead
it is only compiled when requested, and generally only for the last
stage.
2017-07-27 05:51:22 -06:00