Skip to content

Rollup of 10 pull requests #111760

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 21 commits into from

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 21 commits May 12, 2023 02:08
Bump the version of dependency `cc` to v1.0.77 for `bootstrap`, syncing with rust/Cargo.lock

Resolves rust-lang#111700
This is inherited from the old PR

This method returns an iterator over mapped windows of the starting
iterator. Adding the more straight-forward `Iterator::windows` is not
easily possible right now as the items are stored in the iterator type,
meaning the `next` call would return references to `self`. This is not
allowed by the current `Iterator` trait design. This might change once
GATs have landed.

The idea has been brought up by @m-ou-se here:
https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Iterator.3A.3A.7Bpairwise.2C.20windows.7D/near/224587771

Co-authored-by: Lukas Kalbertodt <lukas.kalbertodt@gmail.com>
Before:
```
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1335:29
              1: <rustc_errors::Handler>::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1124:9
...
```

After:
```
   = note: delayed at compiler/rustc_parse/src/parser/diagnostics.rs:2158:28
              0: <rustc_errors::HandlerInner>::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1335:29
              1: <rustc_errors::Handler>::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1124:9
```

This both makes the relevant frame easier to find without having to dig
through diagnostic internals, and avoids the weird-looking formatting
for the first frame.
* ensuring that offset_of!(Self, ...) works iff inside an impl block
* ensuring that the output type is usize and doesn't coerce. this can be
  changed in the future, but if it is done, it should be a conscious descision
* improving the privacy checking test
* ensuring that generics don't let you escape the unsized check
- add `must_use` to `early_error_no_abort`

  this was already being used at its only callsite, but this ensures
that new code remembers to use it if it's called in the future.

- remove outdated and incorrect comment in `builder.rs`.
  `doc_rust_lang_org_channel` doesn't exist in rustdoc, it gets it from
an env var instead.
- Pass a slice instead of an iterator to `debug_dump`.
- For each CGU set, print: the number of CGUs, the max and min size, and
  the ratio of the max and min size (which indicates how evenly sized
  they are).
- Print a `FINAL` entry, showing the absolute final results.
…, r=Mark-Simulacrum

Add `Iterator::map_windows`

Tracking issue:  rust-lang#87155.

This is inherited from the old PR  rust-lang#82413.

Unlike rust-lang#82413, this PR implements the `MapWindows` to be lazy: only when pulling from the outer iterator, `.next()` of the inner iterator will be called.

## Implementaion Steps
- [x] Implement `MapWindows` to keep the iterators' [*Laziness*](https://doc.rust-lang.org/std/iter/index.html#laziness) contract.
- [x] Fix the known bug of memory access error.
- [ ] Full specialization of iterator-related traits for `MapWindows`.
    - [x] `Iterator::size_hint`,
    - [x] ~`Iterator::count`~,
    - [x] `ExactSizeIterator` (when `I: ExactSizeIterator`),
    - [x] ~`TrustedLen` (when `I: TrustedLen`)~,
    - [x] `FusedIterator`,
    - [x] ~`Iterator::advance_by`~,
    - [x] ~`Iterator::nth`~,
    - [ ] ...
- [ ] More tests and docs.

## Unresolved Questions:
- [ ] Is there any more iterator-related traits should be specialized?
- [ ] Is the double-space buffer worth?
- [ ] Should there be `rmap_windows` or something else?
- [ ] Taking GAT for consideration, should the mapper function be `FnMut(&[I::Item; N]) -> R` or something like `FnMut(ArrayView<'_, I::Item, N>) -> R`? Where `ArrayView` is mentioned in rust-lang/generic-associated-types-initiative#2.
    - It can save memory, only the same size as the array window is needed,
    - It is more efficient, which requires less data copies,
    - It is possibly compatible with the GATified version of `LendingIterator::windows`.
    - But it prevents the array pattern matching like `iter.map_windows(|_arr: [_; N]| ())`, unless we extend the array pattern to allow matching the `ArrayView`.
…e, r=wesleywiser

Dont check `must_use` on nested `impl Future` from fn

Fixes (but does not close, per beta policy) rust-lang#111484

Also fixes a `FIXME` left in the code about (presumably) false-positives on non-async `#[must_use] fn() -> impl Future` cases, though if that's not desirable to include in the beta backport then I can certainly revert it.

Beta nominating as it fixes a beta ICE.
very minor cleanups

- add `must_use` to `early_error_no_abort`

  this was already being used at its only callsite, but this ensures that new code remembers to use it if it's called in the future. found this while investigating rust-lang#110090.

- remove outdated and incorrect comment in `builder.rs`. `doc_rust_lang_org_channel` doesn't exist in rustdoc, it gets it from an env var instead: https://github.com/rust-lang/rust/blob/b275d2c30b6e88cc48747f349f7137076d450658/src/librustdoc/clean/utils.rs#L569-L573
Add more tests for the offset_of macro

