]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoMake tidy::version::Version a [u32; 3]
Alexey Shmalko [Wed, 1 May 2019 19:15:00 +0000 (22:15 +0300)]
Make tidy::version::Version a [u32; 3]

5 years agoAddress review comments
Alexey Shmalko [Wed, 1 May 2019 19:01:01 +0000 (22:01 +0300)]
Address review comments

5 years agoEnsure language features in group are sorted by since
Alexey Shmalko [Mon, 29 Apr 2019 17:51:19 +0000 (20:51 +0300)]
Ensure language features in group are sorted by since

5 years agoAssign group and parse since for Feature
Alexey Shmalko [Mon, 29 Apr 2019 17:39:55 +0000 (20:39 +0300)]
Assign group and parse since for Feature

5 years agoMake find_attr_val a little bit more precise
Alexey Shmalko [Mon, 29 Apr 2019 17:01:46 +0000 (20:01 +0300)]
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.

5 years agoAuto merge of #60156 - RalfJung:macos-rand, r=oli-obk,alexcrichton
bors [Thu, 2 May 2019 07:38:36 +0000 (07:38 +0000)]
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

5 years agoAuto merge of #59008 - varkor:const-generics-infer, r=eddyb
bors [Thu, 2 May 2019 04:47:36 +0000 (04:47 +0000)]
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

5 years agoAuto merge of #60460 - Centril:rollup-gz5bc8i, r=Centril
bors [Thu, 2 May 2019 02:01:31 +0000 (02:01 +0000)]
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

5 years agoRollup merge of #60452 - JohnTitor:remove-context, r=matthewjasper
Mazdak Farrokhzad [Wed, 1 May 2019 23:09:32 +0000 (01:09 +0200)]
Rollup merge of #60452 - JohnTitor:remove-context, r=matthewjasper

Remove Context and ContextKind

Fixes #60421

r? @matthewjasper

5 years agoRollup merge of #60439 - vorner:zombie-apocalypse-warn, r=TimNN
Mazdak Farrokhzad [Wed, 1 May 2019 23:09:31 +0000 (01:09 +0200)]
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).

5 years agoRollup merge of #60437 - davidtwco:issue-60236, r=nikomatsakis
Mazdak Farrokhzad [Wed, 1 May 2019 23:09:29 +0000 (01:09 +0200)]
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

5 years agoRollup merge of #60428 - wesleywiser:refactor_const_eval, r=oli-obk
Mazdak Farrokhzad [Wed, 1 May 2019 23:09:28 +0000 (01:09 +0200)]
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

5 years agoRollup merge of #60385 - nnethercote:earlier-metadata, r=alexcrichton
Mazdak Farrokhzad [Wed, 1 May 2019 23:09:26 +0000 (01:09 +0200)]
Rollup merge of #60385 - nnethercote:earlier-metadata, r=alexcrichton

Emit metadata files earlier

This will make cargo pipelining much more effective.

5 years agoRollup merge of #60348 - agnxy:refactor-parser, r=petrochenkov
Mazdak Farrokhzad [Wed, 1 May 2019 23:09:25 +0000 (01:09 +0200)]
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

5 years agoRollup merge of #59634 - DevQps:explain-E0704, r=estebank
Mazdak Farrokhzad [Wed, 1 May 2019 23:09:23 +0000 (01:09 +0200)]
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

5 years agoAuto merge of #60432 - Manishearth:clippyup, r=Manishearth
bors [Wed, 1 May 2019 23:00:14 +0000 (23:00 +0000)]
Auto merge of #60432 - Manishearth:clippyup, r=Manishearth

Update clippy

r? @ghost

5 years agoUpdate clippy
Manish Goregaokar [Wed, 1 May 2019 22:24:52 +0000 (15:24 -0700)]
Update clippy

5 years agoRemove Context and ContextKind
Yuki Okushi [Wed, 1 May 2019 21:03:17 +0000 (06:03 +0900)]
Remove Context and ContextKind

5 years agoSplit `ct_err` out into `CommonConsts`
varkor [Wed, 1 May 2019 22:09:53 +0000 (23:09 +0100)]
Split `ct_err` out into `CommonConsts`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoCreate ShallowResolver
varkor [Tue, 30 Apr 2019 21:27:33 +0000 (22:27 +0100)]
Create ShallowResolver

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd a test for const args that cannot be inferred
varkor [Tue, 23 Apr 2019 12:20:22 +0000 (13:20 +0100)]
Add a test for const args that cannot be inferred

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd a test for incorrect numbers of const args
varkor [Tue, 23 Apr 2019 12:20:04 +0000 (13:20 +0100)]
Add a test for incorrect numbers of const args

