Commit Graph

92991 Commits

Author SHA1 Message Date
varkor
7d71a1c8a4 Add const generics to unification tables
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:57 +01:00
varkor
b9b9994c72 Define const_unification_error
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:57 +01:00
varkor
05ac3ac575 Define super_combine_consts
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:57 +01:00
varkor
d4e0951fff Add CanonicalVarKind::Const
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:57 +01:00
varkor
14f906f24e Define canonicalize_const_var
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:57 +01:00
varkor
0728b62aca Add ct_err
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:57 +01:00
varkor
d7fdeffafc Add generic consts to BottomUpFolder
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:05 +01:00
varkor
77447deb21 Add const_variable.rs
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:05 +01:00
varkor
2254727480 Add ConstError
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:05 +01:00
varkor
cafa10d96e Define super_relate_consts
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:05 +01:00
varkor
f1c83de1dd Add consts to TypeRelation
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01 23:10:05 +01:00
Esteban Küber
24fddb15e8 Resolve match arm ty when arms diverge 2019-05-01 14:57:24 -07:00
bors
9b67bd42b7 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
2019-05-01 17:24:11 +00:00
Michal 'vorner' Vaner
26199a27ff
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-01 17:46:30 +02:00
David Wood
1fedb0a20b
Unify tests under async-await directory. 2019-05-01 15:03:45 +01:00
David Wood
f47735c3dc
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.
2019-05-01 15:00:43 +01:00
David Wood
b05d5db87b
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.
2019-05-01 14:40:59 +01:00
Wesley Wiser
eadf48e796 Refactor eval_body_using_ecx so that it doesn't need to query for MIR 2019-05-01 08:27:06 -04:00
bors
6cc24f2603 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).
2019-05-01 12:21:04 +00:00
Andrew Xu
d3fff6cda7 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.
2019-05-01 19:54:48 +08:00
Igor Matuszewski
3b24cf80b4 Update RLS 2019-05-01 12:16:54 +02:00
Christian
2be37ad421 Added the E0704 error with a link to the Rust reference. 2019-05-01 12:01:52 +02:00
bors
47e0803d5c 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
2019-05-01 09:32:58 +00:00
Nicholas Nethercote
38dffeba21 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.
2019-05-01 17:17:13 +10:00
Mazdak Farrokhzad
e5b69978c1
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
2019-05-01 08:29:16 +02:00
Mazdak Farrokhzad
c8c195fb38
Rollup merge of #60404 - lo48576:borrow-mut-for-string, r=sfackler
Implement `BorrowMut<str>` for `String`

Closes rust-lang/rfcs#1282.
2019-05-01 08:29:15 +02:00
Mazdak Farrokhzad
604176cc10
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
2019-05-01 08:29:14 +02:00
Mazdak Farrokhzad
edb3cf57dc
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
2019-05-01 08:29:12 +02:00
Mazdak Farrokhzad
6d78142bf0
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.
2019-05-01 08:29:11 +02:00
Mazdak Farrokhzad
1c2ea8f596
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
2019-05-01 08:29:10 +02:00
Mazdak Farrokhzad
a8b854bde0
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
2019-05-01 08:29:09 +02:00
bors
834bd1959c 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
2019-05-01 03:06:13 +00:00
Esteban Küber
a3aafea68f Account for paths in incorrect pub qualifier help 2019-04-30 17:48:18 -07:00
Nicholas Nethercote
3da5d4a87e Inline and remove link_binary_output.
This change simplifies things for the subsequent commit.
2019-05-01 10:33:08 +10:00
varkor
b7711bff52 Rename is_range_literal to is_lit 2019-05-01 00:08:01 +01:00
bors
96ee0ba59e 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.
2019-04-30 22:46:28 +00:00
varkor
80f90d866b Pull out some functors for readability 2019-04-30 23:37:38 +01:00
varkor
5e709b2910 Refactor is_range_literal 2019-04-30 23:17:58 +01:00
varkor
13962aff37 Include signed integer types in the lint 2019-04-30 22:43:51 +01:00
varkor
0556e4891e Preserve literal suffixes 2019-04-30 22:43:51 +01:00
varkor
218982bef0 Place types inside backticks 2019-04-30 22:43:51 +01:00
varkor
c5fdff26b5 Add a test for overflowing endpoints 2019-04-30 22:43:51 +01:00
varkor
5ec2f5e87e Suggest using an inclusive range for an overflowing endpoint 2019-04-30 22:43:51 +01:00
varkor
2cefd9987b Pull is_range_literal out into lowering 2019-04-30 22:43:51 +01:00
bors
7c71bc3208 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
2019-04-30 19:52:13 +00:00
Esteban Küber
ed08c6a985 review comments: change wording 2019-04-30 10:59:30 -07:00
Mazdak Farrokhzad
d58cb934cb Rename hir::ExprKind::Use to ::DropTemps and improve docs. 2019-04-30 18:06:00 +02:00
Michael Woerister
7c4cc01f79 Work around missing tac command on macOS in PGO run-make test. 2019-04-30 17:38:01 +02:00
Yuki OKUSHI
748d978c64 Fix run-pass test 2019-05-01 00:36:51 +09:00
bors
5b7baa53c9 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
2019-04-30 15:19:40 +00:00