Implements what I [suggested in the tracking issue](rust-lang#106655 (comment)), plus some further improvements:

* ensuring that offset_of!(Self, ...) works iff inside an impl block
* ensuring that the output type is usize and doesn't coerce. this can be changed in the future, but if it is done, it should be a conscious decision
* improving the privacy checking test
* ensuring that generics don't let you escape the unsized check

r? ```@WaffleLapkin```
Bump `cc` for `bootstrap`

Bump the version of dependency `cc` to `1.0.77` for `bootstrap`, syncing with `rust/Cargo.lock`

Resolves rust-lang#111700
…ler-errors

Give a more useful location for where a span_bug was delayed

Before:
```
   = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1335:29
              1: <rustc_errors::Handler>::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1124:9
...
```

After:
```
   = note: delayed at compiler/rustc_parse/src/parser/diagnostics.rs:2158:28
              0: <rustc_errors::HandlerInner>::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1335:29
              1: <rustc_errors::Handler>::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1124:9
...
```

This both makes the relevant frame easier to find without having to dig through diagnostic internals, and avoids the weird-looking formatting for the first frame.

Found while working on rust-lang#111529.
…r=Nilstrieb

Fix doc comment for `ConstParamTy` derive

See rust-lang#111670 (comment)

Thanks ``@Nilstrieb`` for the pointer :)
…iler-errors

style: do not overwrite obligations

this looks sketchy and would break if the original obligations do not start out empty 😁
…lor, r=notriddle

Migrate GUI colors test to original CSS color format

Follow-up of rust-lang#111459.

r? `@notriddle`
…bug-output, r=lqd

Improve cgu merging debug output

r? `@lqd`
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels May 19, 2023
@GuillaumeGomez
Copy link
Member Author

@bors r+ rollup=never p=10

@bors
Copy link
Collaborator

bors commented May 19, 2023

📌 Commit 807f36a has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 19, 2023
@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 May 19, 2023
@bors
Copy link
Collaborator

bors commented May 19, 2023

⌛ Testing commit 807f36a with merge 63fca92d869ce4e4b87c74c868ccb590d24d2c8a...

@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] coretests test:true 56.547
    Finished release [optimized] target(s) in 57.73s
     Running tests/lib.rs (obj/build/x86_64-unknown-linux-gnu/stage1-std/wasm32-unknown-unknown/release/deps/coretests-6c259f203458ed7b.wasm)
RuntimeError: unreachable
    at __rust_start_panic (<anonymous>:wasm-function[1735]:0x19008b)
    at rust_panic (<anonymous>:wasm-function[1718]:0x18fe95)
    at _ZN3std9panicking20rust_panic_with_hook17hb798ab2cbcfb6ba3E (<anonymous>:wasm-function[1717]:0x18fe87)
    at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17hb598452ca9597719E (<anonymous>:wasm-function[1702]:0x18ed48)
    at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17h16d97b514d01d699E (<anonymous>:wasm-function[1701]:0x18ecad)
    at rust_begin_unwind (<anonymous>:wasm-function[1712]:0x18fb17)
    at _ZN4core9panicking9panic_fmt17h7c90e7ba60ea945fE (<anonymous>:wasm-function[1808]:0x191dd8)
    at _ZN9coretests4iter8adapters11map_windows11check_drops17h0a4690f7ef288b23E (<anonymous>:wasm-function[860]:0xa6b2c)
    at _ZN4core3ops8function6FnOnce9call_once17ha2f6d7281640b5e4E (<anonymous>:wasm-function[900]:0xb33cd)
    at _ZN4test28__rust_begin_short_backtrace17h312d847273667169E (<anonymous>:wasm-function[1334]:0x15b303)
    at _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h687d8dbf8038904cE (<anonymous>:wasm-function[1333]:0x15b2f6)
    at _ZN4test8run_test14run_test_inner17hf75e6699f1a5560cE (<anonymous>:wasm-function[1537]:0x1837ae)
    at _ZN4test8run_test17h10680a0667226300E (<anonymous>:wasm-function[1441]:0x16bec2)
    at _ZN4test7console17run_tests_console17hbd2b2316100f4794E (<anonymous>:wasm-function[1434]:0x167df4)
    at _ZN4test9test_main17h97c1afa22e19acf5E (<anonymous>:wasm-function[1535]:0x182a70)
    at _ZN4test16test_main_static17h4a2ded96bed224f0E (<anonymous>:wasm-function[1536]:0x182c5d)
    at _ZN9coretests4main17h52b8350c3bb86c19E (<anonymous>:wasm-function[1281]:0x156d9b)
    at _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h89c420c423ecde24E (<anonymous>:wasm-function[9]:0x25d6)
    at _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h9b233e0216e07e05E (<anonymous>:wasm-function[10]:0x25f8)
    at _ZN3std2rt19lang_start_internal17hd23222e4fb683f80E (<anonymous>:wasm-function[1634]:0x18c3f8)
error: test failed, to rerun pass `-p core --test coretests`

@bors
Copy link
Collaborator

bors commented May 19, 2023

💔 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 May 19, 2023
@GuillaumeGomez
Copy link
Member Author

I don't see any change directly related to the failure. Retrying just in case...

@bors retry

@bors bors added 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-review Status: Awaiting review from the assignee but also interested parties. labels May 19, 2023
@lukas-code
Copy link
Member

From the backtrace it looks like the test in #94667 is failing. This is probably due to wasm not supporting unwinding panics.

let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {

@GuillaumeGomez
Copy link
Member Author

Thanks! Closing this rollup then.

@GuillaumeGomez GuillaumeGomez deleted the rollup-8a0zsgm branch May 19, 2023 15:31
@GuillaumeGomez GuillaumeGomez mentioned this pull request May 19, 2023
16 tasks
# for free to join this conversation on GitHub. Already have an account? # 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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.