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 9 pull requests #70130

Closed
wants to merge 35 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Mar 19, 2020

Successful merges:

Failed merges:

r? @ghost

jonas-schievink and others added 30 commits March 7, 2020 21:29
This didn't cause issues before since generator types were always
considered to "need drop", leading to unwind paths
(including a `Resume` block) always getting generated.
The indices do not matter here, and this fixes an index out of bounds
panic when compiling a generator that can unwind but not return.
Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
Removed in rust-lang#69247 while this PR was waiting to merge.
This mitigates possible issues when signal stacks overflow, which could
manifest as segfaults or in unlucky circumstances possible clobbering of
other memory values as stack overflows tend to enable.
…ther

also unmap the whole thing when cleaning up, rather than leaving a spare
page floating around.
This implements a flag `-Zlink-native-libraries=yes/no`. If set to true/yes, or unspecified, then
native libraries referenced via `#[link]` attributes will be put on the linker line (ie, unchanged
behaviour).

If `-Zlink-native-libraries=no` is specified then rustc will not add the native libraries to the link
line. The assumption is that the outer build system driving the build already knows about the native
libraries and will specify them to the linker directly (for example via `-Clink-arg=`).

Addresses issue rust-lang#70093
This commit fixes an issue when using `set_print` and friends, notably
used by libtest, to avoid aborting the process if printing panics. This
previously panicked due to borrowing a mutable `RefCell` twice, and this
is worked around by borrowing these cells for less time, instead
taking out and removing contents temporarily.

Closes rust-lang#69558
rustc: don't resolve Instances which would produce malformed shims.

