]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoSGX: Fix target linker used by bootstrap
Jethro Beekman [Wed, 4 Dec 2019 15:02:28 +0000 (16:02 +0100)]
SGX: Fix target linker used by bootstrap

4 years agoAuto merge of #65947 - eddyb:fn-abi, r=oli-obk,nagisa
bors [Wed, 4 Dec 2019 08:22:05 +0000 (08:22 +0000)]
Auto merge of #65947 - eddyb:fn-abi, r=oli-obk,nagisa

rustc: split FnAbi's into definitions/direct calls ("of_instance") and indirect calls ("of_fn_ptr").

After this PR:
* `InstanceDef::Virtual` is only used for "direct" virtual calls, and shims around those calls use `InstanceDef::ReifyShim` (i.e. for `<dyn Trait as Trait>::f as fn(_)`)
  * this could easily be done for intrinsics as well, to allow their reification, but I didn't do it
* `FnAbi::of_instance` is **always** used for declaring/defining an `fn`, and for direct calls to an `fn`
  * this is great for e.g. https://github.com/rust-lang/rust/pull/65881 (`#[track_caller]`), which can introduce the "caller location" argument into "codegen signatures" by only changing `FnAbi::of_instance`, after this PR
* `FnAbi::of_fn_ptr` is used primarily for indirect calls, i.e. to `fn` pointers
  * *not* virtual calls (which use `FnAbi::of_instance` with `InstanceDef::Virtual`)
  * there's also a couple uses where the `rustc_codegen_llvm` needs to declare (i.e. FFI-import) an LLVM function that has no Rust declaration available at all
    * at least one of them could probably be a "weak lang item" instead

As there are many steps, this PR is best reviewed commit by commit - some of which arguably should be in their own PRs, I may have gotten carried away a bit.

cc @nagisa @rkruppe @oli-obk @anp

4 years agoAuto merge of #66996 - ehuss:update-cargo, r=alexcrichton
bors [Wed, 4 Dec 2019 05:07:34 +0000 (05:07 +0000)]
Auto merge of #66996 - ehuss:update-cargo, r=alexcrichton

Update cargo

