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 8 pull requests #93541

Closed
wants to merge 21 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

bossmc and others added 21 commits October 28, 2021 15:32
…roideabi` rlib

I ran `./x.py dist --host= --target=armv7-linux-androideabi` before this diff:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-3d9661a82c59c66a.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
2
```
And after:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-ffd2745070943321.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
1
```
Fixes rust-lang#93310
it ignored regions and constants in adts,
but didn't do so for references or any other types.
This seemed quite weird
…=nagisa

Enable combining `+crt-static` and `relocation-model=pic` on `x86_64-unknown-linux-gnu`

Modern `gcc` versions support `-static-pie`, and `rustc` will already fall-back to `-static` if the local `gcc` is too old (and hence this change is optimistic rather than absolute).  This brings the `-musl` and `-gnu` targets to feature compatibility (albeit with different default settings).

Of note a `-static` or `-static-pie` binary based on glibc that uses NSS-backed functions (`gethostbyname` or `getpwuid` etc.) need to have access to the `libnss_X.so.2` libraries and any of their dynamic dependencies.

I wasn't sure about the `# only`/`# ignore` changes (I've not got a `gnux32` toolchain to test with hence not also enabling `-static-pie` there).
Implement `RawWaker` and `Waker` getters for underlying pointers

implement rust-lang#87021

New APIs:
- `RawWaker::data(&self) -> *const ()`
- `RawWaker::vtable(&self) -> &'static RawWakerVTable`
- ~`Waker::as_raw_waker(&self) -> &RawWaker`~ `Waker::as_raw(&self) -> &RawWaker`

This third one is an auxiliary function to make the two APIs above more useful. Since we can only get `&Waker` in `Future::poll`, without this, we need to `transmute` it into `&RawWaker` (relying on `repr(transparent)`) in order to access its data/vtable pointers.

~Not sure if it should be named `as_raw` or `as_raw_waker`. Seems we always use `as_<something-raw>` instead of just `as_raw`. But `as_raw_waker` seems not quite consistent with `Waker::from_raw`.~ As suggested in rust-lang#91828 (comment), use `as_raw`.
…=Mark-Simulacrum

Eliminate duplicate codes of is_single_fp_element

There are duplicate codes of is_single_fp_element function. Merge these codes to TyAndLayout impl block.
![image](https://user-images.githubusercontent.com/95843988/146707753-ba9ffc41-5888-4a53-80cf-f4fe3bcbac54.png)
add rustc lint, warning when iterating over hashmaps 2

first introduced in rust-lang#89558 and reverted in rust-lang#90380 due to its perf impact

r? `@estebank`
…r=yaahc

Support configuring whether to capture backtraces at runtime

Tracking issue: rust-lang#93346

This adds a new API to the `std::panic` module which configures whether and how the default panic hook will emit a backtrace when a panic occurs.

After discussion with `@yaahc` on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/backtrace.20lib.20vs.2E.20panic), this PR chooses to avoid adjusting or seeking to provide a similar API for the (currently unstable) std::backtrace API. It seems likely that the users of that API may wish to expose more specific settings rather than just a global one (e.g., emulating the `env_logger`, `tracing` per-module configuration) to avoid the cost of capture in hot code. The API added here could plausibly be copied and/or re-exported directly from std::backtrace relatively easily, but I don't think that's the right call as of now.

```rust
mod panic {
    #[derive(Copy, Clone, Debug, PartialEq, Eq)]
    #[non_exhaustive]
    pub enum BacktraceStyle {
        Short,
        Full,
        Off,
    }
    fn set_backtrace_style(BacktraceStyle);
    fn get_backtrace_style() -> Option<BacktraceStyle>;
}
```

Several unresolved questions:

* Do we need to move to a thread-local or otherwise more customizable strategy for whether to capture backtraces? See [this comment](rust-lang#79085 (comment)) for some potential use cases for this.
   * Proposed answer: no, leave this for third-party hooks.
* Bikeshed on naming of all the options, as usual.
* Should BacktraceStyle be moved into `std::backtrace`?
   * It's already somewhat annoying to import and/or re-type the `std::panic::` prefix necessary to use these APIs, probably adding a second module to the mix isn't worth it.

Note that PR rust-lang#79085 proposed a much simpler API, but particularly in light of the desire to fully replace setting environment variables via `env::set_var` to control the backtrace API, a more complete API seems preferable. This PR likely subsumes that one.
implement a lint for suspicious auto trait impls

cc rust-lang#85048 (comment)

r? `@nikomatsakis`
remove `TyS::same_type`

This function ignored regions and constants in adts, but didn't do so for references or any other types. cc rust-lang#93148 (comment)
Update compiler_builtins to fix duplicate symbols in `armv7-linux-androideabi` rlib

I ran `./x.py dist --host= --target=armv7-linux-androideabi` before this diff:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-3d9661a82c59c66a.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
2
```
And after:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-ffd2745070943321.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
1
```
Fixes rust-lang#93310

See also rust-lang/compiler-builtins#449 and rust-lang/compiler-builtins#450
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Feb 1, 2022
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Feb 1, 2022

📌 Commit fe62a2f has been approved by matthiaskrgr

@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 Feb 1, 2022
@bors
Copy link
Contributor

bors commented Feb 1, 2022

⌛ Testing commit fe62a2f with merge 61d7402e339c261282084efab027a350cc7a3a00...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-nopt failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [ui] ui/wrong-hashset-issue-42918.rs ... ok

failures:

---- [ui] ui/panics/runtime-switch.rs#v0 stdout ----
diff of run.stderr:
2 stack backtrace:
3    0: std::panicking::begin_panic::<&str>
4    1: runtime_switch::main
+    2: <fn() as core::ops::function::FnOnce<()>>::call_once
+    2: <fn() as core::ops::function::FnOnce<()>>::call_once
5 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
6 


The actual run.stderr differed from the expected run.stderr.
Actual run.stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panics/runtime-switch.v0/runtime-switch.v0.run.stderr
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu

error in revision `v0`: 1 errors occurred comparing run output.
status: exit status: 101
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panics/runtime-switch.v0/a"
------------------------------------------

------------------------------------------
stderr:
---

------------------------------------------


---- [ui] ui/panics/runtime-switch.rs#legacy stdout ----
diff of run.stderr:
2 stack backtrace:
3    0: std::panicking::begin_panic
4    1: runtime_switch::main
+    2: core::ops::function::FnOnce::call_once
+    2: core::ops::function::FnOnce::call_once
5 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
6 


The actual run.stderr differed from the expected run.stderr.
Actual run.stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panics/runtime-switch.legacy/runtime-switch.legacy.run.stderr

error in revision `legacy`: 1 errors occurred comparing run output.
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/panics/runtime-switch.legacy/a"
stdout:
------------------------------------------

@bors
Copy link
Contributor

bors commented Feb 1, 2022

💔 Test failed - checks-actions

@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 Feb 1, 2022
@matthiaskrgr matthiaskrgr deleted the rollup-pbduyl6 branch February 13, 2022 00:53
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants