Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 19 pull requests #57005

Closed
wants to merge 50 commits into from
Closed

Conversation

pietroalbini
Copy link
Member

@pietroalbini pietroalbini commented Dec 20, 2018

Successful merges:

Failed merges:

r? @ghost

csmoe and others added 30 commits December 15, 2018 12:53
RFC rust-lang#2195 specifies that a repr(int) enum such as:

    #[repr(u8)]
    enum MyEnum {
        B { x: u8, y: i16, z: u8 },
    }

has a layout that is equivalent to:

    #[repr(C)]
    enum MyEnumVariantB { tag: u8, x: u8, y: i16, z: u8 },

However this isn't actually implemented, with the actual layout being
roughly equivalent to:

    union MyEnumPayload {
        B { x: u8, y: i16, z: u8 },
    }

    #[repr(packed)]
    struct MyEnum {
        tag: u8,
        payload: MyEnumPayload,
    }

Thus the variant payload is *not* subject to repr(C) ordering rules, and
gets re-ordered as `{ x: u8, z: u8, z: i16 }`

The existing tests added in pull-req rust-lang#45688 fail to catch this as the
repr(C) ordering just happens to match the current Rust ordering in this
case; adding a third field reveals the problem.
This commit updates from LLVM 7.0.0 to git revisions of clang/llvm/lld
to build LLVM on our dist builders for Linux. The goal of this is to
fix rust-lang#56849 by picking up a fix [1] in LLD.

Closes rust-lang#56849

[1]: llvm-mirror/lld@3be4e82
Adding a map to TypeckTables to get the list of all the Upvars
given a closureID. This is help us get rid of the recurring
pattern in the codebase of iterating over the free vars
using with_freevars.
Layout size overflow and typeck eval errors are reported. Trigger a bug
only when the eval error is strictly labeled as TooGeneric.
…rister

rustc: Update Clang used to build LLVM on Linux

This commit updates from LLVM 7.0.0 to git revisions of clang/llvm/lld
to build LLVM on our dist builders for Linux. The goal of this is to
fix rust-lang#56849 by picking up a fix [1] in LLD.

Closes rust-lang#56849

[1]: llvm-mirror/lld@3be4e82
Issue rust-lang#56905

Adding a map to TypeckTables to get the list of all the Upvars
given a closureID. This is help us get rid of the recurring
pattern in the codebase of iterating over the free vars
using with_freevars.
static eval: Do not ICE on layout size overflow

Layout size overflow and typeck eval errors are reported. Trigger a bug
only when the eval error is strictly labeled as TooGeneric.

Fixes: rust-lang#56762
Ignore ui/target-feature-gate on sparc, sparc64, powerpc, powerpc64 and powerpc64le

The test ui/target-feature-gate is not applicable on sparc, sparc64, powerpc, powerpc64 and powerpc64le and consequently fails there. So just ignore it on these targets.
… r=davidtwco

Fix a recently introduced regression

fixes rust-lang#56903
…fJung

Remove a wrong multiplier on relocation offset computation

r? @RalfJung

fixes rust-lang#56800
@rust-highfive

This comment has been minimized.

…lacrum

Add --progress to git submodule commands in x.py

This is a relatively new flag, but it means that git will indicate the progress of the update as it would with regular clones. This is especially helpful as some of the submodules are really big and it's difficult to tell if it's hanging or still updating.
Add dist builder for Armv8-M Mainline

This commit adds the Armv8-M Mainline target in the list of targets that
get their dist components built. It also update the build-manifest so
that this target gets also its dist components uploaded.

I took example on other pull requests doing the same thing for another target to make the changes. Please feel free to comment if things needs to be added or removed.

Doing `./x.py dist --target thumbv8m.main-none-eabi` worked locally so I assume that this will also work on the CI.
It will (I think) however need a new release of alexcrichton/cc-rs to include the pull request rust-lang/cc-rs#363 @alexcrichton

I hope to do the HardFloat version (`thumbv8m.main-none-eabihf`) and Baseline (`thumbv8m.base-none-eabi`) later, as fixes need to be done on compiler-builtins first to support those.
…r=Manishearth

Mem uninit doc ptr drop

Extend the mem::uninitialized documentation to account for partially initialized arrays and how to correctly handle these. These are used in some datastructures (trees for example) or in FFI.

r? @Manishearth
make basic CTFE tracing available on release builds

Debugging things going wrong in miri is currently pretty much impossible with a nightly Rust.

