Commit graph

92867 commits

Author SHA1 Message Date
Mazdak Farrokhzad
ea178e47b9 Enforce sorting of accepted and removed features. 2019-05-04 03:26:52 +02:00
bors
a3404557c5 Auto merge of #60496 - jethrogb:jb/address-integer-overflow, r=alexcrichton
Fix potential integer overflow in SGX memory range calculation.

Thanks to Eduard Marin and David Oswald at the University of Burmingham, and Jo Van Bulck at KU Leuven for discovering this issue.
2019-05-03 19:42:13 +00:00
bors
3af1bdc4bc Auto merge of #60510 - Centril:rollup-gsndjbp, r=Centril
Rollup of 12 pull requests

Successful merges:

 - #59928 (Make deprecation lint `ambiguous_associated_items` deny-by-default)
 - #60220 (report fatal errors during doctest parsing)
 - #60373 (Tidy: ensure lang features are sorted by since)
 - #60388 (Disallow non-explicit elided lifetimes in async fn)
 - #60393 ( Do not suggest incorrect syntax on pattern type error due to borrow)
 - #60401 (Rename `RUST_LOG` to `RUSTC_LOG`)
 - #60409 (Require a trait in the bounds of existential types)
 - #60455 (Resolve match arm ty when arms diverge)
 - #60457 (Const prop refactoring)
 - #60467 (Avoid repeated interning of static strings.)
 - #60478 (minor compiler doc tweaks)
 - #60501 (Propagate mutability from arguments to local bindings in async fn)

Failed merges:

r? @ghost
2019-05-03 15:10:16 +00:00
Mazdak Farrokhzad
6f7a1eabdf
Rollup merge of #60501 - taiki-e:async-await-mutable-arguments, r=cramertj
Propagate mutability from arguments to local bindings in async fn

Fixes #60498

cc @nikomatsakis
r? @davidtwco
2019-05-03 16:25:09 +02:00
Mazdak Farrokhzad
d5809a8b33
Rollup merge of #60478 - euclio:doc-fixes, r=cramertj
minor compiler doc tweaks
2019-05-03 16:25:08 +02:00
Mazdak Farrokhzad
0784755127
Rollup merge of #60467 - nnethercote:less-symbol-interning, r=davidtwco
Avoid repeated interning of static strings.

`file_metadata_raw` interns the strings `"<unknown>"` and `""` very
frequently. This commit avoids that, which reduces the number of symbols
interned significantly and reduces instruction counts by up to 0.5% on
some workloads.
2019-05-03 16:25:06 +02:00
Mazdak Farrokhzad
3fe5fac96d
Rollup merge of #60457 - wesleywiser:const_prop_refactoring, r=oli-obk
Const prop refactoring

This is rebased on top of #60428 so only the top commit is new.

This is the refactoring to remove the `mir` field from `ConstPropagator` which is necessary before we can begin to actually propagate constants.

r? @oli-obk
2019-05-03 16:25:05 +02:00
Mazdak Farrokhzad
2b5e296caa
Rollup merge of #60455 - estebank:resolve-match-arm-ty, r=davidtwco
Resolve match arm ty when arms diverge

Fix #58695.
2019-05-03 16:25:04 +02:00
Mazdak Farrokhzad
f6228615bd
Rollup merge of #60409 - JohnTitor:error-for-existential-type, r=oli-obk
Require a trait in the bounds of existential types

Fixes #53090

r? @oli-obk
2019-05-03 16:25:02 +02:00
Mazdak Farrokhzad
bfa22cfbca
Rollup merge of #60401 - JohnTitor:rename-log, r=davidtwco
Rename `RUST_LOG` to `RUSTC_LOG`

cc: #57985

I think we should also change these submodules:

