]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoEncode a custom "producers" section in wasm files
Alex Crichton [Mon, 19 Nov 2018 20:05:21 +0000 (12:05 -0800)]
Encode a custom "producers" section in wasm files

This commit implements WebAssembly/tool-conventions#65 for wasm files
produced by the Rust compiler. This adds a bit of metadata to wasm
modules to indicate that the file's language includes Rust and the
file's "processed-by" tools includes rustc.

The thinking with this section is to eventually have telemetry in
browsers tracking all this.

5 years agoAuto merge of #56051 - pietroalbini:rollup, r=pietroalbini
bors [Mon, 19 Nov 2018 14:07:45 +0000 (14:07 +0000)]
Auto merge of #56051 - pietroalbini:rollup, r=pietroalbini

Rollup of 25 pull requests

Successful merges:

 - #55562 (Add powerpc- and powerpc64-unknown-linux-musl targets)
 - #55564 (test/linkage-visibility: Ignore on musl targets)
 - #55827 (A few tweaks to iterations/collecting)
 - #55834 (Forward the ABI of the non-zero sized fields of an union if they have the same ABI)
 - #55857 (remove unused dependency)
 - #55862 (in which the E0618 "expected function" diagnostic gets a makeover)
 - #55867 (do not panic just because cargo failed)
 - #55894 (miri enum discriminant handling: Fix treatment of pointers, better error when it is undef)
 - #55916 (Make miri value visitor useful for mutation)
 - #55919 (core/tests/num: Simplify `test_int_from_str_overflow()` test code)
 - #55923 (reword #[test] attribute error on fn items)
 - #55949 (ty: return impl Iterator from Predicate::walk_tys)
 - #55952 (Update to Clang 7 on CI.)
 - #55953 (#53488 Refactoring UpvarId)
 - #55962 (rustdoc: properly calculate spans for intra-doc link resolution errors)
 - #55963 (Stress test for MPSC)
 - #55968 (Clean up some non-mod-rs stuff.)
 - #55970 (Miri backtrace improvements)
 - #56007 (CTFE: dynamically make sure we do not call non-const-fn)
 - #56011 (Replace data.clone() by Arc::clone(&data) in mutex doc.)
 - #56012 (avoid shared ref in UnsafeCell::get)
 - #56016 (Add VecDeque::resize_with)
 - #56027 (docs: Add missing backtick in object_safety.rs docs)
 - #56043 (remove "approx env bounds" if we already know from trait)
 - #56059 (Increase `Duration` approximate equal threshold to 1us)

5 years agoRollup merge of #56059 - alexcrichton:fix-tests, r=sfackler
kennytm [Mon, 19 Nov 2018 08:20:13 +0000 (16:20 +0800)]
Rollup merge of #56059 - alexcrichton:fix-tests, r=sfackler

Increase `Duration` approximate equal threshold to 1us

Previously this threshold when testing was 100ns, but the Windows
documentation states:

> which is a high resolution (<1us) time stamp

which presumably means that we could have up to 1us resolution, which
means that 100ns doesn't capture "equivalent" time intervals due to
various bits of rounding here and there.

It's hoped that this..

Closes #56034

5 years agoRollup merge of #56043 - nikomatsakis:issue-55756-via-outlives, r=eddyb
Pietro Albini [Sun, 18 Nov 2018 22:25:00 +0000 (23:25 +0100)]
Rollup merge of #56043 - nikomatsakis:issue-55756-via-outlives, r=eddyb

remove "approx env bounds" if we already know from trait

Alternative to https://github.com/rust-lang/rust/pull/55988 that fixes #55756 -- smaller fix that I cannot see having (correctness) repercussions beyond the test at hand, and hence better for backporting. (Famous last words, I know.)

r? @eddyb

5 years agoRollup merge of #56027 - Xanewok:docs-backtick, r=QuietMisdreavus
Pietro Albini [Sun, 18 Nov 2018 22:24:59 +0000 (23:24 +0100)]
Rollup merge of #56027 - Xanewok:docs-backtick, r=QuietMisdreavus

docs: Add missing backtick in object_safety.rs docs

Closes #56019.

r? @bjorn3

5 years agoRollup merge of #56016 - scottmcm:vecdeque-resize-with, r=joshtriplett
Pietro Albini [Sun, 18 Nov 2018 22:24:58 +0000 (23:24 +0100)]
Rollup merge of #56016 - scottmcm:vecdeque-resize-with, r=joshtriplett

