Commit Graph

67884 Commits

Author SHA1 Message Date
bors
5dfc84cfa7 Auto merge of #44480 - Zoxc:gen-liveness, r=arielb1
Analyse storage liveness and preserve it during generator transformation

This uses a dataflow analysis on `StorageLive` and `StorageDead` statements to infer where the storage of locals are live. The result of this analysis is intersected with the regular liveness analysis such that a local is can only be live when its storage is. This fixes https://github.com/rust-lang/rust/issues/44184. If the storage of a local is live across a suspension point, we'll insert a `StorageLive` statement for it after the suspension point so storage liveness is preserved. This fixes https://github.com/rust-lang/rust/issues/44179.

r? @arielb1
2017-09-14 12:28:31 +00:00
Gauri Kholkar
52294434b0 Delete fn.rs
Removing unwanted file merged in  a previous commit
2017-09-14 17:36:57 +05:30
bors
2b6bc588ca Auto merge of #44526 - leodasvacas:remove-deprecated-lang-items, r=arielb1
Remove deprecated lang items

They have been deprecated for years and there is no trace left of them in the compiler. Also removed `require_owned_box` which is dead code and other small refactorings.
2017-09-14 09:18:28 +00:00
Eduard-Mihai Burtescu
06478d12ac rustdoc: pretty-print Unevaluated expressions in types. 2017-09-14 09:45:07 +03:00
gaurikholkar
9240454a3f add ui tests for EBR 2017-09-14 10:27:41 +05:30
Nick Cameron
39c9a3d796 Attempt to fix the component manifest problem for rls-preview
cc #44270
2017-09-14 16:36:29 +12:00
gaurikholkar
696a268822 fix depth for structs 2017-09-14 10:01:12 +05:30
gaurikholkar
f8df89a5cb adding ui tests 2017-09-14 09:56:44 +05:30
gaurikholkar
d3c2386434 extend E0623 for earlybound and latebound for structs 2017-09-14 09:56:44 +05:30
bors
84bbd14e3f Auto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichton
Add the libstd-modifications needed for the L4Re target

This commit adds the needed modifications to compile the std crate for the L4 Runtime environment (L4Re).

A target for the L4Re was introduced in commit: c151220a84

In many aspects implementations for linux also apply for the L4Re microkernel.

Some uncommon characteristics had to be resolved:
 * L4Re has no network funktionality
 * L4Re has a maximum stacksize of 1Mb for threads
 * L4Re has no uid or gid

Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
2017-09-14 03:02:58 +00:00
Douglas Campos
d3bbce79d0 bring TyCtxt into scope 2017-09-13 23:00:17 -04:00
Tamir Duberstein
49492cb861
Update compiler-builtins
Picks up the removal of the rustbuild feature, which is still used
in our local shim, along with a comment update explaining the usage.
2017-09-13 22:55:46 -04:00
Tamir Duberstein
313b8f803e
Use double quotes to appease some TOML parsers 2017-09-13 22:55:18 -04:00
Corey Farwell
2d292cff5d Remove unneeded loop. 2017-09-13 22:44:14 -04:00
bors
d1ca653b17 Auto merge of #44484 - tirr-c:issue-44332, r=petrochenkov
Parse nested closure with two consecutive parameter lists properly

This is a followup of #44332.

---

Currently, in nightly, this does not compile:

```rust
fn main() {
    let f = |_||x, y| x+y;
    println!("{}", f(())(1, 2)); // should print 3
}
```

`|_||x, y| x+y` should be parsed as `|_| (|x, y| x+y)`, but the parser didn't accept `||` between `_` and `x`. This patch fixes the problem.

r? @petrochenkov
2017-09-14 00:28:27 +00:00
Douglas Campos
916ccc58ac remove overzealous Box<ZeroSizeType> optimization 2017-09-13 17:48:33 -04:00
Alex Burka
5f43357782 update "since" for discriminant_value
It's going to be backported to beta.
2017-09-13 17:29:55 -04:00
John Kåre Alsaker
0e8e6592f6 Fix a bug where StorageIgnored had an incorrect buffer length 2017-09-13 23:28:11 +02:00
John Kåre Alsaker
a2b3e0889f Fix nits and refactor creation of StorageLive blocks 2017-09-13 23:28:11 +02:00
John Kåre Alsaker
d97a7d2594 Make sure we aren't using dead locals 2017-09-13 23:28:11 +02:00
John Kåre Alsaker
efc7d46188 Analyse storage liveness and preserve it during generator transformation 2017-09-13 23:28:10 +02:00
bors
94211416bc Auto merge of #44516 - gaurikholkar:fns, r=arielb1
Extend E0623 for fn items

This fixes #44516
The below example now gives
```
error[E0623]: lifetime mismatch
 --> gg.rs:3:10
  |
2 | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
  |                               ---      --- these two types are declared with different lifetimes...
3 |   y.push(z);
  |          ^ ...but data from `z` flows into `y` here

error: aborting due to previous error
```