- rustc-guide
- Cargo (rename to `CARGO_LOG`, cc: https://github.com/rust-lang/cargo/pull/6605, https://github.com/rust-lang/cargo/issues/6189)
- miri
- rls
- rustfmt

r? @davidtwco
2019-05-03 16:25:00 +02:00
Mazdak Farrokhzad
3e536e8ac6
Rollup merge of #60393 - estebank:pat-sugg, r=oli-obk
Do not suggest incorrect syntax on pattern type error due to borrow

Fix #55174.
2019-05-03 16:24:59 +02:00
Mazdak Farrokhzad
3ca0d36538
Rollup merge of #60388 - cramertj:elided-lifetime-async, r=nikomatsakis
Disallow non-explicit elided lifetimes in async fn

Fix https://github.com/rust-lang/rust/issues/60203

r? @nikomatsakis
2019-05-03 16:24:57 +02:00
Mazdak Farrokhzad
9199bb5f81
Rollup merge of #60373 - rasendubi:lang-features-sort-since, r=Centril
Tidy: ensure lang features are sorted by since

This is the tidy side of https://github.com/rust-lang/rust/issues/60361.

What is left is actually splitting features into groups and sorting by since.

This PR also likely to produce a small (a couple of lines) merge conflict with https://github.com/rust-lang/rust/pull/60362.

r? @Centril
2019-05-03 16:24:56 +02:00
Mazdak Farrokhzad
06e1d88de6
Rollup merge of #60220 - euclio:rustdoc-test-fatal-parsing-errors, r=QuietMisdreavus
report fatal errors during doctest parsing

Fixes #59557.
2019-05-03 16:24:54 +02:00
Mazdak Farrokhzad
e9509f8847
Rollup merge of #59928 - petrochenkov:denyambass, r=varkor
Make deprecation lint `ambiguous_associated_items` deny-by-default

As requested by r? @Centril

cc https://github.com/rust-lang/rust/issues/57644
2019-05-03 16:24:52 +02:00
bors
ef9a876f82 Auto merge of #60423 - varkor:update-getopts, r=alexcrichton
Update getopts

This is a prerequisite to fixing https://github.com/rust-lang/rust/issues/32352. The rustbuild fix has been pulled out of https://github.com/rust-lang/rust/pull/59440.

r? @alexcrichton
2019-05-03 10:15:48 +00:00
bors
1891bfa803 Auto merge of #59883 - ebarnard:clonefile, r=sfackler
Make `std::fs::copy` attempt to create copy-on-write clones of files on MacOS

The behaviour of MacOS now matches Linux which uses `copy_file_range` to perform CoW file copies where available and supported by the underlying filesystem.
2019-05-03 07:26:46 +00:00
Taiki Endo
2fe50bc01b Propagate mutability from arguments to local bindings in async fn 2019-05-03 13:04:26 +09:00
Jethro Beekman
1dc4a38b0e Fix potential integer overflow in SGX memory range calculation.
Thanks to Eduard Marin and David Oswald at the University of Burmingham,
and Jo Van Bulck at KU Leuven for discovering this issue.
2019-05-02 18:15:44 -07:00
varkor
e72f7e1e56 Update getopts to 0.2.18
This is a proof-of-concept that the dependency unification fix works.
2019-05-02 21:47:14 +01:00
varkor
e5828d4dc0 Prevent dependencies between std/test/rustc unifying with each other 2019-05-02 21:47:14 +01:00
Andy Russell
bbe7b85ef1
mention hir::Body in docs for hir::FnDecl 2019-05-02 15:52:27 -04:00
Andy Russell
69fd757eca
fix markdown syntax in LateContext examples 2019-05-02 15:52:27 -04:00
bors
08bfe16129 Auto merge of #60173 - RalfJung:miri, r=oli-obk
update miri

r? @oli-obk
2019-05-02 17:43:46 +00:00
Alexey Shmalko
201f14b88b
Make tidy::version::Version copy 2019-05-02 16:38:34 +03:00
Alexey Shmalko
4bcc828b9c Make in_feature_group a simple bool flag 2019-05-02 16:38:29 +03:00
Alexey Shmalko
c120fd823b Rework Version::parse to avoid extra allocations 2019-05-02 16:38:29 +03:00
Alexey Shmalko
3b4fe7ef37 Group and sort feature_gate.rs 2019-05-02 16:38:29 +03:00
Alexey Shmalko
90d3fa223d Make tidy::version::Version a [u32; 3] 2019-05-02 16:38:29 +03:00
Alexey Shmalko
d54477e974 Address review comments 2019-05-02 16:38:29 +03:00
Alexey Shmalko
d5ba6d4b3c Ensure language features in group are sorted by since 2019-05-02 16:38:29 +03:00
Alexey Shmalko
b7f55ca238 Assign group and parse since for Feature 2019-05-02 16:38:29 +03:00
Alexey Shmalko
8b82f685a5 Make find_attr_val a little bit more precise
`find_attr_val(&line, "since")` returns `Some(", issue = ")` when
`line` is set to the following line:

```
[unstable(feature = "checked_duration_since", issue = "58402")]
```

Make `find_attr_val` use regex that is a little bit more
precise (requires `=` after key name).

It still does not handle all cases (e.g., extra leading chars in key
name, or escaped quotes in value), but is good enough for now.
2019-05-02 16:38:23 +03:00
bors
d15fc17381 Auto merge of #60379 - froydnj:bootstrap-progress-fixes, r=kennytm
intelligently handle older version of git in bootstrap

If we fail to run with `--progress`, try running without instead.

Fixes #57080.
2019-05-02 13:26:52 +00:00
Wesley Wiser
cac07eba53
Fix failing test 2019-05-02 08:48:08 -04:00
Wesley Wiser
16fe8ccce9 Remove the self.mir field from ConstPropagator 2019-05-02 07:02:34 -04:00
Nicholas Nethercote
6ef39e69ea Avoid repeated interning of static strings.
`file_metadata_raw` interns the strings `"<unknown>"` and `""` very
frequently. This commit avoids that, which reduces the number of symbols
interned significantly and reduces instruction counts by up to 0.5% on
some workloads.
2019-05-02 20:47:20 +10:00
Edward Barnard
0fd446ea78 Make std::fs::copy attempt to create copy-on-write clones of files on MacOS. 2019-05-02 09:41:37 +01:00
Ralf Jung
71338fc305 update miri 2019-05-02 09:43:52 +02:00
bors
758dc9af50 Auto merge of #60156 - RalfJung:macos-rand, r=oli-obk,alexcrichton
use SecRandomCopyBytes on macOS in Miri

This is a hack to fix https://github.com/rust-lang/miri/issues/686: on macOS, rustc will open `/dev/urandom` to initialize a `HashMap`. That's quite hard to emulate properly in Miri without a full-blown implementation of file descriptors.  However, Miri needs an implementation of `SecRandomCopyBytes` anyway to support [getrandom](https://crates.io/crates/getrandom), so using it here should work just as well.

This will only have an effect when libstd is compiled specifically for Miri, but that will generally be the case when people use `cargo miri`.

This is clearly a hack, so I am opening this to start a discussion about whether we are okay with such a hack or not.

Cc @oli-obk
2019-05-02 07:38:36 +00:00
bors
92b5e20ad5 Auto merge of #59008 - varkor:const-generics-infer, r=eddyb
Add const generics to infer (and transitive dependencies)

Split out from #53645. This work is a collaborative effort with @yodaldevoid.

There are a number of stubs. These are mainly to ensure we don't overlook them when completing the implementation, but are not necessary for the initial implementation. We plan to address these in follow up PRs.

r? @eddyb / @nikomatsakis
2019-05-02 04:47:36 +00:00
bors
767f594626 Auto merge of #60460 - Centril:rollup-gz5bc8i, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #59634 (Added an explanation for the E0704 error.)
 - #60348 (move some functions from parser.rs to diagostics.rs)
 - #60385 (Emit metadata files earlier)
 - #60428 (Refactor `eval_body_using_ecx` so that it doesn't need to query for MIR)
 - #60437 (Ensure that drop order of `async fn` matches `fn` and that users cannot refer to generated arguments.)
 - #60439 (doc: Warn about possible zombie apocalypse)
 - #60452 (Remove Context and ContextKind)

Failed merges:

r? @ghost
2019-05-02 02:01:31 +00:00
Taylor Cramer
c6e13bc20b Disallow non-explicit elided lifetimes in async fn 2019-05-01 18:34:49 -07:00
Mazdak Farrokhzad
4ff12347d9
Rollup merge of #60452 - JohnTitor:remove-context, r=matthewjasper
Remove Context and ContextKind

Fixes #60421

r? @matthewjasper
2019-05-02 01:09:32 +02:00
Mazdak Farrokhzad
3dfee3a038
Rollup merge of #60439 - vorner:zombie-apocalypse-warn, r=TimNN
doc: Warn about possible zombie apocalypse

Extend the std::process::Child docs with warning about possible zombies.
The previous version mentioned that when dropping the Child, the
process is not killed. However, the wording gave the impression that
such behaviour is fine to do (leaving the reader believe low-level
details like reaping zombies of the dead processes is taken over by std
somehow; or simply leaving the reader unaware about the problem).
2019-05-02 01:09:31 +02:00
Mazdak Farrokhzad
16939a50ea
Rollup merge of #60437 - davidtwco:issue-60236, r=nikomatsakis
Ensure that drop order of `async fn` matches `fn` and that users cannot refer to generated arguments.

Fixes #60236 and fixes #60438.

This PR modifies the lowering of `async fn` arguments so that the
drop order matches the equivalent `fn`.

Previously, async function arguments were lowered as shown below:

    async fn foo(<pattern>: <ty>) {
      async move {
      }
    } // <-- dropped as you "exit" the fn

    // ...becomes...
    fn foo(__arg0: <ty>) {
      async move {
        let <pattern> = __arg0;
      } // <-- dropped as you "exit" the async block
    }

After this PR, async function arguments will be lowered as:

    async fn foo(<pattern>: <ty>, <pattern>: <ty>, <pattern>: <ty>) {
      async move {
      }
    } // <-- dropped as you "exit" the fn

    // ...becomes...
    fn foo(__arg0: <ty>, __arg1: <ty>, __arg2: <ty>) {
      async move {
        let __arg2 = __arg2;
        let <pattern> = __arg2;
        let __arg1 = __arg1;
        let <pattern> = __arg1;
        let __arg0 = __arg0;
        let <pattern> = __arg0;
      } // <-- dropped as you "exit" the async block
    }

If `<pattern>` is a simple ident, then it is lowered to a single
`let <pattern> = <pattern>;` statement as an optimization.

This PR also stops users from referring to the generated `__argN`
identifiers.

r? @nikomatsakis
2019-05-02 01:09:29 +02:00
Mazdak Farrokhzad
12bf981552
Rollup merge of #60428 - wesleywiser:refactor_const_eval, r=oli-obk
Refactor `eval_body_using_ecx` so that it doesn't need to query for MIR

This is the first step toward removing the `mir` field of `ConstPropagator` which will eventually allow us to actually const propagate in MIR.

r? @oli-obk
2019-05-02 01:09:28 +02:00
Mazdak Farrokhzad
a7cbd92d13
Rollup merge of #60385 - nnethercote:earlier-metadata, r=alexcrichton
Emit metadata files earlier

This will make cargo pipelining much more effective.
2019-05-02 01:09:26 +02:00
Mazdak Farrokhzad
01ce87ad14
Rollup merge of #60348 - agnxy:refactor-parser, r=petrochenkov
move some functions from parser.rs to diagostics.rs

Starting with a few functions mentioned in https://github.com/rust-lang/rust/issues/60015#issuecomment-484259773. We might refactor parser.rs further in subsequent changes.
r? @petrochenkov
2019-05-02 01:09:25 +02:00
Mazdak Farrokhzad
eabdce578b
Rollup merge of #59634 - DevQps:explain-E0704, r=estebank
Added an explanation for the E0704 error.

# Description
Adds an explanation on the E0704 error. I tried to stick as closely to the message that the compiler generates. It's the first time I am fixing error messages here, so if there is something I did wrong or should improve, please let me know.

closes #55398
2019-05-02 01:09:23 +02:00