5 years agoFold const in writeback
varkor [Tue, 23 Apr 2019 12:18:11 +0000 (13:18 +0100)]
Fold const in writeback

5 years agoAdd a test for const arguments
varkor [Mon, 22 Apr 2019 23:03:14 +0000 (00:03 +0100)]
Add a test for const arguments

5 years agoFix issue with const params in operand.rs
varkor [Mon, 22 Apr 2019 23:03:00 +0000 (00:03 +0100)]
Fix issue with const params in operand.rs

5 years agoResolve FIXME in probe.rs
varkor [Mon, 22 Apr 2019 22:15:52 +0000 (23:15 +0100)]
Resolve FIXME in probe.rs

5 years agoCorrect name of constrained_generic_params alias
varkor [Mon, 22 Apr 2019 22:07:09 +0000 (23:07 +0100)]
Correct name of constrained_generic_params alias

5 years agoFix unused variable warning
varkor [Wed, 17 Apr 2019 22:14:32 +0000 (23:14 +0100)]
Fix unused variable warning

5 years agoFix known-known const unification case
varkor [Wed, 17 Apr 2019 21:53:23 +0000 (22:53 +0100)]
Fix known-known const unification case

5 years agoRemove spurious assertion
varkor [Wed, 17 Apr 2019 21:48:57 +0000 (22:48 +0100)]
Remove spurious assertion

5 years agoAdd `const-types` test
varkor [Wed, 17 Apr 2019 18:31:04 +0000 (19:31 +0100)]
Add `const-types` test

5 years agoFix rebase issue
varkor [Wed, 17 Apr 2019 18:18:12 +0000 (19:18 +0100)]
Fix rebase issue

5 years agoImplement const generics for `InferenceFudger`
varkor [Wed, 27 Mar 2019 17:50:49 +0000 (17:50 +0000)]
Implement const generics for `InferenceFudger`

5 years agoFix missing parenthesis
varkor [Mon, 18 Mar 2019 21:40:45 +0000 (21:40 +0000)]
Fix missing parenthesis

5 years agoTake ConstValue::Placeholder into account in new locations
varkor [Mon, 18 Mar 2019 21:00:52 +0000 (21:00 +0000)]
Take ConstValue::Placeholder into account in new locations

5 years agoFix rebase from LazyConst removal
varkor [Mon, 18 Mar 2019 20:55:19 +0000 (20:55 +0000)]
Fix rebase from LazyConst removal

5 years agoReplace ConstVariableTable with UnificationTable
varkor [Wed, 13 Mar 2019 15:19:35 +0000 (15:19 +0000)]
Replace ConstVariableTable with UnificationTable

5 years agoHandle `ConstValue::Placeholder` in `canonicalizer`
varkor [Tue, 12 Mar 2019 20:55:19 +0000 (20:55 +0000)]
Handle `ConstValue::Placeholder` in `canonicalizer`

5 years agoAdd `PlaceholderConst`
varkor [Tue, 12 Mar 2019 20:26:16 +0000 (20:26 +0000)]
Add `PlaceholderConst`

5 years agoAdd `ConstValue::Placeholder`
varkor [Tue, 12 Mar 2019 20:25:41 +0000 (20:25 +0000)]
Add `ConstValue::Placeholder`

5 years agoInline ConstError into TypeError
varkor [Tue, 12 Mar 2019 19:27:06 +0000 (19:27 +0000)]
Inline ConstError into TypeError

5 years agoImplement fold_const for BoundVarReplacer
varkor [Sat, 9 Mar 2019 16:54:50 +0000 (16:54 +0000)]
Implement fold_const for BoundVarReplacer

