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 6 pull requests #70222

Merged
merged 35 commits into from
Mar 21, 2020
Merged

Rollup of 6 pull requests #70222

merged 35 commits into from
Mar 21, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

cjgillot and others added 30 commits March 16, 2020 09:07
Co-Authored-By: varkor <github@varkor.com>
This commit fixes an issue where if `eprintln!` is used in a TLS
destructor it can accidentally cause the process to abort. TLS
destructors are executed after `main` returns on the main thread, and at
this point we've also deinitialized global `Lazy` values like those
which store the `Stderr` and `Stdout` internals. This means that despite
handling TLS not being accessible in `eprintln!`, we will fail due to
not being able to call `stderr()`. This means that we'll double-panic
quickly because panicking also attempt to write to stderr.

The fix here is to reimplement the global stderr handle to avoid the
need for destruction. This avoids the need for `Lazy` as well as the
hidden panic inside of the `stderr` function.

Overall this should improve the robustness of printing errors and/or
panics in weird situations, since the `stderr` accessor should be
infallible in more situations.
…nkov

Don't unwind when hitting the macro expansion recursion limit

This removes one use of `FatalError.raise()`.

r? @petrochenkov
add #[rustc_layout(debug)]

@eddyb recently told me about the `#[rustc_layout]` attribute, and I think it would be very useful if it could be used to print all the layout information Rust has about a type. When working with layouts (e.g. in Miri), it is often not clear how certain surface language features get represented internally. I have some awful hacks locally to be able to dump this debug information; with this attribute I could get it on the playground which is so much better. :)
Avoid query type in generics

There are at the moment roughly 170 queries in librustc.
The way ty::query is structured, a lot of code is duplicated for each query.
I suspect this to be responsible for a part of librustc'c compile time.

This PR reduces the amount of code generic on the query,
replacing it by code generic on the key-value types.

This is split out of rust-lang#69808,
and should not contain the perf regression.

cc rust-lang#65031
…fackler

Fix abort-on-eprintln during process shutdown

This commit fixes an issue where if `eprintln!` is used in a TLS
destructor it can accidentally cause the process to abort. TLS
destructors are executed after `main` returns on the main thread, and at
this point we've also deinitialized global `Lazy` values like those
which store the `Stderr` and `Stdout` internals. This means that despite
handling TLS not being accessible in `eprintln!`, we will fail due to
not being able to call `stderr()`. This means that we'll double-panic
quickly because panicking also attempt to write to stderr.

The fix here is to reimplement the global stderr handle to avoid the
need for destruction. This avoids the need for `Lazy` as well as the
hidden panic inside of the `stderr` function.

Overall this should improve the robustness of printing errors and/or
panics in weird situations, since the `stderr` accessor should be
infallible in more situations.
put type params in front of const params in generics_of

fixes rust-lang#69970

r? @varkor
…=petrochenkov

rustc: use LocalDefId instead of DefId in TypeckTables.

The logic in `TypeckTables`' implementation of `HashStable`, which created `DefId`s by combining a `CrateNum` from a `DefId` and a `DefIndex` from a `LocalDefId`, bothered me a bit.

I don't know how much this matters, but it works so might as well submit it.
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 21, 2020

📌 Commit f1ab750 has been approved by Dylan-DPC

@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 21, 2020
@Dylan-DPC-zz
Copy link
Author

@bors rollup=never p=6

@bors
Copy link
Contributor

bors commented Mar 21, 2020

⌛ Testing commit f1ab750 with merge 7900b2b...

@bors
Copy link
Contributor

bors commented Mar 21, 2020

☀️ Test successful - checks-azure
Approved by: Dylan-DPC
Pushing 7900b2b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 21, 2020
@bors bors merged commit 7900b2b into rust-lang:master Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

9 participants