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 #111750

Closed
wants to merge 16 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 16 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.
…, 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 😁
@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. rollup A PR which is a rollup labels May 19, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented May 19, 2023

📌 Commit 4230834 has been approved by matthiaskrgr

It is now in the queue for this repository.

@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
@bors
Copy link
Contributor

bors commented May 19, 2023

⌛ Testing commit 4230834 with merge 3f79ff2204fee8c52e1cfcda8563db6edb459c7e...

@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 42.842
    Finished release [optimized] target(s) in 43.93s
     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]:0x19008e)
    at rust_panic (<anonymous>:wasm-function[1718]:0x18fe98)
    at _ZN3std9panicking20rust_panic_with_hook17hb9038416d9a2b97eE (<anonymous>:wasm-function[1717]:0x18fe8a)
    at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17hd90da3d565df938dE (<anonymous>:wasm-function[1702]:0x18ed4b)
    at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17h2528644a8b8b1ca8E (<anonymous>:wasm-function[1701]:0x18ecb0)
    at rust_begin_unwind (<anonymous>:wasm-function[1712]:0x18fb1a)
    at _ZN4core9panicking9panic_fmt17h5a53469b5de8b928E (<anonymous>:wasm-function[1808]:0x191ddb)
    at _ZN9coretests4iter8adapters11map_windows11check_drops17hd29bf682b72b1f43E (<anonymous>:wasm-function[415]:0x39445)
    at _ZN4core3ops8function6FnOnce9call_once17hbc937db7ce74843cE (<anonymous>:wasm-function[956]:0xe58a1)
    at _ZN4test28__rust_begin_short_backtrace17hbed63b6082c0a189E (<anonymous>:wasm-function[1327]:0x15aa85)
    at _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h165fcc6ca8039a52E (<anonymous>:wasm-function[1326]:0x15aa78)
    at _ZN4test8run_test14run_test_inner17h711b907f941ab7afE (<anonymous>:wasm-function[1537]:0x1837b0)
    at _ZN4test8run_test17hfebebce077fffbfeE (<anonymous>:wasm-function[1441]:0x16bec4)
    at _ZN4test7console17run_tests_console17h79937b90534d8017E (<anonymous>:wasm-function[1434]:0x167df6)
    at _ZN4test9test_main17h544617e592227b77E (<anonymous>:wasm-function[1535]:0x182a72)
    at _ZN4test16test_main_static17hbc98b15c350ff64dE (<anonymous>:wasm-function[1536]:0x182c5f)
    at _ZN9coretests4main17hdd946f3578c18ee5E (<anonymous>:wasm-function[1281]:0x156d9c)
    at _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h3ad8d3044a0fa301E (<anonymous>:wasm-function[9]:0x25d8)
    at _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h361d9415fb921c66E (<anonymous>:wasm-function[10]:0x25fa)
    at _ZN3std2rt19lang_start_internal17h2f6827eb9af84dd6E (<anonymous>:wasm-function[1634]:0x18c3fb)
error: test failed, to rerun pass `-p core --test coretests`

@bors
Copy link
Contributor

bors commented May 19, 2023

💔 Test failed - checks-actions

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

bors commented May 21, 2023

☔ The latest upstream changes (presumably #111696) made this pull request unmergeable. Please resolve the merge conflicts.

@matthiaskrgr matthiaskrgr deleted the rollup-floun0z branch March 16, 2024 18:19
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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.