5 years agoimpl fold_const for Shifter
Gabriel Smith [Fri, 1 Mar 2019 06:16:04 +0000 (01:16 -0500)]
impl fold_const for Shifter

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoimpl visit_const for HasEscapingVarsVisitor
Gabriel Smith [Fri, 1 Mar 2019 04:09:44 +0000 (23:09 -0500)]
impl visit_const for HasEscapingVarsVisitor

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoimpl fold_const for TypeFreshener
Gabriel Smith [Fri, 1 Mar 2019 04:05:47 +0000 (23:05 -0500)]
impl fold_const for TypeFreshener

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoimpl mk_const_infer
Gabriel Smith [Fri, 1 Mar 2019 04:03:37 +0000 (23:03 -0500)]
impl mk_const_infer

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoRename mk_infer to mk_ty_infer
Gabriel Smith [Fri, 1 Mar 2019 04:02:32 +0000 (23:02 -0500)]
Rename mk_infer to mk_ty_infer

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoimpl fold_const for RegionFudger
Gabriel Smith [Fri, 1 Mar 2019 03:52:13 +0000 (22:52 -0500)]
impl fold_const for RegionFudger

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoRemove `fold_const` override for `ReverseMapper`
varkor [Fri, 8 Mar 2019 01:25:57 +0000 (01:25 +0000)]
Remove `fold_const` override for `ReverseMapper`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoRename *shallow_resolve to *shallow_resolve_type
varkor [Fri, 8 Mar 2019 01:21:19 +0000 (01:21 +0000)]
Rename *shallow_resolve to *shallow_resolve_type

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoDrive-by comment fixes
varkor [Fri, 8 Mar 2019 01:20:58 +0000 (01:20 +0000)]
Drive-by comment fixes

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoHandle generic consts in relate and infer
varkor [Fri, 8 Mar 2019 01:20:33 +0000 (01:20 +0000)]
Handle generic consts in relate and infer

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd stubs for `fold_const`
varkor [Fri, 8 Mar 2019 01:19:53 +0000 (01:19 +0000)]
Add stubs for `fold_const`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoImplement TypeRelation::consts
varkor [Fri, 8 Mar 2019 01:19:13 +0000 (01:19 +0000)]
Implement TypeRelation::consts

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd const generics to unification tables
varkor [Fri, 8 Mar 2019 01:18:02 +0000 (01:18 +0000)]
Add const generics to unification tables

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoDefine `const_unification_error`
varkor [Fri, 8 Mar 2019 01:17:28 +0000 (01:17 +0000)]
Define `const_unification_error`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoDefine `super_combine_consts`
varkor [Fri, 8 Mar 2019 01:17:18 +0000 (01:17 +0000)]
Define `super_combine_consts`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd `CanonicalVarKind::Const`
varkor [Fri, 8 Mar 2019 01:16:54 +0000 (01:16 +0000)]
Add `CanonicalVarKind::Const`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoDefine `canonicalize_const_var`
varkor [Fri, 8 Mar 2019 01:16:18 +0000 (01:16 +0000)]
Define `canonicalize_const_var`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd `ct_err`
varkor [Fri, 8 Mar 2019 01:15:37 +0000 (01:15 +0000)]
Add `ct_err`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd generic consts to `BottomUpFolder`
varkor [Fri, 8 Mar 2019 01:15:23 +0000 (01:15 +0000)]
Add generic consts to `BottomUpFolder`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd const_variable.rs
varkor [Fri, 8 Mar 2019 01:14:01 +0000 (01:14 +0000)]
Add const_variable.rs

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd `ConstError`
varkor [Fri, 8 Mar 2019 01:13:38 +0000 (01:13 +0000)]
Add `ConstError`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoDefine `super_relate_consts`
varkor [Fri, 8 Mar 2019 01:13:08 +0000 (01:13 +0000)]
Define `super_relate_consts`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd `consts` to `TypeRelation`
varkor [Fri, 8 Mar 2019 01:12:51 +0000 (01:12 +0000)]
Add `consts` to `TypeRelation`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAuto merge of #60435 - Centril:rollup-aa5lmuw, r=Centril
bors [Wed, 1 May 2019 17:24:11 +0000 (17:24 +0000)]
Auto merge of #60435 - Centril:rollup-aa5lmuw, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #60287 (Use references for variances_of)
 - #60327 (Search for incompatible universes in borrow errors)
 - #60330 (Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1)
 - #60366 (build-gcc: Create missing cc symlink)
 - #60369 (Support ZSTs in DispatchFromDyn)
 - #60404 (Implement `BorrowMut<str>` for `String`)
 - #60417 (Rename hir::ExprKind::Use to ::DropTemps and improve docs.)

Failed merges:

r? @ghost