11 commits in 750cb1482e4d0e74822cded7ab8b3c677ed8b041..626f0f40efd32e6b3dbade50cd53fdfaa08446ba
2019-11-23 23:06:36 +0000 to 2019-12-03 16:53:04 +0000
- Change some texts to links in README (rust-lang/cargo#7652)
- Update config and environment variable docs. (rust-lang/cargo#7650)
- Stop ignoring .rs.bk files; rustfmt hasn't generated them in years (rust-lang/cargo#7647)
- Various contributing docs updates. (rust-lang/cargo#7642)
- Stabilize profile-overrides. (rust-lang/cargo#7591)
- Update comment about ResolveVersion default version. (rust-lang/cargo#7637)
- Update tests for slight wording change in rustdoc error message. (rust-lang/cargo#7641)
- Remove dep_targets. (rust-lang/cargo#7626)
- vendor: don't use canonical path in .cargo/config (rust-lang/cargo#7629)
- Minor testsuite organization. (rust-lang/cargo#7628)
- Remove failing plugin tests. (rust-lang/cargo#7630)

4 years agoAuto merge of #66995 - flip1995:clippyup, r=Manishearth
bors [Wed, 4 Dec 2019 01:52:49 +0000 (01:52 +0000)]
Auto merge of #66995 - flip1995:clippyup, r=Manishearth

Update Clippy

Fixes #66989

r? @Manishearth @Centril

4 years agoUpdate Clippy
flip1995 [Tue, 3 Dec 2019 17:58:33 +0000 (18:58 +0100)]
Update Clippy

4 years agoAuto merge of #66925 - RalfJung:miri, r=RalfJung
bors [Tue, 3 Dec 2019 22:40:44 +0000 (22:40 +0000)]
Auto merge of #66925 - RalfJung:miri, r=RalfJung

update Miri

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

r? @ghost

4 years agoAuto merge of #66997 - Centril:rollup-uraqpgu, r=Centril
bors [Tue, 3 Dec 2019 18:42:43 +0000 (18:42 +0000)]
Auto merge of #66997 - Centril:rollup-uraqpgu, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #66750 (Update the `wasi` crate for `wasm32-wasi`)
 - #66878 (Move Sessions into (new) librustc_session)
 - #66903 (parse_enum_item -> parse_enum_variant)
 - #66951 (miri: add throw_machine_stop macro)
 - #66957 (Change Linker for x86_64-fortanix-unknown-sgx target to rust-lld)
 - #66960 ([const-prop] Fix ICE calculating enum discriminant)
 - #66973 (Update the minimum external LLVM to 7)

Failed merges:

r? @ghost

4 years agoRollup merge of #66973 - cuviper:min-llvm7, r=alexcrichton
Mazdak Farrokhzad [Tue, 3 Dec 2019 18:41:57 +0000 (19:41 +0100)]
Rollup merge of #66973 - cuviper:min-llvm7, r=alexcrichton

Update the minimum external LLVM to 7

LLVM 7 is over a year old, which should be plenty for compatibility. The
last LLVM 6 holdout was llvm-emscripten, which went away in #65501.

I've also included a fix for LLVM 8 lacking `MemorySanitizerOptions`,
which was broken by #66522.

4 years agoRollup merge of #66960 - wesleywiser:fix_66787_take2, r=oli-obk,RalfJung
Mazdak Farrokhzad [Tue, 3 Dec 2019 18:41:55 +0000 (19:41 +0100)]
Rollup merge of #66960 - wesleywiser:fix_66787_take2, r=oli-obk,RalfJung

[const-prop] Fix ICE calculating enum discriminant

Fixes #66787

Different approach than #66857

r? @oli-obk
cc @RalfJung @eddyb

4 years agoRollup merge of #66957 - parthsane:pvs/ftx_lld_linker, r=alexcrichton
Mazdak Farrokhzad [Tue, 3 Dec 2019 18:41:54 +0000 (19:41 +0100)]
Rollup merge of #66957 - parthsane:pvs/ftx_lld_linker, r=alexcrichton

Change Linker for x86_64-fortanix-unknown-sgx target to rust-lld

Changed linker for `x86_64-fortanix-unknown-sgx` target to `rust-lld`
This change needed the RelaxELFRelocations flag to be set for it to work correctly

r? @jethrogb

4 years agoRollup merge of #66951 - RalfJung:miri-machine-stop, r=oli-obk
Mazdak Farrokhzad [Tue, 3 Dec 2019 18:41:52 +0000 (19:41 +0100)]
Rollup merge of #66951 - RalfJung:miri-machine-stop, r=oli-obk

miri: add throw_machine_stop macro

r? @oli-obk
This helps Miri: https://github.com/rust-lang/miri/pull/1093

4 years agoRollup merge of #66903 - Centril:parse-enum-variant, r=estebank
Mazdak Farrokhzad [Tue, 3 Dec 2019 18:41:51 +0000 (19:41 +0100)]
Rollup merge of #66903 - Centril:parse-enum-variant, r=estebank

parse_enum_item -> parse_enum_variant

r? @estebank

4 years agoRollup merge of #66878 - Mark-Simulacrum:sess-decouple, r=Centril
Mazdak Farrokhzad [Tue, 3 Dec 2019 18:41:48 +0000 (19:41 +0100)]
Rollup merge of #66878 - Mark-Simulacrum:sess-decouple, r=Centril

Move Sessions into (new) librustc_session

This PR moves `ParseSess` and `Session` from their current locations into a new crate, `librustc_session`.

There are several intents behind this change. librustc is a very large crate, and we want to split it up over time -- this movement removes the sizeable session module from it. It also helps allow for future movement of things not coupled to TyCtxt but coupled to Session out of the crate.

This movement allows allows for a future follow-up PR which unifies Session and ParseSess, allowing for a single source of truth for APIs interested in global options throughout the compiler; the ParseSess is already created directly as a member of Session in the current compiler (i.e., we do not first construct a ParseSess and then move it into Session later in the compilation).

This PR intentionally avoids changing numerous imports throughout the tree to new locations of the moved types; this is needless noise and can be done as needed.

In the process of moving the sessions back, the lint system received an update as well -- notably, early buffered lints are no longer ad-hoc declared as enum pairs and later associated with proper lint declarations. They are still separately handled (buffered), it is a little unclear whether this is truly necessary, but regardless is left for future PRs.

Many of the types moved back are sort of ad-hoc placed into the same crate (librustc_session) instead of creating other crates; it's unclear whether this is actually a good thing, but it seemed better than creating numerous tiny crates which served no purpose on their own.

4 years agoRollup merge of #66750 - alexcrichton:update-wasi, r=sfackler
Mazdak Farrokhzad [Tue, 3 Dec 2019 18:41:46 +0000 (19:41 +0100)]
Rollup merge of #66750 - alexcrichton:update-wasi, r=sfackler

Update the `wasi` crate for `wasm32-wasi`

This commit updates the `wasi` crate used by the standard library which
is used to implement most of the functionality of libstd on the
`wasm32-wasi` target. This update comes with a brand new crate structure
in the `wasi` crate which caused quite a few changes for the wasi target
here, but it also comes with a significant change to where the
functionality is coming from.

The WASI specification is organized into "snapshots" and a new snapshot
happened recently, so the WASI APIs themselves have changed since the
previous revision. This had only minor impact on the public facing
surface area of libstd, only changing on `u32` to a `u64` in an unstable
API. The actual source for all of these types and such, however, is now
coming from the `wasi_preview_snapshot1` module instead of the
`wasi_unstable` module like before. This means that any implementors
generating binaries will need to ensure that their embedding environment
handles the `wasi_preview_snapshot1` module.

4 years agoUpdate cargo
Eric Huss [Tue, 3 Dec 2019 18:22:00 +0000 (10:22 -0800)]
Update cargo

4 years agoFix UI tests for new locations
Mark Rousskov [Sun, 1 Dec 2019 18:11:31 +0000 (13:11 -0500)]
Fix UI tests for new locations

4 years agoDeduplicate CrateConfig
Mark Rousskov [Fri, 29 Nov 2019 21:09:00 +0000 (16:09 -0500)]
Deduplicate CrateConfig

4 years agoMove Session to librustc_session
Mark Rousskov [Fri, 29 Nov 2019 21:05:28 +0000 (16:05 -0500)]
Move Session to librustc_session

4 years agoMove ParseSess to librustc_session
Mark Rousskov [Fri, 29 Nov 2019 20:45:26 +0000 (15:45 -0500)]
Move ParseSess to librustc_session

4 years agoMove BufferedEarlyLint to librustc_session
Mark Rousskov [Fri, 29 Nov 2019 20:41:22 +0000 (15:41 -0500)]
Move BufferedEarlyLint to librustc_session

4 years agoDuplicate CrateConfig into Session
Mark Rousskov [Fri, 29 Nov 2019 14:33:51 +0000 (09:33 -0500)]
Duplicate CrateConfig into Session

Since it's just a type alias this isn't too difficult and once Session
is moved back we can make this be the canonical location.

4 years agoRemove dead cfg method
Mark Rousskov [Fri, 29 Nov 2019 14:18:56 +0000 (09:18 -0500)]
Remove dead cfg method

4 years agoDirectly use types from libsyntax::ast
Mark Rousskov [Wed, 20 Nov 2019 01:02:16 +0000 (20:02 -0500)]
Directly use types from libsyntax::ast

4 years agoRe-export Client from rustc_data_structures::jobserver
Mark Rousskov [Wed, 20 Nov 2019 00:21:47 +0000 (19:21 -0500)]
Re-export Client from rustc_data_structures::jobserver

4 years agoMove NativeLibraryKind to rustc_session
Mark Rousskov [Thu, 14 Nov 2019 17:16:24 +0000 (12:16 -0500)]
Move NativeLibraryKind to rustc_session

4 years agoMove early lint declarations to librustc_session
Mark Rousskov [Tue, 12 Nov 2019 17:09:20 +0000 (12:09 -0500)]
Move early lint declarations to librustc_session

4 years agoMove Lint to rustc_session
Mark Rousskov [Tue, 12 Nov 2019 16:52:26 +0000 (11:52 -0500)]
Move Lint to rustc_session

This commit breaks early-lint registration, which will be fixed in the
next commit. This movement will allow essentially all crates in the compiler
tree to declare lints (though not lint passes).

4 years agoMove Level to rustc_session
Mark Rousskov [Tue, 12 Nov 2019 13:51:57 +0000 (08:51 -0500)]
Move Level to rustc_session

4 years agoMove duration_to_secs_str to rustc_session
Mark Rousskov [Tue, 12 Nov 2019 13:30:40 +0000 (08:30 -0500)]
Move duration_to_secs_str to rustc_session

4 years agoMove cgu_reuse_tracker to librustc_session
Mark Rousskov [Tue, 12 Nov 2019 13:22:16 +0000 (08:22 -0500)]
Move cgu_reuse_tracker to librustc_session

4 years agoIntroduce rustc_session crate
Mark Rousskov [Tue, 12 Nov 2019 13:17:33 +0000 (08:17 -0500)]
Introduce rustc_session crate

4 years agoDecouple CguReuseTracker from Session
Mark Rousskov [Tue, 12 Nov 2019 13:07:35 +0000 (08:07 -0500)]
Decouple CguReuseTracker from Session

4 years agoUse FxHash* from data structures not nodemap
Mark Rousskov [Tue, 12 Nov 2019 13:04:39 +0000 (08:04 -0500)]
Use FxHash* from data structures not nodemap

4 years agoupdate miri
Ralf Jung [Tue, 3 Dec 2019 17:04:03 +0000 (18:04 +0100)]
update miri

4 years agoUpdate the `wasi` crate for `wasm32-wasi`
Alex Crichton [Mon, 25 Nov 2019 17:27:25 +0000 (09:27 -0800)]
Update the `wasi` crate for `wasm32-wasi`

This commit updates the `wasi` crate used by the standard library which
is used to implement most of the functionality of libstd on the
`wasm32-wasi` target. This update comes with a brand new crate structure
in the `wasi` crate which caused quite a few changes for the wasi target
here, but it also comes with a significant change to where the
functionality is coming from.

The WASI specification is organized into "snapshots" and a new snapshot
happened recently, so the WASI APIs themselves have changed since the
previous revision. This had only minor impact on the public facing
surface area of libstd, only changing on `u32` to a `u64` in an unstable
API. The actual source for all of these types and such, however, is now
coming from the `wasi_preview_snapshot1` module instead of the
`wasi_unstable` module like before. This means that any implementors
generating binaries will need to ensure that their embedding environment
handles the `wasi_preview_snapshot1` module.

4 years agorustc: add docs to FnAbi::{of_fn_ptr,of_instance} and InstanceDef::Virtual.
Eduard-Mihai Burtescu [Wed, 27 Nov 2019 11:59:59 +0000 (13:59 +0200)]
rustc: add docs to FnAbi::{of_fn_ptr,of_instance} and InstanceDef::Virtual.

4 years agorustc: move Instance::fn_sig to ty::layout and privatize it.
Eduard-Mihai Burtescu [Wed, 27 Nov 2019 11:44:20 +0000 (13:44 +0200)]
rustc: move Instance::fn_sig to ty::layout and privatize it.

4 years agorustc_target: add abi::call::Conv::Rust distinct from Conv::C.
Eduard-Mihai Burtescu [Wed, 27 Nov 2019 11:23:30 +0000 (13:23 +0200)]
rustc_target: add abi::call::Conv::Rust distinct from Conv::C.

4 years agorustc_codegen_llvm: privatize as much of attributes::* as possible.
Eduard-Mihai Burtescu [Wed, 27 Nov 2019 10:55:33 +0000 (12:55 +0200)]
rustc_codegen_llvm: privatize as much of attributes::* as possible.

4 years agorustc_codegen_llvm: take an Instance in attributes::from_fn_attrs.
Eduard-Mihai Burtescu [Wed, 27 Nov 2019 10:53:19 +0000 (12:53 +0200)]
rustc_codegen_llvm: take an Instance in attributes::from_fn_attrs.

4 years agorustc_codegen_llvm: rewrite debuginfo::get_function_signature to use FnAbi.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 18:01:31 +0000 (20:01 +0200)]
rustc_codegen_llvm: rewrite debuginfo::get_function_signature to use FnAbi.

4 years agorustc: take a PolyFnSig instead of an FnSig in FnAbi::of_fn_ptr.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 20:08:50 +0000 (22:08 +0200)]
rustc: take a PolyFnSig instead of an FnSig in FnAbi::of_fn_ptr.

4 years agorustc: rename FnAbi::new to FnAbi::of_fn_ptr.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 19:57:45 +0000 (21:57 +0200)]
rustc: rename FnAbi::new to FnAbi::of_fn_ptr.

4 years agorustc: compute FnAbi's for virtual calls through FnAbi::of_instance.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 19:46:25 +0000 (21:46 +0200)]
rustc: compute FnAbi's for virtual calls through FnAbi::of_instance.

4 years agorustc: use ReifyShim for reifying Virtual call instances.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 18:56:21 +0000 (20:56 +0200)]
rustc: use ReifyShim for reifying Virtual call instances.

4 years agorustc_codegen_ssa: use FnAbi::of_instance wherever possible.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 18:01:31 +0000 (20:01 +0200)]
rustc_codegen_ssa: use FnAbi::of_instance wherever possible.

4 years agorustc_codegen_llvm: move NoReturn attribute to apply_attrs_llfn.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 17:46:18 +0000 (19:46 +0200)]
rustc_codegen_llvm: move NoReturn attribute to apply_attrs_llfn.

4 years agorustc_codegen_ssa: take a FnAbi instead of a FnSig in declare_fn.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 16:34:50 +0000 (18:34 +0200)]
rustc_codegen_ssa: take a FnAbi instead of a FnSig in declare_fn.

4 years agorustc_codegen_ssa: remove define_fn and define_internal_fn.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 16:39:54 +0000 (18:39 +0200)]
rustc_codegen_ssa: remove define_fn and define_internal_fn.

4 years agoAuto merge of #66982 - Centril:rollup-yq2281i, r=Centril
bors [Tue, 3 Dec 2019 13:21:03 +0000 (13:21 +0000)]
Auto merge of #66982 - Centril:rollup-yq2281i, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #66148 (Show the sign for signed ops on `exact_div`)
 - #66651 (Add `enclosing scope` parameter to `rustc_on_unimplemented`)
 - #66904 (Adding docs for keyword match, move)
 - #66935 (syntax: Unify macro and attribute arguments in AST)
 - #66941 (Remove `ord` lang item)
 - #66967 (Remove hack for top-level or-patterns in match checking)

Failed merges:

r? @ghost

4 years agorustc_codegen_ssa: clean up lifetimes on TerminatorCodegenHelper's methods.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 16:11:11 +0000 (18:11 +0200)]
rustc_codegen_ssa: clean up lifetimes on TerminatorCodegenHelper's methods.

4 years agorustc_codegen_ssa: make codegen_instance a simple wrapper for codegen_mir.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 14:26:25 +0000 (16:26 +0200)]
rustc_codegen_ssa: make codegen_instance a simple wrapper for codegen_mir.