r? @oli-obk
…nd-support, r=alexcrichton

Adding unwinding support for x86_64_fortanix_unknown_sgx target.

Unwinding support is provided by our port of LLVM's libunwind which is available from https://github.com/fortanix/libunwind/tree/release_50.

libunwind requires support for rwlock and printing to stderr, which is only provided by `std` for this target. This poses two problems: 1) how to expose the `std` functionality to C and 2) dependency inversion.

### Exposing `std`

For exposing the functionality we chose to expose the following symbols:

* __rust_rwlock_rdlock
* __rust_rwlock_wrlock
* __rust_rwlock_unlock
* __rust_print_err
* __rust_abort

Also, the following are needed from `alloc`:

* __rust_alloc
* __rust_dealloc

#### Rust RWLock in C

In `libunwind`, RWLock is initialized as a templated static variable:

```c
pthread_rwlock_t DwarfFDECache<A>::_lock = PTHREAD_RWLOCK_INITIALIZER;
```

I don't know of a good way to use the Rust sys::rwlock::RWLock type and initializer there. We could have a static global variable in Rust, but that doesn't work with the templating. The variable needs to be initialized statically, since this target doesn't support the .init section. Currently, I just used a byte array and standard C array initialization. The mapping between this C type and the Rust type needs to be manually maintained. There is a compile-time check and a unit test to make sure the Rust versions of these C definitions match the actual Rust type. If any reviewer knows of a better solution, please do tell.

### Dependency inversion issue

`std` depends on `panic_unwind` which depends on `libunwind`, and `libunwind` depends on `std`. This is not normally supported by Rust's linking system. Therefore we use raw C exports from `std` *and* `libunwind.a` is linked last in the target `post_link_objects` instead of being built as part of the Rust `libunwind`. Currently, all C exports are defined in `src/libstd/sys/sgx/rwlock.rs` to overcome LTO issues. Only the `__rust_rwlock_*` definitions *need* to live there for privacy reasons. Once again, if any reviewer knows of a better solution, please do tell.

r? @alexcrichton
…i-obk

A few tweaks to dropck_outlives

- remove an unnecessary call to `cloned()`
- simplify common patterns
…ations, r=Mark-Simulacrum

Fix compiletest `trim` deprecation warnings

None
@pietroalbini pietroalbini changed the title Rollup of 20 pull requests Rollup of 19 pull requests Dec 20, 2018
@pietroalbini
Copy link
Member Author

Removed #56926.

@bors r+ p=19

@bors
Copy link
Contributor

bors commented Dec 20, 2018

📌 Commit 0880d95 has been approved by pietroalbini

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 20, 2018
@bors
Copy link
Contributor

bors commented Dec 20, 2018

