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

Merged
merged 17 commits into from
Jul 12, 2024
Merged

Rollup of 8 pull requests #127614

merged 17 commits into from
Jul 12, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

estebank and others added 17 commits May 9, 2024 23:25
When encountering a move conflict, on an expression that is `!Copy` passed as an argument to an `fn` that is `impl AsRef`, suggest borrowing the expression.

```
error[E0382]: use of moved value: `bar`
  --> f204.rs:14:15
   |
12 |     let bar = Bar;
   |         --- move occurs because `bar` has type `Bar`, which does not implement the `Copy` trait
13 |     foo(bar);
   |         --- value moved here
14 |     let baa = bar;
   |               ^^^ value used here after move
   |
help: borrow the value to avoid moving it
   |
13 |     foo(&bar);
   |         +
```

Fix rust-lang#41708
That would give it alignment of 1 which is ABI-incompatible with its C
definition.
On s390x, every use of the f16 data type will currently ICE
due to llvm/llvm-project#50374,
causing doctest failures on the platform.

Most doctests were already restricted to certain platforms,
so fix this by likewise restricting the remaining five.
…ggestions as well

This commit changes the error reporting mechanism for not implemented
traits to skip impl marked as `#[diagnostic::do_not_recommend]` in the
help part of the error message ("the following other types implement
trait `Foo`:"). The main use case here is to allow crate authors to skip
non-meaningful confusing suggestions. A common example for this are
fully generic impls on tuples.
Name this something that is less confusable with an atomic consume API for
`{Lazy,Once}Lock`.
Remove the unstable `extern "wasm"` ABI (`wasm_abi` feature tracked
in rust-lang#83788).

As discussed in rust-lang#127513 (comment)
and following, this ABI is a failed experiment that did not end
up being used for anything. Keeping support for this ABI in LLVM 19
would require us to switch wasm targets to the `experimental-mv`
ABI, which we do not want to do.

It should be noted that `Abi::Wasm` was internally used for two
things: The `-Z wasm-c-abi=legacy` ABI that is still used by
default on some wasm targets, and the `extern "wasm"` ABI. Despite
both being `Abi::Wasm` internally, they were not the same. An
explicit `extern "wasm"` additionally enabled the `+multivalue`
feature.

I've opted to remove `Abi::Wasm` in this patch entirely, instead
of keeping it as an ABI with only internal usage. Both
`-Z wasm-c-abi` variants are now treated as part of the normal
C ABI, just with different different treatment in
adjust_for_foreign_abi.
Suggest borrowing on fn argument that is `impl AsRef`

When encountering a move conflict, on an expression that is `!Copy` passed as an argument to an `fn` that is `impl AsRef`, suggest borrowing the expression.

```
error[E0382]: use of moved value: `bar`
  --> f204.rs:14:15
   |
12 |     let bar = Bar;
   |         --- move occurs because `bar` has type `Bar`, which does not implement the `Copy` trait
13 |     foo(bar);
   |         --- value moved here
14 |     let baa = bar;
   |               ^^^ value used here after move
   |
help: borrow the value to avoid moving it
   |
13 |     foo(&bar);
   |         +
```

Fix rust-lang#41708
…hpratt

Don't mark `DEBUG_EVENT` struct as `repr(packed)`

That would give it alignment of 1 which is ABI-incompatible with its C definition.
…oss35

core: Limit remaining f16 doctests to x86_64 linux

On s390x, every use of the f16 data type will currently ICE due to llvm/llvm-project#50374, causing doctest failures on the platform.

Most doctests were already restricted to certain platforms, so fix this by likewise restricting the remaining five.
…y, r=lcnr

Make sure that labels are defined after the primary span in diagnostics

Putting a `#[label]` before a `#[primary_span]` results in that label being overwritten, due to the semantics of `Diagnostic::span` and the fact that labels are stored in the `MultiSpan` of the diagnostic.

This isn't possible to fix in general, since a lot of code actually *relies* in this overwriting behavior (e.g. `rustc_on_unimplemented`). However, it's useful to enforce this for derive-diagnostics, since this is certainly never what you intend to do in a derived diagnostic, where all the fields are meaningful parts of the diagnostic being rendered.

This only matters for `#[label]`, since those are the ones stored in the `MultiSpan` of the error.

We could also make this "just work" by sorting the attrs or processing the primary span attr first, however I think it's kinda pointless to do.

There was 1 case where this mattered, but we literally didn't have a test exercising that diagnostic 🙃
…nd_also_skips_help, r=compiler-errors

Allows `#[diagnostic::do_not_recommend]` to supress trait impls in suggestions as well

This commit changes the error reporting mechanism for not implemented traits to skip impl marked as `#[diagnostic::do_not_recommend]` in the help part of the error message ("the following other types implement trait `Foo`:"). The main use case here is to allow crate authors to skip non-meaningful confusing suggestions. A common example for this are fully generic impls on tuples.

Related to rust-lang#51992

r? `@compiler-errors`
… r=workingjubilee

Rename `lazy_cell_consume` to `lazy_cell_into_inner`

Name this something that is less confusable with an atomic consume API for `{Lazy,Once}Lock`.
Remove extern "wasm" ABI

Remove the unstable `extern "wasm"` ABI (`wasm_abi` feature tracked in rust-lang#83788).

As discussed in rust-lang#127513 (comment) and following, this ABI is a failed experiment that did not end up being used for anything. Keeping support for this ABI in LLVM 19 would require us to switch wasm targets to the `experimental-mv` ABI, which we do not want to do.

It should be noted that `Abi::Wasm` was internally used for two things: The `-Z wasm-c-abi=legacy` ABI that is still used by default on some wasm targets, and the `extern "wasm"` ABI. Despite both being `Abi::Wasm` internally, they were not the same. An explicit `extern "wasm"` additionally enabled the `+multivalue` feature.

I've opted to remove `Abi::Wasm` in this patch entirely, instead of keeping it as an ABI with only internal usage. Both `-Z wasm-c-abi` variants are now treated as part of the normal C ABI, just with different different treatment in
adjust_for_foreign_abi.
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 11, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Jul 11, 2024

📌 Commit fa3ce50 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 Jul 11, 2024
@bors
Copy link
Contributor

bors commented Jul 11, 2024

⌛ Testing commit fa3ce50 with merge e390237...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 11, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#124599 (Suggest borrowing on fn argument that is `impl AsRef`)
 - rust-lang#127572 (Don't mark `DEBUG_EVENT` struct as `repr(packed)`)
 - rust-lang#127588 (core: Limit remaining f16 doctests to x86_64 linux)
 - rust-lang#127591 (Make sure that labels are defined after the primary span in diagnostics)
 - rust-lang#127598 (Allows `#[diagnostic::do_not_recommend]` to supress trait impls in suggestions as well)
 - rust-lang#127599 (Rename `lazy_cell_consume` to `lazy_cell_into_inner`)
 - rust-lang#127601 (check is_ident before parse_ident)
 - rust-lang#127605 (Remove extern "wasm" ABI)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jul 11, 2024

💥 Test timed out

@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 Jul 11, 2024
@matthiaskrgr
Copy link
Member Author

@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 Jul 11, 2024
@bors
Copy link
Contributor

bors commented Jul 11, 2024

⌛ Testing commit fa3ce50 with merge 5e311f9...

@bors
Copy link
Contributor

bors commented Jul 12, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 5e311f9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 12, 2024
@bors bors merged commit 5e311f9 into rust-lang:master Jul 12, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 12, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#124599 Suggest borrowing on fn argument that is impl AsRef 92cf869102499fd4e78703e44db1bafc615283bb (link)
#127572 Don't mark DEBUG_EVENT struct as repr(packed) 3ef1ae350c516c17e50aa7c82002645fc2271e5e (link)
#127588 core: Limit remaining f16 doctests to x86_64 linux a5350164582f3027a7c18600faa7f33465300b8d (link)
#127591 Make sure that labels are defined after the primary span in… eda5cefe9bdbd6bff1e485be008255a052830a47 (link)
#127598 Allows #[diagnostic::do_not_recommend] to supress trait i… 61bb1a08329c5f958bb06e990fa129f0a45a542b (link)
#127599 Rename lazy_cell_consume to lazy_cell_into_inner 19759c43853d53f8d5a5a38aa0527798af949e60 (link)
#127601 check is_ident before parse_ident c64f16c307fbd398ac296e2fa0d28584d921cfba (link)
#127605 Remove extern "wasm" ABI 6b5220d999a5bb7b152e9ca343cd3e4414ae1b9f (link)

previous master: 5315cbe15b

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5e311f9): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 0.8%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
5.7% [5.7%, 5.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.1% [-4.1%, -4.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [-4.1%, 5.7%] 2

Cycles

Results (primary 0.8%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.8% [0.8%, 0.9%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [0.8%, 0.9%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 705.539s -> 704.882s (-0.09%)
Artifact size: 328.69 MiB -> 328.66 MiB (-0.01%)

jaisnan pushed a commit to jaisnan/rust-dev that referenced this pull request Jul 29, 2024
Update Rust toolchain from nightly-2024-07-12 to nightly-2024-07-13
without any other source changes.
This is an automatically generated pull request. If any of the CI checks
fail, manual intervention is required. In such a case, review the
changes at https://github.com/rust-lang/rust from
rust-lang@5315cbe
up to
rust-lang@c6727fc.
The log for this commit range is:
rust-lang@c6727fc9b5 Auto merge of
rust-lang#123351 - beetrees:x86-ret-snan-rust, r=nikic,workingjubilee
rust-lang@62c068feea Auto merge of
rust-lang#127636 - nnethercote:fix-Parser-look_ahead, r=oli-obk
rust-lang@5d76a13bbe Auto merge of
rust-lang#127653 - matthiaskrgr:rollup-72bqgvp, r=matthiaskrgr
rust-lang@f11c2c8e95 Rollup merge of
rust-lang#127648 - Kobzol:ci-lower-timeout, r=pietroalbini
rust-lang@526da2366a Rollup merge of
rust-lang#127627 - lcnr:rustc_search_graph, r=compiler-errors
rust-lang@f5fa6fb602 Rollup merge of
rust-lang#127613 - nikic:riscv-update, r=cuviper
rust-lang@b4f002d2e5 Rollup merge of
rust-lang#127552 - onur-ozkan:unnecessary-git-usage, r=Kobzol
rust-lang@8ceb4e49ff Rollup merge of
rust-lang#127433 - dtolnay:conststrlen, r=workingjubilee
rust-lang@f9b3e8b387 Rollup merge of
rust-lang#126827 - the8472:pidfd-spawn, r=workingjubilee
rust-lang@18152d72a4 Rollup merge of
rust-lang#126639 - sayantn:amx, r=Amanieu
rust-lang@65ea92d4a1 Rollup merge of
rust-lang#124980 - zachs18:rc-allocator, r=Amanieu
rust-lang@05eac57ef6 Auto merge of
rust-lang#127479 - Urgau:rustc-stable-hash, r=michaelwoerister
rust-lang@15f770b143 enable fuzzing of
`SearchGraph`
rust-lang@cae9d480bf Adjust tests for x86
"Rust" ABI changes
rust-lang@3f4b9dd463 Lower timeout of CI
jobs to 4 hours
rust-lang@7f1518bddd Add instability
attribute on private const_strlen function
rust-lang@b286722878 Auto merge of
rust-lang#127635 - matthiaskrgr:rollup-foopajr, r=matthiaskrgr
rust-lang@100f3fd133 Add a new special
case to `Parser::look_ahead`.
rust-lang@ebe1305b1e Remove the bogus
special case from `Parser::look_ahead`.
rust-lang@dad95578b0 Add unit tests for
`Parser::look_ahead`.
rust-lang@ec05c4ea3f Add the feature gate
and target-features
rust-lang@c2b7842555 Rollup merge of
rust-lang#127625 - SkiFire13:revert-comment-deletion, r=workingjubilee
rust-lang@ca576eae4e Rollup merge of
rust-lang#127622 - compiler-errors:builtin-internal, r=lqd
rust-lang@fe564c10ab Rollup merge of
rust-lang#127607 - Zalathar:normalize-hint, r=wesleywiser
rust-lang@83d1a1b252 Rollup merge of
rust-lang#127596 - tesuji:help-unwrap-or, r=compiler-errors
rust-lang@1e7ad4c3ed Rollup merge of
rust-lang#127422 - greaka:master, r=workingjubilee
rust-lang@58fe37f2c3 Rollup merge of
rust-lang#127164 - Nadrieril:clean-lowering-loop, r=matthewjasper
rust-lang@4a31a6c32a Auto merge of
rust-lang#127382 - estebank:const-let, r=compiler-errors
rust-lang@5e311f933d Auto merge of
rust-lang#127614 - matthiaskrgr:rollup-8geziwi, r=matthiaskrgr
rust-lang@a776e5f922 Add doc for
deconstruct_option_or_result
rust-lang@872d7b82e1 Add suggestion for
`Option<&Vec<T>> -> Option<&[T]`
rust-lang@d9170dc666 Add regression test
for issue 127545
rust-lang@4df75140dd Fix aarch64 test
rust-lang@cbe75486f7 Account for `let foo
= expr`; to suggest `const foo: Ty = expr;`
rust-lang@b56dc8ee90 Use verbose style
when suggesting changing `const` with `let`
rust-lang@d9021791eb Revert accidental
comment deletion
rust-lang@b77d3ef7c4 Mark builtin syntax
as internal
rust-lang@fa3ce50f0b Rollup merge of
rust-lang#127605 - nikic:remove-extern-wasm, r=oli-obk
rust-lang@d433f176ef Rollup merge of
rust-lang#127601 - trevyn:issue-127600, r=compiler-errors
rust-lang@47ab86653e Rollup merge of
rust-lang#127599 - tgross35:lazy_cell_consume-rename, r=workingjubilee
rust-lang@a10b4d1463 Rollup merge of
rust-lang#127598 - weiznich:diagnostic_do_not_recommend_also_skips_help,
r=compiler-errors
rust-lang@73c500b3a7 Rollup merge of
rust-lang#127591 - compiler-errors:label-after-primary, r=lcnr
rust-lang@380c78741e Rollup merge of
rust-lang#127588 - uweigand:s390x-f16-doctests, r=tgross35
rust-lang@6fd955549a Rollup merge of
rust-lang#127572 - tbu-:pr_debug_event_nonpacked, r=jhpratt
rust-lang@8de487fdbd Rollup merge of
rust-lang#124599 - estebank:issue-41708, r=wesleywiser
rust-lang@55256c5a18 Update
dist-riscv64-linux to binutils 2.40
rust-lang@977439d9b8 Use uplifted
`rustc-stable-hash` crate in `rustc_data_structures`
rust-lang@f56b2074c6 solve -> solve/mod
rust-lang@08a2992d6b compiletest: Better
error message for bad `normalize-*` headers
rust-lang@8a50bcbdce Remove extern "wasm"
ABI
rust-lang@a01f49e7f3 check is_ident
before parse_ident
rust-lang@ab56fe2053 Rename
`lazy_cell_consume` to `lazy_cell_into_inner`
rust-lang@27d5db166e Allows
`#[diagnostic::do_not_recommend]` to supress trait impls in suggestions
as well
rust-lang@12ae282987 Fix diagnostic and
add a test for it
rust-lang@df72e478b0 Make sure that
labels are defined after the primary span in diagnostics
rust-lang@0065763950 core: Limit
remaining f16 doctests to x86_64 linux
rust-lang@45ad522e87 Don't mark
`DEBUG_EVENT` struct as `repr(packed)`
rust-lang@0134bd2e67 remove unnecessary
`git` usages
rust-lang@42772e98e0 Address review
comments
rust-lang@3e030b38ef Return the
`otherwise_block` instead of passing it as argument
rust-lang@fc40247c6b Factor out the
"process remaining candidates" cases
rust-lang@8a222ffd6b Don't try to save an
extra block
rust-lang@c5062f7318 Move or-pattern
expansion inside the main part of the algorithm
rust-lang@bff4d213fa Factor out the
special handling of or-patterns
rust-lang@5bf50e66f9 Move a function
rust-lang@53d3e6217b Stabilize
const_cstr_from_ptr (CStr::from_ptr, CStr::count_bytes)
rust-lang@585ca16e0b as_simd: fix comment
to be in line with 507583a (rust-lang#121201)
rust-lang@0f643c449a Ensure tests don't
fail on i586 in CI
rust-lang@ec0c755704 Check that we get
somewhat sane PIDs when spawning with pidfds
rust-lang@3e4e31b7bf more fine-grained
feature-detection for pidfd spawning
rust-lang@0ce361938e document safety
properties of the internal Process::new constructor
rust-lang@6687a3f7da use pidfd_spawn for
faster process creation when pidfds are requested
rust-lang@5c46acac04 document the cvt
methods
rust-lang@0e1c832dbd Update
`platform-support.md` to reflect improvements in returning floats on
32-bit x86
rust-lang@952becc0bd Ensure floats are
returned losslessly by the Rust ABI on 32-bit x86
rust-lang@a1ad6346d6 Add fn allocator
method to rc/sync::Weak. Relax Rc<T>/Arc<T>::allocator to allow unsized
T.
rust-lang@2df4f7dd8c Suggest borrowing on
fn argument that is `impl AsRef`

Co-authored-by: celinval <35149715+celinval@users.noreply.github.com>
@matthiaskrgr matthiaskrgr deleted the rollup-8geziwi branch September 1, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic merged-by-bors This PR was explicitly merged by bors. 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-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.