Add VecDeque::resize_with

This already exists on `Vec`; I'm just adding it to `VecDeque`.

I wanted to resize a `VecDeque<Vec<T>>` when I didn't know `T: Clone`, so I couldn't use `.resize(n, Vec::new())`.  With this I could do `.resize_with(n, Vec::new)` instead, which doesn't need `T: Clone`.

Tracking issue: https://github.com/rust-lang/rust/issues/41758

5 years agoRollup merge of #56012 - RalfJung:unsafe-cell, r=nikomatsakis
Pietro Albini [Sun, 18 Nov 2018 22:24:57 +0000 (23:24 +0100)]
Rollup merge of #56012 - RalfJung:unsafe-cell, r=nikomatsakis

avoid shared ref in UnsafeCell::get

Avoid taking a shared reference in `UnsafeCell::get`. This *should* be taking a raw reference (see https://github.com/rust-lang/rfcs/pull/2582), but that operation is not currently available, so I propose we exploit `repr(transparent)` instead and cast the pointer around.

This is required to make `UnsafeCell::get` pass the [stacked borrows implementation](https://www.ralfj.de/blog/2018/11/16/stacked-borrows-implementation.html) in miri (currently, `UnsafeCell::get` is on a whitelist, but that is of course not very satisfying). It shouldn't affect normal execution/codegen. Would be great if we could get this landed and shrink miri's whitelist!

Cc @nikomatsakis

5 years agoRollup merge of #56011 - CBenoit:master, r=QuietMisdreavus
Pietro Albini [Sun, 18 Nov 2018 22:24:56 +0000 (23:24 +0100)]
Rollup merge of #56011 - CBenoit:master, r=QuietMisdreavus

Replace data.clone() by Arc::clone(&data) in mutex doc.

Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.
Since this clone is visible in the official documentation, I thought it could be better to use the more idiomatic version.

5 years agoRollup merge of #56007 - RalfJung:non-const-call, r=oli-obk
Pietro Albini [Sun, 18 Nov 2018 22:24:54 +0000 (23:24 +0100)]
Rollup merge of #56007 - RalfJung:non-const-call, r=oli-obk

CTFE: dynamically make sure we do not call non-const-fn

I'd love to have a test case for this, but I don't know how.

I am also really surprised by this test case that changed behavior: Why did it even start execution if it already determined that it shouldn't?!?

r? @oli-obk

5 years agoRollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obk
Pietro Albini [Sun, 18 Nov 2018 22:24:53 +0000 (23:24 +0100)]
Rollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obk

Miri backtrace improvements

Nicer pretty-printing of the `RUST_CTFE_BACKTRACE`-backtraces:
```
  0: backtrace::backtrace::libunwind::trace::hc410fcb66fe85b11
           at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/libunwind.rs:53
     backtrace::backtrace::trace::h2106294a22648407
           at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/mod.rs:42
  1: backtrace::capture::Backtrace::new_unresolved::h5d8d98b993d092ba
           at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/capture.rs:88
  2: <rustc::mir::interpret::error::EvalError<'tcx> as core::convert::From<rustc::mir::interpret::error::EvalErrorKind<'tcx, u64>>>::from::h6355269b2a661412
           at librustc/mir/interpret/error.rs:236
  3: <T as core::convert::Into<U>>::into::h70fcb917509539bd
           at /home/r/src/rust/rustc.2/src/libcore/convert.rs:455
  4: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::emulate_foreign_item::h9cde0e3ce7455a4a
           at src/fn_call.rs:292
  5: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::find_fn::h83f89524b9d1a49a
           at src/fn_call.rs:74
  6: <miri::Evaluator<'tcx> as rustc_mir::interpret::machine::Machine<'a, 'mir, 'tcx>>::find_fn::hf9980473c4775f0c
           at src/lib.rs:345
     rustc_mir::interpret::terminator::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_fn_call::h401dec4a687f96e9
           at /home/r/src/rust/rustc.2/src/librustc_mir/interpret/terminator.rs:285
```
Indentation is now consistent with `RUST_BACKTRACE`, and the frame number is not repeated when there are multiple symbols for a frame.

Also preserve the `ty::Instance` for the internal backtrace (showing which frames in the user code where on the interpreter stack when the error happened), used by miri to avoid printing spans for libstd internals:
```
error[E0080]: constant evaluation error: the evaluated program panicked
   --> /home/r/src/rust/rustc.2/src/libstd/panicking.rs:525:9
    |
525 |         __rust_start_panic(obj as usize)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked
    |
    = note: inside call to `std::panicking::rust_panic` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:496:5
    = note: inside call to `std::panicking::rust_panic_with_hook` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:390:5
    = note: inside call to `std::panicking::continue_panic_fmt` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:345:5
note: inside call to `std::rt::begin_panic_fmt` at <::std::macros::panic macros>:8:1
   --> tests/compile-fail/panic.rs:4:5
    |
4   |     assert_eq!(5, 6);
    |     ^^^^^^^^^^^^^^^^^
    = note: inside call to `main` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:34
    = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:75
    = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/sys_common/backtrace.rs:136:5
    = note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1913 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:13
    = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:310:40
    = note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:306:5
    = note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>` at /home/r/src/rust/rustc.2/src/libstd/panic.rs:398:9
    = note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:58:25
    = note: inside call to `std::rt::lang_start_internal` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:5
    = note: inside call to `std::rt::lang_start::<()>`
```
Also notice that we show filenames and line numbers here now.

r? @oli-obk

5 years agoRollup merge of #55968 - ehuss:non-mod-rs-tests, r=petrochenkov
Pietro Albini [Sun, 18 Nov 2018 22:24:52 +0000 (23:24 +0100)]
Rollup merge of #55968 - ehuss:non-mod-rs-tests, r=petrochenkov

Clean up some non-mod-rs stuff.

This includes the following:
- Remove unused `non_modrs_mods` from `ParseSess` which as only used for feature gate diagnostics.
- Remove the vestiges of the feature gate tests in `test/ui`, they were only partially removed during stabilization.
- Fix the run-pass test, it was accidentally removed during stabilization.
- Add a ui test to verify error behavior for missing inline-nested mods.
- Add some tests for `#[path]` for inline-nested mods (both mod and non-mod-rs).
- Enable the diagnostic tests on windows, they should be fixed by #49478.

cc @cramertj

5 years agoRollup merge of #55963 - stepancheg:mpsc-take-2, r=alexcrichton
Pietro Albini [Sun, 18 Nov 2018 22:24:51 +0000 (23:24 +0100)]
Rollup merge of #55963 - stepancheg:mpsc-take-2, r=alexcrichton

Stress test for MPSC

`concurrent_recv_timeout_and_upgrade` reproduces a problem 100%
times on my MacBook with command:

```
./x.py test --stage 0 ./src/test/run-pass/mpsc_stress.rs
```

Thus it is commented out.

Other tests cases were useful for catching another test cases
which may arise during the fix.

This diff is a part of my previous rewrite attempt: #42883

CC #39364

5 years agoRollup merge of #55962 - QuietMisdreavus:tricky-spans, r=GuillaumeGomez
Pietro Albini [Sun, 18 Nov 2018 22:24:49 +0000 (23:24 +0100)]
Rollup merge of #55962 - QuietMisdreavus:tricky-spans, r=GuillaumeGomez

rustdoc: properly calculate spans for intra-doc link resolution errors

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

When rustdoc is reporting a resolution error for intra-doc links, it needs to convert a span from one relative to the *markdown* (as the links are only found on the final markdown text) to one relative to the *source code* (as the error reporting is meant to show where the line is in the source, so the user can fix it). However, a calculation for how much "offset" to apply had a subtle error: it trimmed the whole line when attempting to account for leading indentation. This caused it to add in *trailing* whitespace into this calculation, which created an incorrect span.

In a lot of situations, this isn't a problem - the span will be shifted in the code slightly, but the warning will still be displayed and mostly legible. However, there is one important situation where this can cause an ICE: multi-byte codepoints. If a shifted span now has a starting point in the middle of a multi-byte codepoint, libsyntax will panic when trying to track what source item it corresponds to. This flew under our radar because trailing whitespace and multi-byte codepoints are both situations that we don't run into in the compiler repo.

(There is one more situation where this can error, that will be much harder to fix: block-style doc comments. Lines in a block-style doc comment have a zero-or-more (usually one) character offset per line, causing this calculation to be way off. I'm punting that to another issue, though...)

5 years agoRollup merge of #55953 - blitzerr:master, r=nikomatsakis
Pietro Albini [Sun, 18 Nov 2018 22:24:48 +0000 (23:24 +0100)]
Rollup merge of #55953 - blitzerr:master, r=nikomatsakis

#53488 Refactoring UpvarId

5 years agoRollup merge of #55952 - michaelwoerister:newer-clang, r=alexcrichton
Pietro Albini [Sun, 18 Nov 2018 22:24:47 +0000 (23:24 +0100)]
Rollup merge of #55952 - michaelwoerister:newer-clang, r=alexcrichton

Update to Clang 7 on CI.

Handles Linux and macOS. Windows seems to already have been updated.

r? @Mark-Simulacrum
cc @rust-lang/infra

5 years agoRollup merge of #55949 - ljedrz:return_impl_Iterator_from_Predicate_walk_tys, r=oli-obk
Pietro Albini [Sun, 18 Nov 2018 22:24:46 +0000 (23:24 +0100)]
Rollup merge of #55949 - ljedrz:return_impl_Iterator_from_Predicate_walk_tys, r=oli-obk

ty: return impl Iterator from Predicate::walk_tys

Fixes the lazyboye `FIXME` by returning a custom `Iterator` as intended by the original author of the function.

It is indeed a bit convoluted, so I'm ok with not changing this if perf results are not favourable enough. Also happy to adjust any names if need be.

5 years agoIncrease `Duration` approximate equal threshold to 1us
Alex Crichton [Mon, 19 Nov 2018 03:08:06 +0000 (19:08 -0800)]
Increase `Duration` approximate equal threshold to 1us

Previously this threshold when testing was 100ns, but the Windows
documentation states:

> which is a high resolution (<1us) time stamp

which presumably means that we could have up to 1us resolution, which
means that 100ns doesn't capture "equivalent" time intervals due to
various bits of rounding here and there.

It's hoped that this..

Closes #56034

5 years agoAuto merge of #56042 - petrochenkov:nuni, r=petrochenkov
bors [Mon, 19 Nov 2018 02:59:29 +0000 (02:59 +0000)]
Auto merge of #56042 - petrochenkov:nuni, r=petrochenkov

[nightly] resolve: Implement uniform paths 2.0

Forward-port of https://github.com/rust-lang/rust/pull/55884 to nightly.

r? @ghost

5 years agoRollup merge of #55923 - Zeegomo:master, r=estebank
Pietro Albini [Sun, 18 Nov 2018 22:24:43 +0000 (23:24 +0100)]
Rollup merge of #55923 - Zeegomo:master, r=estebank

reword #[test] attribute error on fn items

fix of [#55787](https://github.com/rust-lang/rust/issues/55787)
Reworded error message from "#[test] attribute is only allowed on fn items" to "#[test] attribute is only allowed on non associated functions"

5 years agoRollup merge of #55919 - Turbo87:num-tests, r=dtolnay
Pietro Albini [Sun, 18 Nov 2018 22:24:42 +0000 (23:24 +0100)]
Rollup merge of #55919 - Turbo87:num-tests, r=dtolnay

core/tests/num: Simplify `test_int_from_str_overflow()` test code

This commit changes the test code to compare against easier-to-read, static values instead of relying on the result of `wrapping_add()` which may or may not result in the value that we expect.

5 years agoRollup merge of #55916 - RalfJung:mut-visitor, r=oli-obk
Pietro Albini [Sun, 18 Nov 2018 22:24:41 +0000 (23:24 +0100)]
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

5 years agoRollup merge of #55894 - RalfJung:validation-enums, r=oli-obk
Pietro Albini [Sun, 18 Nov 2018 22:24:39 +0000 (23:24 +0100)]
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

5 years agoRollup merge of #55867 - RalfJung:dont-panic, r=Mark-Simulacrum
Pietro Albini [Sun, 18 Nov 2018 22:24:38 +0000 (23:24 +0100)]
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

5 years agoRollup merge of #55862 - zackmdavis:but_will_they_come_when_you_call_them, r=estebank
Pietro Albini [Sun, 18 Nov 2018 22:24:37 +0000 (23:24 +0100)]
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

5 years agoRollup merge of #55857 - andjo403:rmdep, r=Mark-Simulacrum
Pietro Albini [Sun, 18 Nov 2018 22:24:36 +0000 (23:24 +0100)]
Rollup merge of #55857 - andjo403:rmdep, r=Mark-Simulacrum

remove unused dependency

5 years agoRollup merge of #55834 - ogoffart:union-abi, r=eddyb
Pietro Albini [Sun, 18 Nov 2018 22:24:34 +0000 (23:24 +0100)]
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

5 years agoRollup merge of #55827 - ljedrz:various_stashed, r=alexcrichton
Pietro Albini [Sun, 18 Nov 2018 22:24:33 +0000 (23:24 +0100)]
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`

5 years agoRollup merge of #55564 - smaeul:test-fixes-2, r=alexcrichton
Pietro Albini [Sun, 18 Nov 2018 22:24:32 +0000 (23:24 +0100)]
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.)

5 years agoRollup merge of #55562 - smaeul:powerpc-linux-musl, r=alexcrichton
Pietro Albini [Sun, 18 Nov 2018 22:24:31 +0000 (23:24 +0100)]
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](https://github.com/smaeul/rust/commit/e8eaa2afd51ed9950096359a040ba1603907cdd1) 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).

5 years agoAuto merge of #55672 - RalfJung:miri-extern-types, r=eddyb
bors [Sun, 18 Nov 2018 22:19:53 +0000 (22:19 +0000)]
Auto merge of #55672 - RalfJung:miri-extern-types, r=eddyb

miri: accept extern types in structs if they are the only field

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

Cc @oli-obk @eddyb https://github.com/rust-lang/rust/issues/43467

5 years agoremove "approx env bounds" if we already know from trait
Niko Matsakis [Sun, 18 Nov 2018 15:07:25 +0000 (10:07 -0500)]
remove "approx env bounds" if we already know from trait

5 years agoAuto merge of #56017 - alexcrichton:debug-test, r=alexcrichton
bors [Sun, 18 Nov 2018 17:27:45 +0000 (17:27 +0000)]
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!

5 years agoAuto merge of #55999 - alexcrichton:update-cargo, r=nrc
bors [Sun, 18 Nov 2018 14:33:03 +0000 (14:33 +0000)]
Auto merge of #55999 - alexcrichton:update-cargo, r=nrc

Update Cargo submodule

Brings in some fixes and stabilizations!

5 years agoFix rebase
Vadim Petrochenkov [Sun, 18 Nov 2018 11:41:06 +0000 (14:41 +0300)]
Fix rebase

5 years agoAdd a couple more tests + address review comments
Vadim Petrochenkov [Sat, 17 Nov 2018 17:34:25 +0000 (20:34 +0300)]
Add a couple more tests + address review comments

5 years agoresolve: Refactor away `DeterminacyExt`
Vadim Petrochenkov [Sat, 17 Nov 2018 17:13:25 +0000 (20:13 +0300)]
resolve: Refactor away `DeterminacyExt`

5 years agoresolve: Future-proof against imports referring to local variables and generic parameters
Vadim Petrochenkov [Sat, 17 Nov 2018 17:00:00 +0000 (20:00 +0300)]
resolve: Future-proof against imports referring to local variables and generic parameters

5 years agoresolve: Avoid sentence breaks in diagnostics
Vadim Petrochenkov [Tue, 13 Nov 2018 23:52:26 +0000 (02:52 +0300)]
resolve: Avoid sentence breaks in diagnostics

5 years agoresolve: Support resolving macros without leaving traces
Vadim Petrochenkov [Tue, 13 Nov 2018 23:20:59 +0000 (02:20 +0300)]
resolve: Support resolving macros without leaving traces

5 years agoresolve: Avoid marking `extern crate` items as used in certain cases
Vadim Petrochenkov [Tue, 13 Nov 2018 23:17:40 +0000 (02:17 +0300)]
resolve: Avoid marking `extern crate` items as used in certain cases

5 years agoresolve: Reintroduce feature gate for uniform paths in imports
Vadim Petrochenkov [Mon, 12 Nov 2018 00:58:39 +0000 (03:58 +0300)]
resolve: Reintroduce feature gate for uniform paths in imports

5 years agoFix ICEs from imports of items not defined in modules
Vadim Petrochenkov [Sun, 11 Nov 2018 17:28:56 +0000 (20:28 +0300)]
Fix ICEs from imports of items not defined in modules

5 years agoresolve: Tweak some articles in ambiguity diagnostics
Vadim Petrochenkov [Sun, 11 Nov 2018 16:46:04 +0000 (19:46 +0300)]
resolve: Tweak some articles in ambiguity diagnostics

5 years agoresolve: Recover "did you mean" suggestions in imports
Vadim Petrochenkov [Sun, 11 Nov 2018 14:35:23 +0000 (17:35 +0300)]
resolve: Recover "did you mean" suggestions in imports

5 years agoresolve: Check resolution consistency for import paths and multi-segment macro paths
Vadim Petrochenkov [Sat, 10 Nov 2018 15:58:37 +0000 (18:58 +0300)]
resolve: Check resolution consistency for import paths and multi-segment macro paths

5 years agoresolve: Resolve single-segment imports using in-scope resolution on 2018 edition
Vadim Petrochenkov [Thu, 8 Nov 2018 22:29:07 +0000 (01:29 +0300)]
resolve: Resolve single-segment imports using in-scope resolution on 2018 edition

5 years agoresolve: More precise determinacy tracking during import/macro resolution
Vadim Petrochenkov [Wed, 7 Nov 2018 21:39:07 +0000 (00:39 +0300)]
resolve: More precise determinacy tracking during import/macro resolution

5 years agoresolve: Improve diagnostics for resolution ambiguities
Vadim Petrochenkov [Sun, 4 Nov 2018 22:11:59 +0000 (01:11 +0300)]
resolve: Improve diagnostics for resolution ambiguities

5 years agoresolve: Simplify ambiguity checking for built-in attributes
Vadim Petrochenkov [Sun, 4 Nov 2018 22:00:31 +0000 (01:00 +0300)]
resolve: Simplify ambiguity checking for built-in attributes

5 years agoresolve: Resolve multi-segment imports using in-scope resolution on 2018 edition
Vadim Petrochenkov [Sat, 3 Nov 2018 19:02:36 +0000 (22:02 +0300)]
resolve: Resolve multi-segment imports using in-scope resolution on 2018 edition

5 years agoresolve: Stop generating uniform path canaries
Vadim Petrochenkov [Sat, 3 Nov 2018 16:41:44 +0000 (19:41 +0300)]
resolve: Stop generating uniform path canaries

5 years agoAdd VecDeque::resize_with
Scott McMurray [Sat, 17 Nov 2018 08:31:34 +0000 (00:31 -0800)]
Add VecDeque::resize_with

5 years agostd: Add debugging for a failing test on appveyor
Alex Crichton [Sat, 17 Nov 2018 09:50:38 +0000 (01:50 -0800)]
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!

5 years agodocs: Add missing backtick in object_safety.rs docs
Igor Matuszewski [Sat, 17 Nov 2018 16:40:58 +0000 (17:40 +0100)]
docs: Add missing backtick in object_safety.rs docs

Closes #56019.

5 years agoAuto merge of #56003 - nikomatsakis:issue-54467-infer-outlives-bounds-and-trait-objec...
bors [Sat, 17 Nov 2018 13:19:42 +0000 (13:19 +0000)]
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

5 years agotidy check fix
giacomo [Sat, 17 Nov 2018 11:28:04 +0000 (12:28 +0100)]
tidy check fix

5 years agoadd test for #[test] attribute only allowed on non associated functions
giacomo [Sat, 17 Nov 2018 10:39:58 +0000 (11:39 +0100)]
add test for #[test] attribute only allowed on non associated functions

5 years agoadd comment explaining why what we do is legal
Ralf Jung [Sat, 17 Nov 2018 09:20:28 +0000 (10:20 +0100)]
add comment explaining why what we do is legal

5 years agoUpdate Cargo submodule
Alex Crichton [Fri, 16 Nov 2018 11:08:23 +0000 (03:08 -0800)]
Update Cargo submodule

Brings in some fixes and stabilizations!

5 years agoerase the tag on casts involving (raw) pointers
Ralf Jung [Sat, 17 Nov 2018 08:08:30 +0000 (09:08 +0100)]
erase the tag on casts involving (raw) pointers

5 years agoAuto merge of #55627 - sunfishcode:cg-llvm-gen, r=nikomatsakis
bors [Sat, 17 Nov 2018 04:10:52 +0000 (04:10 +0000)]
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](https://github.com/rust-lang/rust/blob/756f84d7cef90b7364ae88ca707e59670dde4c92/src/librustc_codegen_ssa/README.md) for a writeup on the current trait organization.

5 years agoavoid shared ref in UnsafeCell::get
Ralf Jung [Fri, 16 Nov 2018 21:17:26 +0000 (22:17 +0100)]
avoid shared ref in UnsafeCell::get

5 years agoAuto merge of #55936 - nrc:save-rename, r=eddyb
bors [Fri, 16 Nov 2018 21:11:24 +0000 (21:11 +0000)]
Auto merge of #55936 - nrc:save-rename, r=eddyb

save-analysis: be even more aggressive about ignorning macro-generated defs

r? @eddyb

5 years agoadjust remaining tests
Ralf Jung [Fri, 16 Nov 2018 17:38:28 +0000 (18:38 +0100)]
adjust remaining tests

5 years agoReplace data.clone() by Arc::clone(&data) in mutex doc.
Benoît C [Fri, 16 Nov 2018 20:34:12 +0000 (15:34 -0500)]
Replace data.clone() by Arc::clone(&data) in mutex doc.

Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.

5 years agoCTFE: dynamically make sure we do not call non-const-fn
Ralf Jung [Fri, 16 Nov 2018 17:05:08 +0000 (18:05 +0100)]
CTFE: dynamically make sure we do not call non-const-fn

5 years agohandle trait objects formed from traits with `Self::Foo: 'a` clauses
Niko Matsakis [Fri, 16 Nov 2018 13:58:55 +0000 (08:58 -0500)]
handle trait objects formed from traits with `Self::Foo: 'a` clauses

5 years agoimprove debug output related to bound calculation
Niko Matsakis [Fri, 16 Nov 2018 13:25:46 +0000 (08:25 -0500)]
improve debug output related to bound calculation

5 years ago[eddyb] rustc_codegen_llvm: remove unused parametrization of `CodegenCx` and `Builder...
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:48:26 +0000 (13:48 +0200)]
[eddyb] rustc_codegen_llvm: remove unused parametrization of `CodegenCx` and `Builder` over `Value`s.

5 years ago[eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:45:28 +0000 (13:45 +0200)]
[eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`.

5 years ago[eddyb] rustc_codegen_ssa: avoid a `Clone` bound on `TargetMachine`.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:39:56 +0000 (13:39 +0200)]
[eddyb] rustc_codegen_ssa: avoid a `Clone` bound on `TargetMachine`.

5 years ago[eddyb] rustc_codegen_llvm: remove unnecessary `'a` from `LlvmCodegenBackend` impls.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:37:55 +0000 (13:37 +0200)]
[eddyb] rustc_codegen_llvm: remove unnecessary `'a` from `LlvmCodegenBackend` impls.

5 years ago[eddyb] rustc_codegen_utils: remove extraneous `#![allow(dead_code)]`.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:37:17 +0000 (13:37 +0200)]
[eddyb] rustc_codegen_utils: remove extraneous `#![allow(dead_code)]`.

5 years ago[eddyb] rustc_codegen_ssa: handle LLVM unsafety correctly.
Eduard-Mihai Burtescu [Fri, 16 Nov 2018 11:33:28 +0000 (13:33 +0200)]
[eddyb] rustc_codegen_ssa: handle LLVM unsafety correctly.

5 years agoAdded README explaining the refactoring
Denis Merigoux [Mon, 22 Oct 2018 16:35:28 +0000 (18:35 +0200)]
Added README explaining the refactoring

5 years agoSeparating the back folder between backend-agnostic and LLVM-specific code
Denis Merigoux [Tue, 23 Oct 2018 15:01:35 +0000 (17:01 +0200)]
Separating the back folder between backend-agnostic and LLVM-specific code

5 years agoAdded default impl for DerivedTypeMethods + empty impl for Cranelift BaseTypeMethods
Denis Merigoux [Tue, 9 Oct 2018 14:01:02 +0000 (16:01 +0200)]
Added default impl for DerivedTypeMethods + empty impl for Cranelift BaseTypeMethods

5 years agoAll Builder methods now take &mut self instead of &self
Denis Merigoux [Fri, 5 Oct 2018 13:08:49 +0000 (15:08 +0200)]
All Builder methods now take &mut self instead of &self

5 years agoAdded some docs + start to &mut self builder methods
Denis Merigoux [Thu, 4 Oct 2018 13:23:10 +0000 (15:23 +0200)]
Added some docs + start to &mut self builder methods

5 years agoFinished moving backend-agnostic code to rustc_codegen_ssa
Denis Merigoux [Wed, 3 Oct 2018 14:56:24 +0000 (16:56 +0200)]
Finished moving backend-agnostic code to rustc_codegen_ssa

5 years agoGreat separation of librustc_codegen_llvm: librustc_codegen_ssa compiles
Denis Merigoux [Wed, 3 Oct 2018 11:49:57 +0000 (13:49 +0200)]
Great separation of librustc_codegen_llvm: librustc_codegen_ssa compiles

5 years agoMoved DeclareMethods, MiscMethods and StaticMethods
Denis Merigoux [Tue, 2 Oct 2018 08:49:54 +0000 (10:49 +0200)]
Moved DeclareMethods, MiscMethods and StaticMethods

5 years agoBeginning of moving all backend-agnostic code to rustc_codegen_ssa
Denis Merigoux [Mon, 1 Oct 2018 16:07:04 +0000 (18:07 +0200)]
Beginning of moving all backend-agnostic code to rustc_codegen_ssa

5 years agoMoved Backend interface into rustc_codegen_utils
Denis Merigoux [Mon, 1 Oct 2018 08:32:09 +0000 (10:32 +0200)]
Moved Backend interface into rustc_codegen_utils

5 years ago[eddyb/rebase cleanup] move type_{needs_drop,is_sized,is_freeze} to rustc_codegen_utils
Eduard-Mihai Burtescu [Tue, 13 Nov 2018 10:53:29 +0000 (12:53 +0200)]
[eddyb/rebase cleanup] move type_{needs_drop,is_sized,is_freeze} to rustc_codegen_utils

5 years ago[eddyb/rebase cleanup] abstracted Funclet
Eduard-Mihai Burtescu [Tue, 13 Nov 2018 10:51:42 +0000 (12:51 +0200)]
[eddyb/rebase cleanup] abstracted Funclet

5 years agoMoved common.rs enums
Denis Merigoux [Fri, 28 Sep 2018 10:18:03 +0000 (12:18 +0200)]
Moved common.rs enums

5 years agoStarting to move backend-agnostic code into codegen_utils
Denis Merigoux [Fri, 28 Sep 2018 09:40:59 +0000 (11:40 +0200)]
Starting to move backend-agnostic code into codegen_utils
IntPredicate moved

5 years agoAdded compile codegen to backend trait
Denis Merigoux [Thu, 27 Sep 2018 13:31:20 +0000 (15:31 +0200)]
Added compile codegen to backend trait

5 years agoPreparing the generalization of base:compile_coodegen_unit
Denis Merigoux [Wed, 26 Sep 2018 15:00:01 +0000 (17:00 +0200)]
Preparing the generalization of base:compile_coodegen_unit

5 years agoRenamed lifetimes for better understanding
Denis Merigoux [Wed, 26 Sep 2018 14:01:43 +0000 (16:01 +0200)]
Renamed lifetimes for better understanding

5 years agoGeneralized base:codegen_crate
Denis Merigoux [Tue, 25 Sep 2018 15:52:03 +0000 (17:52 +0200)]
Generalized base:codegen_crate

5 years agoMove doc to trait declarations
Denis Merigoux [Mon, 24 Sep 2018 15:35:39 +0000 (17:35 +0200)]
Move doc to trait declarations

5 years agoGeneralized base:maybe_create_entry_wrapper
Denis Merigoux [Mon, 24 Sep 2018 13:26:39 +0000 (15:26 +0200)]
Generalized base:maybe_create_entry_wrapper

5 years agoAdapt code to latest rustc master changes
Denis Merigoux [Mon, 24 Sep 2018 08:51:13 +0000 (10:51 +0200)]
Adapt code to latest rustc master changes

5 years agoGeneralized mono_item.rs and base.rs:codegen_instance
Denis Merigoux [Fri, 21 Sep 2018 14:13:15 +0000 (16:13 +0200)]
Generalized mono_item.rs and base.rs:codegen_instance

5 years agoGeneralized mir::codegen_mir (and all subsequent functions)
Denis Merigoux [Thu, 20 Sep 2018 13:47:22 +0000 (15:47 +0200)]
Generalized mir::codegen_mir (and all subsequent functions)

5 years agoGeneralized base::coerce_unsized_into
Denis Merigoux [Fri, 14 Sep 2018 15:48:57 +0000 (17:48 +0200)]
Generalized base::coerce_unsized_into

5 years agoGeneralized base::unsize_thin_ptr
Denis Merigoux [Thu, 13 Sep 2018 15:41:40 +0000 (17:41 +0200)]
Generalized base::unsize_thin_ptr

5 years agoGeneralized base::unsized_info
Denis Merigoux [Thu, 13 Sep 2018 12:58:19 +0000 (14:58 +0200)]
Generalized base::unsized_info