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 17 pull requests #56026

Closed
wants to merge 44 commits into from
Closed

Rollup of 17 pull requests #56026

wants to merge 44 commits into from

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Nov 17, 2018

Successful merges:

Failed merges:

r? @ghost

RalfJung and others added 30 commits November 4, 2018 11:23
… the same ABI

This is supposed to fix the performence regression of using MaybeUninit in
rust-lang#54668
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.
Just running RustFmt on upvar.rs
`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: rust-lang#42883

CC rust-lang#39364
Refactoring out the HirId of the UpvarId in another struct.
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, we would need to pass --export-dynamic to the
linker. Since this flag isn't available everywhere, ignore the test for
now.
A rust-enabled gdb already knows how to display string slices,
structs, tuples, and enums (and after rust-lang#54004, the pretty-printers
can't handle enums at all).  This patch disables these pretty-printers
when gdb is rust-enabled.

The "gdb-pretty-struct-and-enums-pre-gdb-7-7.rs" test is renamed,
because it does not seem to depend on any behavior of that version of
gdb, and because gdb 7.7 is 4 years old now.
Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.
Brings in some fixes and stabilizations!
I'm not sure why this is failing, so let's hopefully get some more
information to help investigation!
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.)
miri: accept extern types in structs if they are the only field

Fixes rust-lang#55541

Cc @oli-obk @eddyb rust-lang#43467
…, r=nikomatsakis

Disable some pretty-printers when gdb is rust-enabled

A rust-enabled gdb already knows how to display string slices,
structs, tuples, and enums (and after rust-lang#54004, the pretty-printers
can't handle enums at all).  This patch disables these pretty-printers
when gdb is rust-enabled.

The "gdb-pretty-struct-and-enums-pre-gdb-7-7.rs" test is renamed,
because it does not seem to depend on any behavior of that version of
gdb, and because gdb 7.7 is 4 years old now.
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`
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
rust-lang#54668
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 rust-lang#53379
Make miri value visitor usfeful for mutation

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

r? @oli-obk
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.
…edicate_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.
…llaumeGomez

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

Fixes rust-lang#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...)
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: rust-lang#42883

CC rust-lang#39364
Update Cargo submodule

Brings in some fixes and stabilizations!
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.
avoid shared ref in UnsafeCell::get

Avoid taking a shared reference in `UnsafeCell::get`. This *should* be taking a raw reference (see rust-lang/rfcs#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
…hton

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!
@kennytm
Copy link
Member Author

kennytm commented Nov 17, 2018

@bors r+ p=380

@bors
Copy link
Contributor

bors commented Nov 17, 2018

📌 Commit db99aa8 has been approved by kennytm

@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 Nov 17, 2018
@bors
Copy link
Contributor

bors commented Nov 17, 2018

⌛ Testing commit db99aa8 with merge ce79ba56cfd4933e607f2f68a4aa51216a985d6f...

@bors
Copy link
Contributor

bors commented Nov 17, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 17, 2018
@rust-highfive
Copy link
Collaborator

The job arm-android 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.
[01:39:08] test [debuginfo-both] debuginfo/vec.rs ... ignored
[01:39:08] 
[01:39:08] failures:
[01:39:08] 
[01:39:08] ---- [debuginfo-both] debuginfo/gdb-pretty-struct-and-enums.rs stdout ----
[01:39:08] NOTE: compiletest thinks it is using GDB without native rust support
[01:39:08] 
[01:39:08] error: line not found in debugger output: $1 = RegularStruct = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
[01:39:08] status: exit code: 0
[01:39:08] command: "arm-linux-androideabi-gdb" "-quiet" "-batch" "-nx" "-command=/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/gdb-pretty-struct-and-enums/gdb-pretty-struct-and-enums.debugger.script"
[01:39:08] ------------------------------------------
[01:39:08] ------------------------------------------
[01:39:08] 0xb6efda30 in ?? ()
[01:39:08] Breakpoint 1 at 0xb6f0f7ac: file /checkout/src/test/debuginfo/gdb-pretty-struct-and-enums.rs, line 69.
[01:39:08] 
[01:39:08] Breakpoint 1, gdb_pretty_struct_and_enums::main::h44925421ce933524 () at /checkout/src/test/debuginfo/gdb-pretty-struct-and-enums.rs:69
[01:39:08] 69     zzz(); // #break
[01:39:08] $1 = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
[01:39:08] $2 = {<No data fields>}
[01:39:08] $3 = CStyleEnumVar1
[01:39:08] $4 = CStyleEnumVar2
[01:39:08] $5 = CStyleEnumVar3
[01:39:08] A debugging session is active.
[01:39:08] 
[01:39:08]  Inferior 1 [process 10377] will be killed.
[01:39:08] 
[01:39:08] Quit anyway? (y or n) [answered Y; input not from terminal]
[01:39:08] ------------------------------------------
[01:39:08] stderr:
[01:39:08] ------------------------------------------
[01:39:08] ------------------------------------------
[01:39:08] warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
[01:39:08] of file /checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/gdb-pretty-struct-and-enums/a.
[01:39:08] Use `info auto-load python-scripts [REGEXP]' to list them.
[01:39:08] warning: Unable to find dynamic linker breakpoint function.
[01:39:08] GDB will be unable to debug shared library initializers
[01:39:08] and track explicitly loaded dynamic code.
[01:39:08] warning: Unable to find dynamic linker breakpoint function.
[01:39:08] GDB will be unable to debug shared library initializers
[01:39:08] and track explicitly loaded dynamic code.
[01:39:08] warning: Could not load shared library symbols for 4 libraries, e.g. /system/bin/linker.
[01:39:08] Use the "info sharedlibrary" command to see the complete listing.
[01:39:08] Do you need "set solib-search-path" or "set sysroot"?
[01:39:08] ------------------------------------------
[01:39:08] 
[01:39:08] thread '[debuginfo-both] debuginfo/gdb-pretty-struct-and-enums.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3282:9
[01:39:08] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[01:39:08] test result: FAILED. 70 passed; 1 failed; 47 ignored; 0 measured; 0 filtered out
[01:39:08] 
[01:39:08] 
[01:39:08] 
[01:39:08] 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/arm-linux-androideabi/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/debuginfo" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo" "--stage-id" "stage2-arm-linux-androideabi" "--mode" "debuginfo-both" "--target" "arm-linux-androideabi" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--linker" "/android/ndk/arm-14/bin/arm-linux-androideabi-clang" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/arm-linux-androideabi/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--llvm-version" "8.0.0svn\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--remote-test-client" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/remote-test-client" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "/android/ndk/arm-14" "--color" "always"
[01:39:08] 
[01:39:08] 
[01:39:08] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target arm-linux-androideabi
[01:39:08] Build completed unsuccessfully in 1:25:47
---
travis_time:end:02491e8a:start=1542477528069904073,finish=1542477528093262690,duration=23358617
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0232ff76
$ 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:0b6b1500
travis_time:start:0b6b1500
$ 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:1ca456b2
$ 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)

@kennytm kennytm closed this Nov 18, 2018
@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-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.