Commit Graph

86155 Commits

Author SHA1 Message Date
Pietro Albini
c87c31b111
Rollup merge of #55916 - RalfJung:mut-visitor, r=oli-obk
Make miri value visitor usfeful for mutation

~~This is based on top of https://github.com/rust-lang/rust/pull/55716, [click here](https://github.com/RalfJung/rust/compare/escape-to-raw...RalfJung:mut-visitor) for just the new commits.~~

r? @oli-obk
2018-11-18 23:24:41 +01:00
Pietro Albini
131a7553e1
Rollup merge of #55894 - RalfJung:validation-enums, r=oli-obk
miri enum discriminant handling: Fix treatment of pointers, better error when it is undef

r? @oli-obk
2018-11-18 23:24:39 +01:00
Pietro Albini
3aeac24048
Rollup merge of #55867 - RalfJung:dont-panic, r=Mark-Simulacrum
do not panic just because cargo failed

Currently, a rustc ICE during bootstrap shows *two* backtraces with `RUST_BACKTRACE`. Fix that by making bootstrap just exit when cargo fails. This matches what we do [when building a tool fails](https://github.com/rust-lang/rust/blob/master/src/bootstrap/tool.rs#L189) and [when other stuff (not called through `stream_cargo`, like `cargo test`) fails](https://github.com/rust-lang/rust/blob/master/src/build_helper/lib.rs#L43).

Fixes https://github.com/rust-lang/rust/issues/53379
2018-11-18 23:24:38 +01:00
Pietro Albini
9577734ff3
Rollup merge of #55862 - zackmdavis:but_will_they_come_when_you_call_them, r=estebank
in which the E0618 "expected function" diagnostic gets a makeover

A woman of wisdom once told me, "Better late than never." (Can't reopen the previously-closed pull request from six months ago [due to GitHub limitations](https://github.com/rust-lang/rust/pull/51098#issuecomment-437647157).)

Now the main span focuses on the erroneous not-a-function callee, while showing the entire call expression is relegated to a secondary span. In the case where the erroneous callee is itself a call, we
point out the definition, and, if the call expression spans multiple lines, tentatively suggest a semicolon (because we suspect that the "outer" call is actually supposed to be a tuple).

![not_a_fn_1](https://user-images.githubusercontent.com/1076988/48309935-96755000-e538-11e8-9390-02a048abb0c2.png)

![not_a_fn_2](https://user-images.githubusercontent.com/1076988/48309936-98d7aa00-e538-11e8-8b9b-257bc77d6261.png)

The new `bug!` assertion is, in fact, safe (`confirm_builtin_call` is only called by `check_call`, which is only called with a first arg of kind `ExprKind::Call` in `check_expr_kind`).

Resolves #51055.

r? @estebank
2018-11-18 23:24:37 +01:00
Pietro Albini
7130947918
Rollup merge of #55857 - andjo403:rmdep, r=Mark-Simulacrum
remove unused dependency
2018-11-18 23:24:36 +01:00
Pietro Albini
4a52c5625c
Rollup merge of #55834 - ogoffart:union-abi, r=eddyb
Forward the ABI of the non-zero sized fields of an union if they have the same ABI

This is supposed to fix the performence regression of using MaybeUninit in
https://github.com/rust-lang/rust/pull/54668
2018-11-18 23:24:34 +01:00
Pietro Albini
9c3e8d340f
Rollup merge of #55827 - ljedrz:various_stashed, r=alexcrichton
A few tweaks to iterations/collecting

- simplify and speed up `dot::GraphWalk::nodes` for `cfg::CFG`
- `reserve` the capacity for `edges` in `DepGraph::query`
- collect directly to a `HirVec` in `LoweringContext::lower_attrs`
- fix overallocation in `OnDiskCache::serialize`
- preallocate the `new_partitioning` vector in `merge_codegen_units`
- simplify `impl FromHex for str`
- improve the creation of `self_arg_names` in `impl MethodDef`
2018-11-18 23:24:33 +01:00
Pietro Albini
21ff709954
Rollup merge of #55564 - smaeul:test-fixes-2, r=alexcrichton
test/linkage-visibility: Ignore on musl targets

DynamicLibrary uses libc's dlsym() function internally to find symbols.
Some implementations of dlsym(), like musl's, only look at dynamically-
exported symbols, as found in shared libraries. To also export symbols
from the main executable, pass --export-dynamic to the linker.

(Plus see [here](https://stackoverflow.com/questions/4184017) and [here](https://stackoverflow.com/questions/6121838) for examples of where this is necessary on glibc as well.)
2018-11-18 23:24:32 +01:00
Pietro Albini
36e1d9f3ed
Rollup merge of #55562 - smaeul:powerpc-linux-musl, r=alexcrichton
Add powerpc- and powerpc64-unknown-linux-musl targets

Add targets for musl on 32-bit and 64-bit powerpc. This requires some ABI fixes, as musl [uses the ELFv2 ABI on regardless of endianness](http://git.musl-libc.org/cgit/musl/tree/configure?id=8084d6ab57cdb0b8f328d3cdbad3b9d09eaaee04#n638). At the moment, powerpc64 support requires [an LLVM patch](https://reviews.llvm.org/D52013) to select the correct ABI; or I can add [a patch to Rust's LLVM backend](e8eaa2afd5) to always choose the right ABI.

Both architectures are able to run an extended bootstrap, and with some test fixes (e.g. #55561), there are no architecture-dependent test failures on powerpc64 (most failures in `src/test` are existing musl-host-related issues).
2018-11-18 23:24:31 +01:00
bors
13c9439925 Auto merge of #56017 - alexcrichton:debug-test, r=alexcrichton
std: Add debugging for a failing test on appveyor

I'm not sure why this is failing, so let's hopefully get some more
information to help investigation!
2018-11-18 17:27:45 +00:00
bors
d1c2cbf90a Auto merge of #55999 - alexcrichton:update-cargo, r=nrc
Update Cargo submodule

Brings in some fixes and stabilizations!
2018-11-18 14:33:03 +00:00
Alex Crichton
7a99b6db15 std: Add debugging for a failing test on appveyor
I'm not sure why this is failing, so let's hopefully get some more
information to help investigation!
2018-11-17 19:38:53 -08:00
bors
f37247f885 Auto merge of #56003 - nikomatsakis:issue-54467-infer-outlives-bounds-and-trait-objects, r=eddyb
do not propagate inferred bounds on trait objects if they involve `Self`

Fixes #54467, which is a Rust 2018 Release blocking issue.

r? @eddyb
2018-11-17 13:19:42 +00:00
Alex Crichton
01127ca666 Update Cargo submodule
Brings in some fixes and stabilizations!
2018-11-17 00:53:31 -08:00
Ralf Jung
a7b312f825 erase the tag on casts involving (raw) pointers 2018-11-17 09:08:30 +01:00
bors
f6e9485bfc Auto merge of #55627 - sunfishcode:cg-llvm-gen, r=nikomatsakis
rustc_codegen_llvm: traitification of LLVM-specific CodegenCx and Builder methods

This PR is the continuation of #54012 and earlier PRs, in the grand plan of #45274 to allow for multiple codegen backends.

High-level summary: interpose a set of traits between Rust's codegen logic and the LLVM APIs, allowing another backend to implement the traits and share most of the codegen logic. These traits are currently somewhat LLVM-specific, but once this refactoring is in place, they can evolve to be more general.

See [this README](756f84d7ce/src/librustc_codegen_ssa/README.md) for a writeup on the current trait organization.
2018-11-17 04:10:52 +00:00
bors
ee821736cc Auto merge of #55936 - nrc:save-rename, r=eddyb
save-analysis: be even more aggressive about ignorning macro-generated defs

r? @eddyb
2018-11-16 21:11:24 +00:00
Niko Matsakis
6575988d8e handle trait objects formed from traits with Self::Foo: 'a clauses 2018-11-16 09:37:33 -05:00
Niko Matsakis
0d744ec6ec improve debug output related to bound calculation 2018-11-16 09:37:32 -05:00
Eduard-Mihai Burtescu
756f84d7ce [eddyb] rustc_codegen_llvm: remove unused parametrization of CodegenCx and Builder over Values. 2018-11-16 15:08:18 +02:00
Eduard-Mihai Burtescu
0b569249c8 [eddyb] rustc_codegen_ssa: rename interfaces to traits. 2018-11-16 15:08:18 +02:00
Eduard-Mihai Burtescu
d1410ada92 [eddyb] rustc_codegen_ssa: avoid a Clone bound on TargetMachine. 2018-11-16 15:08:18 +02:00
Eduard-Mihai Burtescu
47c84c4234 [eddyb] rustc_codegen_llvm: remove unnecessary 'a from LlvmCodegenBackend impls. 2018-11-16 15:08:18 +02:00
Eduard-Mihai Burtescu
9f49a2626e [eddyb] rustc_codegen_utils: remove extraneous #![allow(dead_code)]. 2018-11-16 15:08:18 +02:00
Eduard-Mihai Burtescu
9bb6663431 [eddyb] rustc_codegen_ssa: handle LLVM unsafety correctly. 2018-11-16 15:08:18 +02:00
Denis Merigoux
bf7f8cd3fc Added README explaining the refactoring 2018-11-16 15:08:18 +02:00
Denis Merigoux
b9e5cf99a9 Separating the back folder between backend-agnostic and LLVM-specific code 2018-11-16 15:08:18 +02:00
Denis Merigoux
b25b804013 Added default impl for DerivedTypeMethods + empty impl for Cranelift BaseTypeMethods 2018-11-16 15:08:18 +02:00
Denis Merigoux
54dd3a47fd All Builder methods now take &mut self instead of &self 2018-11-16 15:08:18 +02:00
Denis Merigoux
1ebdfbb026 Added some docs + start to &mut self builder methods 2018-11-16 15:08:18 +02:00
Denis Merigoux
015e4441f5 Finished moving backend-agnostic code to rustc_codegen_ssa 2018-11-16 15:08:18 +02:00
Denis Merigoux
c0a428ee70 Great separation of librustc_codegen_llvm: librustc_codegen_ssa compiles 2018-11-16 15:07:24 +02:00
Denis Merigoux
915382f730 Moved DeclareMethods, MiscMethods and StaticMethods 2018-11-16 14:55:47 +02:00
Denis Merigoux
c9f26c2155 Beginning of moving all backend-agnostic code to rustc_codegen_ssa 2018-11-16 14:55:42 +02:00
Denis Merigoux
b02e5cce16 Moved Backend interface into rustc_codegen_utils 2018-11-16 14:40:16 +02:00
Eduard-Mihai Burtescu
b06836e71a [eddyb/rebase cleanup] move type_{needs_drop,is_sized,is_freeze} to rustc_codegen_utils 2018-11-16 14:40:16 +02:00
Eduard-Mihai Burtescu
35b40f51fb [eddyb/rebase cleanup] abstracted Funclet 2018-11-16 14:40:12 +02:00
Denis Merigoux
566fa4d003 Moved common.rs enums 2018-11-16 14:38:19 +02:00
Denis Merigoux
39fd4d9274 Starting to move backend-agnostic code into codegen_utils
IntPredicate moved
2018-11-16 14:38:19 +02:00
Denis Merigoux
4ba09ab8d2 Added compile codegen to backend trait 2018-11-16 14:38:19 +02:00
Denis Merigoux
6819e6e6e1 Preparing the generalization of base:compile_coodegen_unit 2018-11-16 14:38:15 +02:00
Denis Merigoux
91a2a80692 Renamed lifetimes for better understanding 2018-11-16 14:36:43 +02:00
Denis Merigoux
8d530db2c5 Generalized base:codegen_crate 2018-11-16 14:36:43 +02:00
Denis Merigoux
97825a36be Move doc to trait declarations 2018-11-16 14:36:38 +02:00
Denis Merigoux
ac34068ed9 Generalized base:maybe_create_entry_wrapper 2018-11-16 14:34:26 +02:00
Denis Merigoux
b14f3e5490 Adapt code to latest rustc master changes 2018-11-16 14:34:26 +02:00
Denis Merigoux
441a7c1092 Generalized mono_item.rs and base.rs:codegen_instance 2018-11-16 14:34:26 +02:00
Denis Merigoux
6a993fe353 Generalized mir::codegen_mir (and all subsequent functions) 2018-11-16 14:33:10 +02:00
Denis Merigoux
cbe31a4229 Generalized base::coerce_unsized_into 2018-11-16 14:15:13 +02:00
Denis Merigoux
78dd95f4c7 Generalized base::unsize_thin_ptr 2018-11-16 14:15:13 +02:00