5 years agodoc: Warn about possible zombie apocalypse
Michal 'vorner' Vaner [Wed, 1 May 2019 13:57:02 +0000 (15:57 +0200)]
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).

5 years agoUnify tests under async-await directory.
David Wood [Wed, 1 May 2019 14:03:42 +0000 (15:03 +0100)]
Unify tests under async-await directory.

5 years agoEnsure that users cannot use generated arguments.
David Wood [Wed, 1 May 2019 13:31:27 +0000 (14:31 +0100)]
Ensure that users cannot use generated arguments.

This commit gensyms the generated ident for replacement arguments so
that users cannot refer to them. It also ensures that levenshtein
distance suggestions do not suggest gensymed identifiers.

5 years agoEnsure that drop order of `async fn` matches `fn`.
David Wood [Wed, 1 May 2019 12:35:34 +0000 (13:35 +0100)]
Ensure that drop order of `async fn` matches `fn`.

This commit 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.

5 years agoRefactor `eval_body_using_ecx` so that it doesn't need to query for MIR
Wesley Wiser [Tue, 30 Apr 2019 22:30:08 +0000 (18:30 -0400)]
Refactor `eval_body_using_ecx` so that it doesn't need to query for MIR

5 years agoAuto merge of #60137 - eddyb:rustdoc-rm-def-ctor-hax, r=petrochenkov
bors [Wed, 1 May 2019 12:21:04 +0000 (12:21 +0000)]
Auto merge of #60137 - eddyb:rustdoc-rm-def-ctor-hax, r=petrochenkov

rustdoc: remove def_ctor hack.

~~No longer necessary since we have `describe_def`.~~

Turns out `def_ctor` was used in conjunction with abusing `tcx.type_of(def_id)` working on both type definitions and `impl`s (specifically, of builtin types), but also reimplementing a lot of the logic that `Clean` already provides on `Ty` / `ty::TraitRef`.