r? @nikomatsakis
cc @arielb1
2017-09-13 21:20:19 +00:00
oyvindln
e89748e54f Remove the other period and start with lowercase for more consistency 2017-09-13 22:50:47 +02:00
oyvindln
edf1622bb4 Add proper help line for inline threshold
Also remove a period on a different help line for consistency
2017-09-13 20:11:02 +02:00
leonardo.yvens
9218e44434 Fix initial review 2017-09-13 14:21:16 -03:00
gaurikholkar
e71eef1775 fix ui tests 2017-09-13 20:56:27 +05:30
leonardo.yvens
c2fb70be6b Refactor fn_trait_kind
Short and sweet
2017-09-13 12:19:37 -03:00
Alex Burka
a12d0d4f66 honor #[rustc_const_unstable] attributes 2017-09-13 15:07:17 +00:00
leonardo.yvens
ab30b6a6ed Refactor how to get a lang item's name
Small refactorings
2017-09-13 12:00:40 -03:00
Alex Crichton
5cad391631 rustc: Spawn cmd /c emcc.bat explicitly
In #42436 the behavior for spawning processes on Windows was tweaked slightly to
fix various bugs, but this caused #42791 as a regression, namely that to spawn
batch scripts they need to be manually spawned with `cmd /c` instead now. This
updates the compiler to handle this case explicitly for Emscripten.

Closes #42791
2017-09-13 07:41:58 -07:00
leonardo.yvens
74107f987b Remove require_owned_box
It's unused and unnecessary
2017-09-13 11:16:45 -03:00
bors
539f2083de Auto merge of #44129 - pnkfelix:fix-end-region-emission-order, r=nmatsakis
Fix end region emission order

Fix #43481
2017-09-13 13:01:42 +00:00
Guillaume Gomez
c4044ee39a Add note for append method in OpenOptions docs 2017-09-13 14:47:50 +02:00
Guillaume Gomez
ccd4689ca3 Add missing urls for OpenOptions docs 2017-09-13 14:46:15 +02:00
Havvy
9dd2ee1942 Fix example in transmute; add safety requirement to Vec::from_raw_parts 2017-09-13 04:27:40 -07:00
Felix S. Klock II
5fa0b661e0 Test case illustrating some destruction code extent stuff. 2017-09-13 12:55:03 +02:00
Felix S. Klock II
88080bd56a Unit test for proper EndRegion emission on a cyclic reference. 2017-09-13 12:55:03 +02:00
Felix S. Klock II
ab46142bd9 Update mir-opt tests to reflect change to EndRegion emission order.
Driveby fix to end_region_9.rs; it was missing END marker and was
therefore always passing (regardless of output correctness).
2017-09-13 12:55:03 +02:00
Felix S. Klock II
25aa86da17 Fix issue #43481: emit the EndRegion *before* StorageDeads for a scope.
(The idea is that the StorageDead marks the point where the memory can
be deallocated, and the EndRegion is marking where borrows of that
memory can no longer legally exist.)
2017-09-13 12:55:03 +02:00
bors
824952f48b Auto merge of #44386 - est31:master, r=pnkfelix
Fix mispositioned error indicators

Fixes #38384

Most of the Rust community uses 4 spaces for indentation,
but there are also tab users of Rust (including myself!).

This patch fixes a bug in error printing which mispositions
error indicators when near code with tabs.

The code attempted to fix the issue by replacing spaces
with tabs, but it sadly wasn't enough, as sometimes
you may not print spaces but _ or ^ instead.

This patch employs the reverse strategy: it replaces each
tab with a space, so that the number of _ and ^ and spaces
in error indicators below the code snippet line up
perfectly.

In a study [1] preceeding this patch, we could see that
this strategy is also chosen by gcc version 6.3.0.

Its not perfect, as the output is not beautiful, but its
the easiest to implement. If anyone wants to improve on
this, be my guest! This patch is meant as improvement of
the status quo, not as perfect end status. It fixes the
actual issue of mispositioning error indicators.

[1]: https://github.com/rust-lang/rust/issues/38384#issuecomment-326813710
2017-09-13 10:28:33 +00:00
Tobias Schaffner
b2b5063517 Move default stack min size to thread implementations
The default min stack size value is smaller on l4re and therefore
this value has to be different depending on the platform.
2017-09-13 10:56:41 +02:00
David Adler
518bd30854 Fix drain_filter doctest. 2017-09-12 22:47:45 -07:00
bors
c3eccc694c Auto merge of #44420 - alexcrichton:private-cstore, r=michaelwoerister
rustc: Make `CrateStore` private to `TyCtxt`

This commit makes the `CrateStore` object private to the `ty/context.rs` module and also absent on the `Session` itself.

cc #44390
cc #44341 (initial commit pulled and rebased from here)
2017-09-13 05:32:00 +00:00
Nick Cameron
368cab3b03 Reviewer changes 2017-09-13 16:48:53 +12:00
Nick Cameron
d0070e85db Build and test Rustfmt 2017-09-13 16:18:45 +12:00
Nick Cameron
c4508e1226 Add rustfmt as a submodule 2017-09-13 16:18:44 +12:00
Alex Crichton
921750b8ac rustc: Make CrateStore private to TyCtxt
This commit removes the `cstore_untracked` method, making the `CrateStore` trait
object entirely private to the `ty/context.rs` module.
2017-09-12 21:14:06 -07:00
bors
7eefed392f Auto merge of #44456 - eddyb:stable-drop-const, r=nikomatsakis
Stabilize drop_types_in_const.

Closes #33156, stabilizing the new, revised, rules, and improving the error message.

r? @nikomatsakis cc @SergioBenitez
2017-09-13 03:04:49 +00:00
Ethan Dagner
8adf50d90e Remove Invalid UTF-8 from str::from_utf8_unchecked_mut 2017-09-12 17:30:44 -06:00
QuietMisdreavus
81ebab6fca bump gcc for bootstrap
On Windows, the gcc crate would send /Wall to msvc, which would cause
builds to get flooded with warnings, exploding compile times from one
hour to more than 72! The gcc crate version 0.3.54 changes this behavior
to send /W4 instead, which greatly cuts down on cl.exe flooding the
command prompt window with warnings.
2017-09-12 18:09:26 -05:00