There are some `InstanceDef` variants (shims and drop "glue") which contain a `Ty`, and that `Ty` is used in generating the shim MIR. But if that `Ty` mentions any generic parameters, the generated shim would refer to them (but they won't match the `Substs` of the `Instance`), or worse, generating the shim would fail because not enough of the type is known.

Ideally we would always produce a "skeleton" of the type, e.g. `(_, _)` for dropping any tuples with two elements, or `Vec<_>` for dropping any `Vec` value, but that's a lot of work, and they would still not match the `Substs` of the `Instance` as it exists today, so `Instance` would probably need to change.

By making `Instance::resolve` return `None` in the still-generic cases, we get behavior similar to specialization, where a default can only be used if there are no more generic parameters which would allow a more specialized `impl` to match.

<hr/>

This was found while testing the MIR inliner with rust-lang#68965, because it was trying to inline shims.

cc @rust-lang/wg-mir-opt
…mulacrum

tidy: Better license checks.

This implements some improvements to the license checks in tidy:

* Use `cargo_metadata` instead of parsing vendored crates. This allows license checks to run without vendoring enabled, and allows the checks to run on PR builds.
* Check for stale entries.
* Check that the licenses for exceptions are what we think they are.
* Verify exceptions do not leak into the runtime.

Closes rust-lang#62618
Closes rust-lang#62619
Closes rust-lang#63238 (I think)

There are some substantive changes here. The follow licenses have changed from the original comments:

* openssl BSD+advertising clause to Apache-2.0
* pest MPL2 to MIT/Apache-2.0
* smallvec MPL2 to MIT/Apache-2.0
* clippy lints MPL2 to MIT OR Apache-2.0
Smaller and more correct generator codegen

This removes unnecessary panicking branches in the resume function when the generator can not return or unwind, respectively.

Closes rust-lang#66100

It also addresses the correctness concerns wrt poisoning on unwind. These are not currently a soundness issue because any operation *inside* a generator that could possibly unwind will result in a cleanup path for dropping it, ultimately reaching a `Resume` terminator, which we already handled correctly. Future MIR optimizations might optimize that out, though.

r? @Zoxc
…lacrum

Regenerate tables for Unicode 13.0.0
…Mark-Simulacrum

std: Don't abort process when printing panics in tests

This commit fixes an issue when using `set_print` and friends, notably
used by libtest, to avoid aborting the process if printing panics. This
previously panicked due to borrowing a mutable `RefCell` twice, and this
is worked around by borrowing these cells for less time, instead
taking out and removing contents temporarily.

Closes rust-lang#69558
unix: Set a guard page at the end of signal stacks

This mitigates possible issues when signal stacks overflow, which could
manifest as segfaults or in unlucky circumstances possible clobbering of
other memory values as stack overflows tend to enable.

I went ahead and made a PR for this because it's a pretty small change, though if I should open an issue/RFC for this and discuss there first I'll happily do so. I've also added some example programs that demonstrate the uncomfortably clobber-happy behavior we currently have, and the segfaults that could/should result instead, [here](https://github.com/iximeow/jubilant-train).
…kinnison

[rustdoc] Improve visibility for code blocks warnings

It appeared that a lot of people didn't notice when a code block was meant to fail compilation or wasn't tested at all. The changes here make the colors less transparent and the icon bigger. So before it looked like this:

![old-light](https://user-images.githubusercontent.com/3050060/76687070-f1cdbb80-6620-11ea-9b73-0c787dc671f7.png)
![old-dark](https://user-images.githubusercontent.com/3050060/76687079-f4c8ac00-6620-11ea-90fb-e548329e01b4.png)

And now it looks like this:

![new-light](https://user-images.githubusercontent.com/3050060/76687092-fd20e700-6620-11ea-9ebb-2b6852f00899.png)
![new-dark](https://user-images.githubusercontent.com/3050060/76687091-fd20e700-6620-11ea-8fea-6854c8367b97.png)

cc @rust-lang/rustdoc
r? @kinnison
Use copy bound in atomic operations to generate simpler MIR
Implement -Zlink-native-libraries

This implements a flag `-Zlink-native-libraries=yes/no`. If set to true/yes, or unspecified, then
native libraries referenced via `#[link]` attributes will be put on the linker line (ie, unchanged
behaviour).

If `-Zlink-native-libraries=no` is specified then rustc will not add the native libraries to the link
line. The assumption is that the outer build system driving the build already knows about the native
libraries and will specify them to the linker directly (for example via `-Clink-arg=`).

Addresses issue rust-lang#70093
@Centril Centril added the rollup A PR which is a rollup label Mar 19, 2020
@Centril
Copy link
Contributor Author

Centril commented Mar 19, 2020

@bors r+ p=9 rollup=never

@bors
Copy link
Contributor

bors commented Mar 19, 2020

📌 Commit 89dbdc7 has been approved by Centril

@bors
Copy link
Contributor

bors commented Mar 19, 2020

🌲 The tree is currently closed for pull requests below priority 5, this pull request will be tested once the tree is reopened

@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 Mar 19, 2020
@bors
Copy link
Contributor

bors commented Mar 19, 2020

⌛ Testing commit 89dbdc7 with merge 4d404b3...

bors added a commit that referenced this pull request Mar 19, 2020
Rollup of 9 pull requests

Successful merges:

 - #69036 (rustc: don't resolve Instances which would produce malformed shims.)
 - #69443 (tidy: Better license checks.)
 - #69814 (Smaller and more correct generator codegen)
 - #69929 (Regenerate tables for Unicode 13.0.0)
 - #69959 (std: Don't abort process when printing panics in tests)
 - #69969 (unix: Set a guard page at the end of signal stacks)
 - #70005 ([rustdoc] Improve visibility for code blocks warnings)
 - #70088 (Use copy bound in atomic operations to generate simpler MIR)
 - #70095 (Implement -Zlink-native-libraries)

Failed merges:

r? @ghost
@rust-highfive
Copy link
Collaborator

The job i686-msvc-2 of your PR failed (pretty log, 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.
2020-03-19T05:53:24.7231121Z ---- [ui] ui\issues\issue-70093.rs stdout ----
2020-03-19T05:53:24.7231302Z 
2020-03-19T05:53:24.7231537Z error: test compilation failed although it shouldn't!
2020-03-19T05:53:24.7231782Z status: exit code: 1
2020-03-19T05:53:24.7238764Z command: PATH="D:\a\1\s\build\i686-pc-windows-msvc\stage2\bin;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64;D:\a\1\s\build\i686-pc-windows-msvc\stage0-bootstrap-tools\i686-pc-windows-msvc\release\deps;D:\a\1\s\build\i686-pc-windows-msvc\stage0\bin;D:\a\1\s\msys2\mingw32\bin;D:\a\1\s\ninja;D:\a\1\s\msys2\mingw32\bin;C:\hostedtoolcache\windows\Python\2.7.17\x64;D:\a\1\s\msys2\usr\bin;C:\Program Files (x86)\Inno Setup 5;D:\a\1\s\sccache;C:\agents\2.165.2\externals\git\cmd;C:\Program Files\Mercurial;C:\ProgramData\kind;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\Boost\1.69.0;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\Java\zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64\bin;C:\SeleniumWebDrivers\GeckoDriver;C:\Program Files (x86)\sbt\bin;C:\Rust\.cargo\bin;C:\Go1.14\bin;C:\Program Files\Git\bin;C:\hostedtoolcache\windows\Ruby\2.5.7\x64\bin;C:\hostedtoolcache\windows\Python\3.7.6\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.6\x64;C:\npm\prefix;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files\Microsoft MPI\Bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\ProgramData\Chocolatey\bin;C:\Program Files\Docker;C:\Program Files\PowerShell\7;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\OpenSSL\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\Subversion\bin;C:\SeleniumWebDrivers\ChromeDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.6.3\bin;C:\Program Files\CMake\bin;C:\Users\VssAdministrator\.dotnet\tools;C:\Program Files (x86)\Microsoft SQL " "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\stage2\\bin\\rustc.exe" "D:\\a\\1\\s\\src/test\\ui\\issues\\issue-70093.rs" "-Zthreads=1" "--target=i686-pc-windows-msvc" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\test\\ui\\issues\\issue-70093\\a.exe" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\native\\rust-test-helpers" "-Zlink-native-libraries=no" "-Cdefault-linker-libraries=yes" "-L" "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\test\\ui\\issues\\issue-70093\\auxiliary"
2020-03-19T05:53:24.7245915Z ------------------------------------------
2020-03-19T05:53:24.7246077Z 
2020-03-19T05:53:24.7246289Z ------------------------------------------
2020-03-19T05:53:24.7246483Z stderr:
2020-03-19T05:53:24.7246483Z stderr:
2020-03-19T05:53:24.7246698Z ------------------------------------------
2020-03-19T05:53:24.7246989Z error: linking with `link.exe` failed: exit code: 1120
2020-03-19T05:53:24.7247360Z    |
2020-03-19T05:53:24.7250286Z    = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x86\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LARGEADDRESSAWARE" "/SAFESEH" "/LIBPATH:C:\\MORE_SPACE\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\i686-pc-windows-msvc\\lib" "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\test\\ui\\issues\\issue-70093\\a.issue_70093.7rcbfp3g-cgu.0.rcgu.o" "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\test\\ui\\issues\\issue-70093\\a.issue_70093.7rcbfp3g-cgu.1.rcgu.o" "/OUT:D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\test\\ui\\issues\\issue-70093\\a.exe" "/OPT:REF,ICF" "/DEBUG" "/LIBPATH:C:\\MORE_SPACE\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\i686-pc-windows-msvc\\lib" "std-0f54896ef7f9d739.dll.lib" "C:\\MORE_SPACE\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libcompiler_builtins-6ac82cfc559709b1.rlib"
2020-03-19T05:53:24.7252647Z    = note: LINK : error LNK2001: unresolved external symbol _mainCRTStartup
2020-03-19T05:53:24.7253222Z            D:\a\1\s\build\i686-pc-windows-msvc\test\ui\issues\issue-70093\a.exe : fatal error LNK1120: 1 unresolved externals
2020-03-19T05:53:24.7253945Z 
2020-03-19T05:53:24.7254164Z error: aborting due to previous error
2020-03-19T05:53:24.7254336Z 
2020-03-19T05:53:24.7254459Z 
---
2020-03-19T05:53:24.7269048Z thread 'main' panicked at 'Some tests failed', src\tools\compiletest\src\main.rs:348:22
2020-03-19T05:53:24.7269542Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-19T05:53:24.7295795Z 
2020-03-19T05:53:24.7296092Z 
2020-03-19T05:53:24.7300523Z command did not execute successfully: "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\stage0-tools-bin\\compiletest.exe" "--compile-lib-path" "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\stage2\\bin" "--run-lib-path" "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\i686-pc-windows-msvc\\lib" "--rustc-path" "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\stage2\\bin\\rustc.exe" "--src-base" "D:\\a\\1\\s\\src/test\\ui" "--build-base" "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\test\\ui" "--stage-id" "stage2-i686-pc-windows-msvc" "--mode" "ui" "--target" "i686-pc-windows-msvc" "--host" "i686-pc-windows-msvc" "--llvm-filecheck" "D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\llvm\\build\\bin\\FileCheck.exe" "--nodejs" "C:\\Program Files\\nodejs\\node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\native\\rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=D:\\a\\1\\s\\build\\i686-pc-windows-msvc\\native\\rust-test-helpers" "--docck-python" "D:\\a\\1\\s\\msys2\\mingw32\\bin\\python2.7" "--lldb-python" "D:\\a\\1\\s\\msys2\\mingw32\\bin\\python2.7" "--gdb" "D:\\a\\1\\s\\msys2\\mingw32\\bin\\gdb" "--llvm-version" "9.0.1-rust-1.44.0-nightly\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-19T05:53:24.7304268Z 
2020-03-19T05:53:24.7304398Z 
2020-03-19T05:53:26.2097812Z failed to run: D:\a\1\s\build\bootstrap\debug\bootstrap test src/test/ui src/test/compile-fail src/tools/linkchecker
2020-03-19T05:53:26.2195549Z Build completed unsuccessfully in 1:56:42
2020-03-19T05:53:26.2195549Z Build completed unsuccessfully in 1:56:42
2020-03-19T05:53:26.2196038Z make: *** [Makefile:82: ci-subset-2] Error 1
2020-03-19T05:53:26.2196803Z   local time: Thu Mar 19 05:53:24 CUT 2020
2020-03-19T05:53:26.2197311Z   network time: Thu, 19 Mar 2020 05:53:25 GMT
2020-03-19T05:53:26.2197673Z == end clock drift check ==
2020-03-19T05:53:26.2198152Z 
2020-03-19T05:53:26.2198152Z 
2020-03-19T05:53:26.3680043Z ##[error]Bash exited with code '2'.
2020-03-19T05:53:26.4718633Z ##[section]Starting: Checkout rust-lang/rust@auto to s
2020-03-19T05:53:27.2638388Z ==============================================================================
2020-03-19T05:53:27.2638858Z Task         : Get sources
2020-03-19T05:53:27.2639571Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Mar 19, 2020

💔 Test failed - checks-azure

@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 Mar 19, 2020
@Centril Centril closed this Mar 19, 2020
@Centril Centril deleted the rollup-8hk2y7z branch March 19, 2020 05:56
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.

None yet