4 years agorustc_codegen_ssa: use &'tcx mir::Body<'tcx> instead of &'a ... for the MIR body.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 14:24:25 +0000 (16:24 +0200)]
rustc_codegen_ssa: use &'tcx mir::Body<'tcx> instead of &'a ... for the MIR body.

4 years ago[const-prop] Fix ICE calculating enum discriminant
Wesley Wiser [Fri, 29 Nov 2019 02:36:06 +0000 (21:36 -0500)]
[const-prop] Fix ICE calculating enum discriminant

Fixes #66787

4 years agorustc: expose the mir::Body reference lifetime from mir::ReadOnlyBodyCache (#64736...
Eduard-Mihai Burtescu [Tue, 3 Dec 2019 10:55:58 +0000 (12:55 +0200)]
rustc: expose the mir::Body reference lifetime from mir::ReadOnlyBodyCache (#64736 fallout).

4 years agorustc_mir: don't hardcode InstanceDef::VtableShim behavior to Adjustment::DerefMove.
Eduard-Mihai Burtescu [Tue, 3 Dec 2019 10:54:47 +0000 (12:54 +0200)]
rustc_mir: don't hardcode InstanceDef::VtableShim behavior to Adjustment::DerefMove.

4 years agorustc: combine Instance::fn_sig_noadjust and Instance::fn_sig.
Eduard-Mihai Burtescu [Mon, 28 Oct 2019 19:16:41 +0000 (21:16 +0200)]
rustc: combine Instance::fn_sig_noadjust and Instance::fn_sig.

4 years agoRollup merge of #66967 - Nadrieril:remove-or-pat-hack, r=varkor
Mazdak Farrokhzad [Tue, 3 Dec 2019 10:07:08 +0000 (11:07 +0100)]
Rollup merge of #66967 - Nadrieril:remove-or-pat-hack, r=varkor

Remove hack for top-level or-patterns in match checking

Follow-up to #66612.

Or-patterns are now truly first-class in match checking. As a side-effect, redundant subpatterns are linted as such, making the `unreachable_patterns` lint a bit more general.

cc #54883

r? @varkor

4 years agoRollup merge of #66941 - CAD97:nord, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 3 Dec 2019 10:07:07 +0000 (11:07 +0100)]
Rollup merge of #66941 - CAD97:nord, r=Dylan-DPC

Remove `ord` lang item

At this point it seems to be unused, and just `partial_ord` is used instead. This removes the unused lang item.

4 years agoRollup merge of #66935 - petrochenkov:attrtok2, r=Centril
Mazdak Farrokhzad [Tue, 3 Dec 2019 10:07:05 +0000 (11:07 +0100)]
Rollup merge of #66935 - petrochenkov:attrtok2, r=Centril

syntax: Unify macro and attribute arguments in AST

The unified form (`ast::MacArgs`) represents parsed arguments instead of an unstructured token stream that was previously used for attributes.
It also tracks some spans and delimiter kinds better for fn-like macros and macro definitions.

I've been talking about implementing this with @nnethercote in https://github.com/rust-lang/rust/pull/65750#issuecomment-546517322.
The parsed representation is closer to `MetaItem` and requires less token juggling during conversions, so it potentially may be faster.

r? @Centril

4 years agoRollup merge of #66904 - DevinR528:keyword-doc, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 3 Dec 2019 10:07:04 +0000 (11:07 +0100)]
Rollup merge of #66904 - DevinR528:keyword-doc, r=Dylan-DPC

Adding docs for keyword match, move

Partial fix of issue #34601.

4 years agoRollup merge of #66651 - Areredify:on-unimplemented-scope, r=davidtwco
Mazdak Farrokhzad [Tue, 3 Dec 2019 10:07:01 +0000 (11:07 +0100)]
Rollup merge of #66651 - Areredify:on-unimplemented-scope, r=davidtwco

Add `enclosing scope` parameter to `rustc_on_unimplemented`

Adds a new parameter to `#[rustc_on_unimplemented]`, `enclosing scope`, which highlights the function or closure scope with a message.

The wip part refers to adding this annotation to `Try` trait to improve ergonomics (which I don't know how to do since I change both std and librustc)

Closes #61709.

4 years agoRollup merge of #66148 - oli-obk:it_must_be_a_sign, r=RalfJung
Mazdak Farrokhzad [Tue, 3 Dec 2019 10:06:57 +0000 (11:06 +0100)]
Rollup merge of #66148 - oli-obk:it_must_be_a_sign, r=RalfJung

Show the sign for signed ops on `exact_div`

r? @RalfJung Cc https://github.com/rust-lang/miri/pull/961/files#r341842128

I'm fairly unhappy with the duplication and the general effort required for this.

Maybe it would be better to add a `display` impl for `ImmTy`?

4 years agoAuto merge of #66947 - matthiaskrgr:submodule_upd, r=oli-obk
bors [Tue, 3 Dec 2019 09:51:07 +0000 (09:51 +0000)]
Auto merge of #66947 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy from 7b8e8293 to 45196cee

Changes:
````
account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint
build(tests/fmt): use shared target dir
chore: fix and split some ui tests on 32bit system
build: set up build job for i686 targets
remove needless my_lint ui test
git quiet
deploy: cd to out/ before adding files to git
Less needless_doctest_main false positives
fmt
Feed the dog
Use rustc_env instead of exec_env for test
Make triggering this lint less likely :paperclip:
Use exec_env to set backtrace level and normalize output
Update custom ICE function with latest rustc
Use Clippy version in ICE message
Add custom ICE message that points to Clippy repo
Fix master deployment
Run update_lints
Add projections check to EUV for escape analysis
Use infer_ctxt
Move use_self to nursery
Use `println!` on success instead of `eprintln!`
Revert "Disable chalk integration test. Output too large"
Remove the old integration-tests.sh script
Use rust implementation for integration tests in CI
Rust implementation of integration test
Don't error on clippy.toml of dependencies
Fix categorizations
Fix arguments on ExprUseVisitor::new
euv moved from middle to typeck
cmt_ -> Place
build: check if RTIM is not installed
make use of Result::map_or
trigger string_lit_as_bytes when literal has escapes
Remove negative float literal checks.
Enable deny-warnings feature everywhere in CI
Remove unused debugging feature
implemented `as_conversions` lint
fixing a typo
[comparison_chain] #4827 Check `core::cmp::Ord` is implemented
add a good example for the approx_const lint
Add suggested good cases in docs for lifetimes lint
````
Fixes #66840

4 years agoChange linker for x86_64-fortanix-unknown-sgx to rust-lld
Parth Sane [Mon, 2 Dec 2019 12:22:45 +0000 (17:52 +0530)]
Change linker for x86_64-fortanix-unknown-sgx to rust-lld

For SGX, the relocation using the relocation table is done by
the code in rust/src/libstd/sys/sgx/abi/reloc.rs and this code
should not require relocation. Setting RelaxELFRelocations flag
if allows this to happen, hence adding a Target Option for it.

4 years agoAuto merge of #66256 - CAD97:patch-2, r=RalfJung
bors [Tue, 3 Dec 2019 01:50:33 +0000 (01:50 +0000)]
Auto merge of #66256 - CAD97:patch-2, r=RalfJung

Layout::pad_to_align is infallible

As per [this comment](https://github.com/rust-lang/rust/issues/55724#issuecomment-441421651) (cc @glandium).

> Per https://github.com/rust-lang/rust/blob/eb981a1/src/libcore/alloc.rs#L63-L65, `layout.size()` is always <= `usize::MAX - (layout.align() - 1)`.
>
> Which means:
>
> * The maximum value `layout.size()` can have is already aligned for `layout.align()` (`layout.align()` being a power of two, `usize::MAX - (layout.align() - 1)` is a multiple of `layout.align()`)
> * Incidentally, any value smaller than that maximum value will align at most to that maximum value.
>
> IOW, `pad_to_align` can not return `Err(LayoutErr)`, except for the layout not respecting its invariants, but we shouldn't care about that.

This PR makes `pad_to_align` return `Layout` directly, representing the fact that it cannot fail.

4 years agosubmodules: update clippy from 7b8e8293 to 7a943a9d
Matthias Krüger [Mon, 2 Dec 2019 22:09:48 +0000 (23:09 +0100)]
submodules: update clippy from 7b8e8293 to 7a943a9d

Changes:
````
Normalize custom ICE test
Rustup to rust-lang/rust#64736
Use assert_crate_local for a more explicit error
Rustup to https://github.com/rust-lang/rust/pull/66789
account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint
build(tests/fmt): use shared target dir
chore: fix and split some ui tests on 32bit system
build: set up build job for i686 targets
remove needless my_lint ui test
git quiet
deploy: cd to out/ before adding files to git
Less needless_doctest_main false positives
fmt
Feed the dog
Use rustc_env instead of exec_env for test
Make triggering this lint less likely :paperclip:
Use exec_env to set backtrace level and normalize output
Update custom ICE function with latest rustc
Use Clippy version in ICE message
Add custom ICE message that points to Clippy repo
Fix master deployment
Run update_lints
Add projections check to EUV for escape analysis
Use infer_ctxt
Move use_self to nursery
Use `println!` on success instead of `eprintln!`
Revert "Disable chalk integration test. Output too large"
Remove the old integration-tests.sh script
Use rust implementation for integration tests in CI
Rust implementation of integration test
Don't error on clippy.toml of dependencies
Fix categorizations
Fix arguments on ExprUseVisitor::new
euv moved from middle to typeck
cmt_ -> Place
build: check if RTIM is not installed
make use of Result::map_or
trigger string_lit_as_bytes when literal has escapes
Remove negative float literal checks.
Enable deny-warnings feature everywhere in CI
Remove unused debugging feature
implemented `as_conversions` lint
fixing a typo
[comparison_chain] #4827 Check `core::cmp::Ord` is implemented
add a good example for the approx_const lint
Add suggested good cases in docs for lifetimes lint
````

4 years agoUpdate the minimum external LLVM to 7
Josh Stone [Mon, 2 Dec 2019 19:35:59 +0000 (11:35 -0800)]
Update the minimum external LLVM to 7

LLVM 7 is over a year old, which should be plenty for compatibility. The
last LLVM 6 holdout was llvm-emscripten, which went away in #65501.

I've also included a fix for LLVM 8 lacking `MemorySanitizerOptions`,
which was broken by #66522.

4 years agoAddress review comments
Vadim Petrochenkov [Mon, 2 Dec 2019 18:56:11 +0000 (21:56 +0300)]
Address review comments

4 years agosyntax: Optimize conversion `AttrItem` -> `MetaItem` by avoiding `outer_tokens`.
Vadim Petrochenkov [Sun, 1 Dec 2019 16:16:44 +0000 (19:16 +0300)]
syntax: Optimize conversion `AttrItem` -> `MetaItem` by avoiding `outer_tokens`.

4 years agosyntax: Use `ast::MacArgs` for macro definitions
Vadim Petrochenkov [Sun, 1 Dec 2019 14:53:59 +0000 (17:53 +0300)]
syntax: Use `ast::MacArgs` for macro definitions

4 years agosyntax: Use `ast::MacArgs` for attributes
Vadim Petrochenkov [Sun, 1 Dec 2019 14:07:38 +0000 (17:07 +0300)]
syntax: Use `ast::MacArgs` for attributes

4 years agosyntax: Remove redundant span from `ast::Mac`
Vadim Petrochenkov [Sun, 1 Dec 2019 12:55:32 +0000 (15:55 +0300)]
syntax: Remove redundant span from `ast::Mac`

Also remove a couple of redundant `visit_mac` asserts

4 years agosyntax: Introduce a struct `MacArgs` for macro arguments
Vadim Petrochenkov [Sat, 30 Nov 2019 23:25:32 +0000 (02:25 +0300)]
syntax: Introduce a struct `MacArgs` for macro arguments

4 years agoRemove top-level or-pattern hack
Nadrieril [Fri, 29 Nov 2019 15:53:54 +0000 (15:53 +0000)]
Remove top-level or-pattern hack

4 years agoMove recently changed tests to the correct file
Nadrieril [Fri, 29 Nov 2019 13:02:14 +0000 (13:02 +0000)]
Move recently changed tests to the correct file

4 years agoCorrect error on partially unreachable or-pat in `if let`
Nadrieril [Fri, 29 Nov 2019 12:51:34 +0000 (12:51 +0000)]
Correct error on partially unreachable or-pat in `if let`

4 years agoLint for redundant branches in or-patterns
Nadrieril [Thu, 28 Nov 2019 16:56:45 +0000 (16:56 +0000)]
Lint for redundant branches in or-patterns

4 years agoAdd some tests
Nadrieril [Fri, 29 Nov 2019 12:25:36 +0000 (12:25 +0000)]
Add some tests

4 years agoSimplify lifetimes by allocating patterns on the arena
Nadrieril [Thu, 28 Nov 2019 13:03:02 +0000 (13:03 +0000)]
Simplify lifetimes by allocating patterns on the arena

We want the lifetimes of the patterns contained in the matrix and the
candidate `PatStack` to be the same so that they can be mixed together.
A lot of this would not be necessary if `SmallVec` was covariant in its
type argument (see https://github.com/servo/rust-smallvec/issues/146).

4 years ago`UsefulWithWitness` always carries some witnesses
Nadrieril [Wed, 27 Nov 2019 16:50:42 +0000 (16:50 +0000)]
`UsefulWithWitness` always carries some witnesses

4 years agoDon't build the same matrix twice
Nadrieril [Sun, 3 Nov 2019 17:10:33 +0000 (17:10 +0000)]
Don't build the same matrix twice

The exact same logic was used in check_arms and check_match to build the
matrix of relevant patterns. It would actually probably have been a bug
if it was not the case, since exhaustiveness checking should be the same
as checking reachability of an additional `_ => ...` match branch.

4 years agoAuto merge of #64736 - Nashenas88:mir_predecessors_cache_cleanup, r=oli-obk
bors [Mon, 2 Dec 2019 14:51:02 +0000 (14:51 +0000)]
Auto merge of #64736 - Nashenas88:mir_predecessors_cache_cleanup, r=oli-obk

Remove interior mutability in mir predecessors cache

4 years agoFix issues caused during rebasing
Paul Daniel Faria [Mon, 2 Dec 2019 14:40:03 +0000 (09:40 -0500)]
Fix issues caused during rebasing

4 years agoFix issues caused during rebasing
Paul Daniel Faria [Fri, 29 Nov 2019 23:36:16 +0000 (18:36 -0500)]
Fix issues caused during rebasing

4 years agoUse new HashStable proc macro
Paul Daniel Faria [Wed, 27 Nov 2019 15:54:49 +0000 (10:54 -0500)]
Use new HashStable proc macro

4 years agoFix tidy issues
Paul Daniel Faria [Mon, 25 Nov 2019 05:28:24 +0000 (00:28 -0500)]
Fix tidy issues

4 years agoFix rebasing errors, convert some BodyCache::body() calls to reborrows
Paul Daniel Faria [Mon, 25 Nov 2019 04:39:22 +0000 (23:39 -0500)]
Fix rebasing errors, convert some BodyCache::body() calls to reborrows

4 years agoFix type errors created during rebasing
Paul Daniel Faria [Thu, 21 Nov 2019 15:50:52 +0000 (10:50 -0500)]
Fix type errors created during rebasing

4 years agoRemove unchecked inline attribute, remove unused functions, make chache mod private...
Paul Daniel Faria [Wed, 20 Nov 2019 16:53:34 +0000 (11:53 -0500)]
Remove unchecked inline attribute, remove unused functions, make chache mod private again

4 years agoRemove inline attributes that hadn't been profiled, unexport Cache since it no longer...
Paul Daniel Faria [Wed, 20 Nov 2019 14:58:31 +0000 (09:58 -0500)]
Remove inline attributes that hadn't been profiled, unexport Cache since it no longer needs to be public

4 years agoFix type errors cause during rebasing
Paul Daniel Faria [Wed, 13 Nov 2019 05:35:45 +0000 (00:35 -0500)]
Fix type errors cause during rebasing

4 years agoCompute predecessors in mir_build query and use existing cache for generating ReadOnl...
Paul Daniel Faria [Wed, 13 Nov 2019 04:41:43 +0000 (23:41 -0500)]
Compute predecessors in mir_build query and use existing cache for generating ReadOnlyBodyCache, remove unneeded fns

4 years agoRemove files created during conflict resolution
Paul Daniel Faria [Wed, 6 Nov 2019 17:34:16 +0000 (12:34 -0500)]
Remove files created during conflict resolution

4 years agoFix typos caused during rebase
Paul Daniel Faria [Wed, 6 Nov 2019 17:29:09 +0000 (12:29 -0500)]
Fix typos caused during rebase

4 years agoRemove HasLocalDecls impl from BodyCache's, properly reborrow to Body, rename all...
Paul Daniel Faria [Wed, 6 Nov 2019 17:00:46 +0000 (12:00 -0500)]
Remove HasLocalDecls impl from BodyCache's, properly reborrow to Body, rename all body_cache back to body

4 years agoRemove BodyCache.body and rely on Deref as much as possible for ReadOnlyBodyCache
Paul Daniel Faria [Wed, 6 Nov 2019 05:04:53 +0000 (00:04 -0500)]
Remove BodyCache.body and rely on Deref as much as possible for ReadOnlyBodyCache

4 years agoUndo minor changes that weren't needed, fix one lifetime typo
Paul Daniel Faria [Tue, 5 Nov 2019 00:52:19 +0000 (19:52 -0500)]
Undo minor changes that weren't needed, fix one lifetime typo

4 years agoFix compilation errors created during rebase
Paul Daniel Faria [Mon, 4 Nov 2019 14:03:02 +0000 (09:03 -0500)]
Fix compilation errors created during rebase

4 years agoFix typo
Paul Daniel Faria [Mon, 28 Oct 2019 23:32:56 +0000 (19:32 -0400)]
Fix typo