The first commit now does the minimal refactor to keep it working, while the second commit contains the rest of the refactor I started (parts of which I'm not sure we need to keep).

5 years agomove some functions from parser.rs to diagostics.rs
Andrew Xu [Sun, 28 Apr 2019 05:28:07 +0000 (13:28 +0800)]
move some functions from parser.rs to diagostics.rs

parser.rs is too big. Some functions only for error reporting and error
recovery are being moved to diagostics.rs.

5 years agoAdded the E0704 error with a link to the Rust reference.
Christian [Sat, 20 Apr 2019 15:59:47 +0000 (17:59 +0200)]
Added the E0704 error with a link to the Rust reference.

5 years agoAuto merge of #60195 - varkor:commontypes-to-common, r=eddyb
bors [Wed, 1 May 2019 09:32:58 +0000 (09:32 +0000)]
Auto merge of #60195 - varkor:commontypes-to-common, r=eddyb

Split `CommonTypes` into `CommonTypes` and `CommonLifetimes`

The so-called "`CommonTypes`" contains more than just types.

r? @eddyb

5 years agoMove metadata writing earlier.
Nicholas Nethercote [Tue, 30 Apr 2019 05:53:30 +0000 (15:53 +1000)]
Move metadata writing earlier.

The commit moves metadata writing from `link_binary` to
`encode_metadata` (and renames the latter as
`encode_and_write_metadata`). This is at the very start of code
generation.

5 years agoRollup merge of #60417 - Centril:hir-exprkind-use-renamed-to-drop-temps, r=oli-obk
Mazdak Farrokhzad [Wed, 1 May 2019 06:29:16 +0000 (08:29 +0200)]
Rollup merge of #60417 - Centril:hir-exprkind-use-renamed-to-drop-temps, r=oli-obk

Rename hir::ExprKind::Use to ::DropTemps and improve docs.

Addresses https://github.com/rust-lang/rust/pull/60225#discussion_r279797691.

r? @oli-obk

cc @eddyb @Manishearth

5 years agoRollup merge of #60404 - lo48576:borrow-mut-for-string, r=sfackler
Mazdak Farrokhzad [Wed, 1 May 2019 06:29:15 +0000 (08:29 +0200)]
Rollup merge of #60404 - lo48576:borrow-mut-for-string, r=sfackler

Implement `BorrowMut<str>` for `String`

Closes rust-lang/rfcs#1282.

5 years agoRollup merge of #60369 - TimDiekmann:dispatch-zst, r=eddyb
Mazdak Farrokhzad [Wed, 1 May 2019 06:29:14 +0000 (08:29 +0200)]
Rollup merge of #60369 - TimDiekmann:dispatch-zst, r=eddyb

Support ZSTs in DispatchFromDyn

Allows to use ZSTs with 1 byte alignment in `DispatchFromDyn` implementation. This is required for `Box<T, A: Alloc>`

cc #58457

5 years agoRollup merge of #60366 - lzutao:patch-1, r=pietroalbini
Mazdak Farrokhzad [Wed, 1 May 2019 06:29:12 +0000 (08:29 +0200)]
Rollup merge of #60366 - lzutao:patch-1, r=pietroalbini

build-gcc: Create missing cc symlink

This PR mostly fixes build error caused by using rustc docker images
to build [rustup][1] (with the error: ``linker `cc` not found``).

I don't know why gcc build script doesn't install cc hard link by default.
In build log, with `make SHELL='sh -x' install`, gcc build script installs c++
hard link but not `cc` one:

```bash
if test "" != "yes" ; then \
  rm -f /rustroot/bin/g++; \
  /usr/bin/install -c xg++ /rustroot/bin/g++; \
  chmod a+x /rustroot/bin/g++; \
  rm -f /rustroot/bin/c++; \
  ( cd /rustroot/bin && \
    ln g++ c++ ); \
  if [ -f cc1plus ] ; then \
    if [ ! -f g++-cross ] ; then \
      rm -f /rustroot/bin/x86_64-unknown-linux-gnu-g++; \
      ( cd /rustroot/bin && \
        ln g++ x86_64-unknown-linux-gnu-g++ ); \
      rm -f /rustroot/bin/x86_64-unknown-linux-gnu-c++; \
      ( cd /rustroot/bin && \
        ln c++ x86_64-unknown-linux-gnu-c++ ); \
    fi ; \
  fi; \
fi
```

This might be fixed downstream by manually creating cc hard link
or setting `RUSTFLAGS="-C linker=gcc"` as [suggested by @mati865][2].
But I find it better to fix it upstream in this PR.

[1]: https://github.com/rust-lang/rustup.rs/pull/1815
[2]: https://github.com/rust-lang/rustup.rs/pull/1815#discussion_r279192797

5 years agoRollup merge of #60330 - varkor:range-endpoint-overflow-lint, r=estebank
Mazdak Farrokhzad [Wed, 1 May 2019 06:29:11 +0000 (08:29 +0200)]
Rollup merge of #60330 - varkor:range-endpoint-overflow-lint, r=estebank

Suggest using an inclusive range instead of an exclusive range when the endpoint overflows by 1

Fixes https://github.com/rust-lang/rust/issues/47213.

5 years agoRollup merge of #60327 - matthewjasper:handle-local-outlives-lbl, r=nikomatsakis
Mazdak Farrokhzad [Wed, 1 May 2019 06:29:10 +0000 (08:29 +0200)]
Rollup merge of #60327 - matthewjasper:handle-local-outlives-lbl, r=nikomatsakis

Search for incompatible universes in borrow errors

If we have a borrow that has to live for `'static` we need to check for
any regions in incompatible universes when trying to find the cause.

closes #60274

5 years agoRollup merge of #60287 - Zoxc:the-arena-variances_of, r=eddyb
Mazdak Farrokhzad [Wed, 1 May 2019 06:29:09 +0000 (08:29 +0200)]
Rollup merge of #60287 - Zoxc:the-arena-variances_of, r=eddyb

Use references for variances_of

Based on https://github.com/rust-lang/rust/pull/60280.

cc @varkor
r? @eddyb

5 years agoAuto merge of #60280 - varkor:const-param-invariance, r=eddyb
bors [Wed, 1 May 2019 03:06:13 +0000 (03:06 +0000)]
Auto merge of #60280 - varkor:const-param-invariance, r=eddyb

Fix indexing issue for const parameter invariance

We were previously not taking account of the parent parameters.

r? @eddyb
cc @Zoxc

5 years agoInline and remove `link_binary_output`.
Nicholas Nethercote [Tue, 30 Apr 2019 05:52:16 +0000 (15:52 +1000)]
Inline and remove `link_binary_output`.

This change simplifies things for the subsequent commit.

5 years agoRename is_range_literal to is_lit
varkor [Tue, 30 Apr 2019 23:08:01 +0000 (00:08 +0100)]
Rename is_range_literal to is_lit

5 years agoAuto merge of #60204 - jethrogb:jb/rtunwrap-debug-print, r=alexcrichton
bors [Tue, 30 Apr 2019 22:46:28 +0000 (22:46 +0000)]
Auto merge of #60204 - jethrogb:jb/rtunwrap-debug-print, r=alexcrichton

Debug-print error when using rtunwrap

When I added this macro a while back I didn't have a way to make it print the failure for all types that you might want to unwrap. Now, I came up with a solution.

5 years agoPull out some functors for readability
varkor [Tue, 30 Apr 2019 22:37:38 +0000 (23:37 +0100)]
Pull out some functors for readability

5 years agoRefactor is_range_literal
varkor [Tue, 30 Apr 2019 22:17:58 +0000 (23:17 +0100)]
Refactor is_range_literal

5 years agoInclude signed integer types in the lint
varkor [Sat, 27 Apr 2019 12:52:42 +0000 (13:52 +0100)]
Include signed integer types in the lint

5 years agoPreserve literal suffixes
varkor [Sat, 27 Apr 2019 12:26:06 +0000 (13:26 +0100)]
Preserve literal suffixes

5 years agoPlace types inside backticks
varkor [Sat, 27 Apr 2019 11:56:57 +0000 (12:56 +0100)]
Place types inside backticks

5 years agoAdd a test for overflowing endpoints
varkor [Sat, 27 Apr 2019 11:45:17 +0000 (12:45 +0100)]
Add a test for overflowing endpoints

5 years agoSuggest using an inclusive range for an overflowing endpoint
varkor [Sat, 27 Apr 2019 11:44:51 +0000 (12:44 +0100)]
Suggest using an inclusive range for an overflowing endpoint

5 years agoPull `is_range_literal` out into `lowering`
varkor [Sat, 27 Apr 2019 11:44:32 +0000 (12:44 +0100)]
Pull `is_range_literal` out into `lowering`

5 years agoAuto merge of #60262 - michaelwoerister:pgo-preinlining-pass, r=alexcrichton
bors [Tue, 30 Apr 2019 19:52:13 +0000 (19:52 +0000)]
Auto merge of #60262 - michaelwoerister:pgo-preinlining-pass, r=alexcrichton

 PGO: Add a run-make test that makes sure that PGO profiling data is used by the compiler during optimizations.

From the tests comment section:
```
# This test makes sure that PGO profiling data leads to cold functions being
# marked as `cold` and hot functions with `inlinehint`.
# The test program contains an `if` were actual execution only ever takes the
# `else` branch. Accordingly, we expect the function that is never called to
# be marked as cold.
```

r? @alexcrichton

5 years agoRename hir::ExprKind::Use to ::DropTemps and improve docs.
Mazdak Farrokhzad [Tue, 30 Apr 2019 15:46:59 +0000 (17:46 +0200)]
Rename hir::ExprKind::Use to ::DropTemps and improve docs.

5 years agoWork around missing tac command on macOS in PGO run-make test.
Michael Woerister [Tue, 30 Apr 2019 15:38:01 +0000 (17:38 +0200)]
Work around missing tac command on macOS in PGO run-make test.

5 years agoAuto merge of #60416 - Centril:rollup-bbyyz9x, r=Centril
bors [Tue, 30 Apr 2019 15:19:40 +0000 (15:19 +0000)]
Auto merge of #60416 - Centril:rollup-bbyyz9x, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #60344 (Don't try to render auto-trait bounds with any inference variables)
 - #60354 (Cleanup declare_features! for 'accepted' with a uniform style + sort them)
 - #60362 (Cleanup 'active' declare_features! with uniform style + sorting.)
 - #60382 (Revert "Update Source Code Pro fonts to version 2.030")
 - #60399 (Update clippy)
 - #60400 (Remove functions to simplify handling of feature(bind_by_move_pattern_guards))
 - #60408 (Add missing f16c_target_feature check to typeck collect)

Failed merges:

r? @ghost

5 years agoRollup merge of #60408 - gnzlbg:f16c2, r=Centril
Mazdak Farrokhzad [Tue, 30 Apr 2019 14:10:33 +0000 (16:10 +0200)]
Rollup merge of #60408 - gnzlbg:f16c2, r=Centril

Add missing f16c_target_feature check to typeck collect