⌛ Testing commit 0880d95 with merge 28a9ff39dcdb63789454bc9cb5d5bf92e2ffe393...

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:32bad984:start=1545305130986405252,finish=1545305185874089297,duration=54887684045
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[01:04:26] 
[01:04:26] ---- [ui] ui/consts/static_mut_containing_mut_ref2.rs stdout ----
[01:04:26] diff of stderr:
[01:04:26] 
[01:04:26] 4 LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };
[01:04:26] 5    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^ statics require immutable values
[01:04:26] - error: aborting due to previous error
[01:04:26] - error: aborting due to previous error
[01:04:26] + error[E0019]: static contains unimplemented expression type
[01:04:26] +   --> $DIR/static_mut_containing_mut_ref2.rs:5:45
[01:04:26] +    |
[01:04:26] + LL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };
[01:04:26] 8 
[01:04:26] - For more information about this error, try `rustc --explain E0017`.
[01:04:26] + error: aborting due to 2 previous errors
[01:04:26] + 
[01:04:26] + 
[01:04:26] + Some errors occurred: E0017, E0019.
[01:04:26] + For more information about an error, try `rustc --explain E0017`.
[01:04:26] 10 
[01:04:26] 
[01:04:26] 
[01:04:26] The actual stderr differed from the expected stderr.
[01:04:26] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/static_mut_containing_mut_ref2/static_mut_containing_mut_ref2.stderr
[01:04:26] To update references, rerun the tests and pass the `--bless` flag
[01:04:26] To only update this specific test, also pass `--test-args consts/static_mut_containing_mut_ref2.rs`
[01:04:26] error: 1 errors occurred comparing output.
[01:04:26] status: exit code: 1
[01:04:26] status: exit code: 1
[01:04:26] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/static_mut_containing_mut_ref2.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/static_mut_containing_mut_ref2/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/static_mut_containing_mut_ref2/auxiliary" "-A" "unused"
[01:04:26] ------------------------------------------
[01:04:26] 
[01:04:26] ------------------------------------------
[01:04:26] stderr:
[01:04:26] stderr:
[01:04:26] ------------------------------------------
[01:04:26] {"message":"references in statics may only refer to immutable values","code":{"code":"E0017","explanation":"\nReferences in statics and constants may only refer to immutable values.\nErroneous code example:\n\n```compile_fail,E0017\nstatic X: i32 = 1;\nconst C: i32 = 2;\n\n// these three are not allowed:\nconst CR: &mut i32 = &mut C;\nstatic STATIC_REF: &'static mut i32 = &mut X;\nstatic CONST_REF: &'static mut i32 = &mut C;\n```\n\nStatics are shared everywhere, and if they refer to mutable data one might\nviolate memory safety since holding multiple mutable references to shared data\nis not allowed.\n\nIf you really want global mutable state, try using `static mut` or a global\n`UnsafeCell`.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/static_mut_containing_mut_ref2.rs","byte_start":110,"byte_end":136,"line_start":5,"line_end":5,"column_start":46,"column_end":72,"is_primary":true,"text":[{"text":"pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };","highlight_start":46,"highlight_end":72}],"label":"statics require immutable values","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0017]: references in statics may only refer to immutable values\n  --> /checkout/src/test/ui/consts/static_mut_containing_mut_ref2.rs:5:46\n   |\nLL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };\n   |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^ statics require immutable values\n\n"}
[01:04:26] {"message":"static contains unimplemented expression type","code":{"code":"E0019","explanation":"\nA function call isn't allowed in the const's initialization expression\nbecause the expression's value must be known at compile-time. Erroneous code\nexample:\n\n```compile_fail\nenum Test {\n    V1\n}\n\nimpl Test {\n    fn test(&self) -> i32 {\n        12\n    }\n}\n\nfn main() {\n    const FOO: Test = Test::V1;\n\n    const A: i32 = FOO.test(); // You can't call Test::func() here!\n}\n```\n\nRemember: you can't use a function call inside a const's initialization\nexpression! However, you can totally use it anywhere else:\n\n```\nenum Test {\n    V1\n}\n\nimpl Test {\n    fn func(&self) -> i32 {\n        12\n    }\n}\n\nfn main() {\n    const FOO: Test = Test::V1;\n\n    FOO.func(); // here is good\n    let x = FOO.func(); // or even here!\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/static_mut_containing_mut_ref2.rs","byte_start":109,"byte_end":141,"line_start":5,"line_end":5,"column_start":45,"column_end":77,"is_primary":true,"text":[{"text":"pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };","highlight_start":45,"highlight_end":77}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0019]: static contains unimplemented expression type\n  --> /checkout/src/test/ui/consts/static_mut_containing_mut_ref2.rs:5:45\n   |\nLL | pub static mut STDERR_BUFFER: () = unsafe { *(&mut STDERR_BUFFER_SPACE) = 42; };\n   |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:04:26] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:04:26] {"message":"Some errors occurred: E0017, E0019.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0017, E0019.\n"}
[01:04:26] {"message":"For more information about an error, try `rustc --explain E0017`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0017`.\n"}
[01:04:26] ------------------------------------------
[01:04:26] 
[01:04:26] thread '[ui] ui/consts/static_mut_containing_mut_ref2.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[01:04:26] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[01:04:26] 
[01:04:26] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:503:22
[01:04:26] 
[01:04:26] 
[01:04:26] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:04:26] 
[01:04:26] 
[01:04:26] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:04:26] Build completed unsuccessfully in 0:03:56
[01:04:26] Build completed unsuccessfully in 0:03:56
[01:04:26] Makefile:58: recipe for target 'check' failed
[01:04:26] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:26b854ea
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Dec 20 12:31:02 UTC 2018
---
travis_time:end:014e205a:start=1545309063187079607,finish=1545309063191509882,duration=4430275
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:117c39dd
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0453c6cc
travis_time:start:0453c6cc
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:11b1bc44
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@pietroalbini
Copy link
Member Author

@bors retry r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 20, 2018
@pietroalbini pietroalbini deleted the rollup branch December 20, 2018 17:44
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.