Commit Graph

268556 Commits

Author SHA1 Message Date
Matthias Krüger
7ad2f60926
Rollup merge of #131798 - maurer:range-inlining, r=durin42
llvm: Tolerate propagated range metadata

llvm/llvm-project#91101 propagates range information across inlining, resulting in more metadata in this test. Tolerate the range metadata if it appears.

``@rustbot:`` label +llvm-main

r? ``@durin42``

Please wait a moment before approving, putting the llvm-main tag on it to make sure it fixes the integration test.
2024-10-17 12:07:21 +02:00
Matthias Krüger
c1f370254c
Rollup merge of #131748 - lcnr:typing-mode, r=compiler-errors
cleanup canonical queries

best reviewed commit by commit. adding `CanonicalQueryInput` to stop returning `defining_opaque_types` in query responses is the most involved change here.

r? ``@compiler-errors``
2024-10-17 12:07:21 +02:00
Matthias Krüger
f6b699c9c0
Rollup merge of #131595 - fmease:rustdoc-json-mv-obj-safe-dyn-compat, r=aDotInTheVoid
rustdoc-JSON: Rename "object safe" to "dyn compatible"

~~Blocked: Sits atop #131594. Only the last commit is relevant.~~ (rebased)

Part of #130852.

r? aDotInTheVoid or rustdoc
2024-10-17 12:07:20 +02:00
Matthias Krüger
9aee5d98cf
Rollup merge of #131583 - heiher:loong-issue-118053, r=jieyouxu
Setting up indirect access to external data for loongarch64-linux-{musl,ohos}

In issue #118053, the `loongarch64-unknown-linux-gnu` target needs indirection to access external data, and so do the `loongarch64-unknown-linux-musl` and `loongarch64-unknown-linux-ohos` targets.
2024-10-17 12:07:20 +02:00
Matthias Krüger
21c57f5490
Rollup merge of #128391 - cafce25:issue-128390, r=lcnr
Change orphan hint from "only" to "any uncovered type inside..."

Fix #128390
2024-10-17 12:07:19 +02:00
lcnr
6cf4cb8484 bless mir-opt tests 2024-10-17 10:22:55 +02:00
lcnr
3360c1773a move defining_opaque_types out of Canonical 2024-10-17 10:22:52 +02:00
lcnr
5834ba1ab7 remove Canonical::unchecked_rebind, it's unused 2024-10-17 09:53:27 +02:00
lcnr
f3ce557fcd DropckOutlives to rustc_middle 2024-10-17 09:53:27 +02:00
lcnr
9334d85e69 remove type_op constructors 2024-10-17 09:53:27 +02:00
lcnr
401f9b4e0a ImpliedOutlivesBounds to rustc_middle 2024-10-17 09:53:27 +02:00
bors
06d261daf6 Auto merge of #129582 - nbdd0121:unwind, r=nnethercote
Make destructors on `extern "C"` frames to be executed

This would make the example in #123231 print "Noisy Drop". I didn't mark this as fixing the issue because the behaviour is yet to be spec'ed.

Tracking:

- https://github.com/rust-lang/rust/issues/74990
2024-10-17 04:34:51 +00:00
bors
dd5127615a Auto merge of #131796 - cuviper:no-waker-waker, r=Mark-Simulacrum
Remove `Waker::waker` from 1.82 relnotes

This was noticed in <https://github.com/rust-lang/blog.rust-lang.org/pull/1415#pullrequestreview-2371307666>.
2024-10-17 02:14:27 +00:00
León Orell Valerian Liehr
2e6f3bd1d3
rustdoc-JSON: Rename "object safe" to "dyn compatible" 2024-10-16 23:00:49 +02:00
bors
798fb83f7d Auto merge of #131797 - matthiaskrgr:rollup-lzpze2k, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #130989 (Don't check unsize goal in MIR validation when opaques remain)
 - #131657 (Rustfmt `for<'a> async` correctly)
 - #131691 (Delay ambiguous intra-doc link resolution after `Cache` has been populated)
 - #131730 (Refactor some `core::fmt` macros)
 - #131751 (Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe)
 - #131753 (Unify `secondary_span` and `swap_secondary_and_primary` args in `note_type_err`)
 - #131776 (Emscripten: Xfail backtrace ui tests)
 - #131777 (Fix trivially_copy_pass_by_ref in stable_mir)
 - #131778 (Fix needless_lifetimes in stable_mir)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-16 20:50:53 +00:00
Matthew Maurer
0e73095169 llvm: Tolerate propagated range metadata
llvm/llvm-project#91101 propagates range information across inlining,
resulting in more metadata in this test. Tolerate the range metadata if
it appears.
2024-10-16 18:38:26 +00:00
Matthias Krüger
50e93bc080
Rollup merge of #131778 - practicalrs:fix_needless_lifetimes, r=jieyouxu
Fix needless_lifetimes in stable_mir

Hi,

This PR fixes the following clippy warning

```
warning: the following explicit lifetimes could be elided: 'a
   --> compiler/stable_mir/src/mir/visit.rs:490:6
    |
490 | impl<'a> PlaceRef<'a> {
    |      ^^           ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
    |
490 - impl<'a> PlaceRef<'a> {
490 + impl PlaceRef<'_> {
    |
```

Best regards,
Michal
2024-10-16 20:15:56 +02:00
Matthias Krüger
ac6353ed43
Rollup merge of #131777 - practicalrs:fix_trivially_copy_pass_by_ref, r=jieyouxu
Fix trivially_copy_pass_by_ref in stable_mir

Hi,

This PR fixes the following clippy warnings

```
warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
    --> compiler/stable_mir/src/mir/body.rs:1042:34
     |
1042 |     fn subslice_ty(ty: Ty, from: &u64, to: &u64, from_end: &bool) -> Result<Ty, Error> {
     |                                  ^^^^ help: consider passing by value instead: `u64`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
     = note: requested on the command line with `-W clippy::trivially-copy-pass-by-ref`

warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
    --> compiler/stable_mir/src/mir/body.rs:1042:44
     |
1042 |     fn subslice_ty(ty: Ty, from: &u64, to: &u64, from_end: &bool) -> Result<Ty, Error> {
     |                                            ^^^^ help: consider passing by value instead: `u64`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
    --> compiler/stable_mir/src/mir/body.rs:1042:60
     |
1042 |     fn subslice_ty(ty: Ty, from: &u64, to: &u64, from_end: &bool) -> Result<Ty, Error> {
     |                                                            ^^^^^ help: consider passing by value instead: `bool`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

```

Best regards,
Michal
2024-10-16 20:15:56 +02:00
Matthias Krüger
c8ec8e6989
Rollup merge of #131776 - hoodmane:emscripten-xfail-backtrace-tests, r=jieyouxu
Emscripten: Xfail backtrace ui tests

It is possible to link libunwind and use the normal backtrace code, but it fails to symbolize stack traces. I investigated and could get the list of instruction pointers and symbol names, but I'm not sure how to use the dwarf info to map from instruction pointer to source location. In any case, fixing this is not a high priority.

See https://github.com/rust-lang/rust/issues/131738

r?jieyouxu
2024-10-16 20:15:55 +02:00
Matthias Krüger
80cbc6d40d
Rollup merge of #131753 - compiler-errors:swap-secondary, r=jieyouxu
Unify `secondary_span` and `swap_secondary_and_primary` args in `note_type_err`

Tiny tweak b/c working w `note_type_err` is kinda a mess.
2024-10-16 20:15:55 +02:00
Matthias Krüger
3b8fd5f895
Rollup merge of #131751 - compiler-errors:structurally-resolve, r=lcnr
Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe

We need to structurally resolve the lhs and rhs of the coercion. Also, renaming the method so it's less ambiguous about what it's doing... the word "may" gives more clear signal that it has false positives imo.

r? lcnr
2024-10-16 20:15:54 +02:00
Matthias Krüger
82952da360
Rollup merge of #131730 - zlfn:master, r=tgross35
Refactor some `core::fmt` macros

While looking at the macros in `core::fmt`, find that the macros are not well organized. So I created a patch to fix it.

[`core/src/fmt/num.rs`](https://github.com/rust-lang/rust/blob/master/library/core/src/fmt/num.rs)
*  `impl_int!` and `impl_uint!` macro are **completly** same. It would be better to combine for readability
* `impl_int!` has a problem that the indenting is not uniform. It has unified into 4 spaces
* `debug` macro in `num` renamed to `impl_Debug`, And it was moved to a position close to the `impl_Display`.

[`core/src/fmt/float.rs`](https://github.com/rust-lang/rust/blob/master/library/core/src/fmt/float.rs)
[`core/src/fmt/nofloat.rs`](https://github.com/rust-lang/rust/blob/master/library/core/src/fmt/nofloat.rs)
* `floating` macro now receive multiple idents at once. It makes the code cleaner.
* Modified the panic message more clearly in fallback function of `cfg(no_fp_fmt_parse)`
2024-10-16 20:15:54 +02:00
Matthias Krüger
87c31feab8
Rollup merge of #131691 - GuillaumeGomez:intra-doc-link-filter-out-2, r=notriddle
Delay ambiguous intra-doc link resolution after `Cache` has been populated

Fixes https://github.com/rust-lang/rust/issues/130233.

I was getting nowhere with #130278. I took a wrong turn at some point and ended making way too many changes so instead I started again back from 0 and this time it worked out as expected.

r? ```@notriddle```
2024-10-16 20:15:53 +02:00
Matthias Krüger
950fb62032
Rollup merge of #131657 - compiler-errors:rustfmt-modifiers, r=ytmimi
Rustfmt `for<'a> async` correctly

In #127054, we decided to move the trait bound modifier for `async for<'a> Fn()`  to `for<'a> async Fn()`. This wasn't adjusted in rustfmt, so this PR implements that. It also requires consolidating the bound formatting into the `Rewrite` impl for `PolyTraitRef`.

Fixes #131649
2024-10-16 20:15:53 +02:00
Matthias Krüger
b6a085a16e
Rollup merge of #130989 - compiler-errors:unsize-opaque, r=estebank
Don't check unsize goal in MIR validation when opaques remain

Similarly to `mir_assign_valid_types`, let's just skip when there are opaques. Fixes #130921.
2024-10-16 20:15:52 +02:00
Josh Stone
e0e2c4534a Remove Waker::waker from 1.82 relnotes 2024-10-16 11:12:55 -07:00
bors
7342830c05 Auto merge of #131792 - matthiaskrgr:rollup-480nwg4, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #130822 (Add `from_ref` and `from_mut` constructors to `core::ptr::NonNull`.)
 - #131381 (Implement edition 2024 match ergonomics restrictions)
 - #131594 (rustdoc: Rename "object safe" to "dyn compatible")
 - #131686 (Add fast-path when computing the default visibility)
 - #131699 (Try to improve error messages involving aliases in the solver)
 - #131757 (Ignore lint-non-snake-case-crate#proc_macro_ on targets without unwind)
 - #131783 (Fix explicit_iter_loop in rustc_serialize)
 - #131788 (Fix mismatched quotation mark)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-16 17:58:25 +00:00
Matthias Krüger
06cd22ceab
Rollup merge of #131788 - dufucun:master, r=lqd
Fix mismatched quotation mark
2024-10-16 19:18:33 +02:00
Matthias Krüger
75f418fb28
Rollup merge of #131783 - practicalrs:fix_explicit_iter_loop, r=compiler-errors
Fix explicit_iter_loop in rustc_serialize

Hi,

This PR fixes some clippy warnings

```
warning: it is more concise to loop over references to containers instead of using explicit iteration methods
   --> compiler/rustc_serialize/src/serialize.rs:675:18
    |
675 |         for e in self.iter() {
    |                  ^^^^^^^^^^^ help: to write this more concisely, try: `self`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop

```

Best regards,
Michal
2024-10-16 19:18:33 +02:00
Matthias Krüger
1014970462
Rollup merge of #131757 - c6c7:fixup-lint-non-snake-case-crate, r=jieyouxu
Ignore lint-non-snake-case-crate#proc_macro_ on targets without unwind

The lint-non-snake-case-crate test may emit a warning in stderr if the target does not support unwinding

```
warning: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic
```

Consequently, the test will fail on targets that don't support unwinding as written.

This change modifies the expected stderr for lint-non-snake-case-crate in the proc_macro_ to ignore lines that indicate a warning was emitted.
2024-10-16 19:18:32 +02:00
Matthias Krüger
aac91f75e3
Rollup merge of #131699 - compiler-errors:better-errors-for-projections, r=lcnr
Try to improve error messages involving aliases in the solver

1. Treat aliases as rigid only if it may not be defined and it's well formed (i.e. for projections, its trait goal is satisfied).
2. Record goals that are related to alias normalization under a new `GoalKind`, so we can look into them in the `BestObligation` visitor.
3. Try to deduplicate errors due to self types of goals that are un-normalizable aliases.

r? lcnr
2024-10-16 19:18:32 +02:00
Matthias Krüger
2560453256
Rollup merge of #131686 - Urgau:fast-path-vis, r=lqd
Add fast-path when computing the default visibility

This PR adds (or more correctly re-adds the) fast-path when computing the default visibility, by taking advantage of the fact that the "interposable" requested visibility always return the "default" codegen visibility.

Should address the small regression observed in https://github.com/rust-lang/rust/pull/131111#issuecomment-2402273967.

r? `@lqd`
2024-10-16 19:18:31 +02:00
Matthias Krüger
70477487b1
Rollup merge of #131594 - fmease:rustdoc-mv-obj-safe-dyn-compat, r=notriddle
rustdoc: Rename "object safe" to "dyn compatible"

Supersedes #126554:

1. In line with [T-lang's latest resolution](https://github.com/rust-lang/lang-team/issues/286#issuecomment-2338905118).
2. More comprehensive: Not only updates user-facing text but also source code.

Part of #130852.

Doesn't update rustdoc-JSON (will be filed separately).

r? `@notriddle` (rust-lang/lang-team#286) `@GuillaumeGomez` (for visibility)
2024-10-16 19:18:31 +02:00
Matthias Krüger
c1ed1f133e
Rollup merge of #131381 - Nadrieril:min-match-ergonomics, r=pnkfelix
Implement edition 2024 match ergonomics restrictions

This implements the minimalest version of [match ergonomics for edition 2024](https://rust-lang.github.io/rfcs/3627-match-ergonomics-2024.html). This minimal version makes it an error to ever reset the default binding mode. The implemented proposal is described precisely [here](https://hackmd.io/zUqs2ISNQ0Wrnxsa9nhD0Q#RFC-3627-nano), where it is called "RFC 3627-nano".

Rules:
- Rule 1C: When the DBM (default binding mode) is not `move` (whether or not behind a reference), writing `mut`, `ref`, or `ref mut` on a binding is an error.
- Rule 2C: Reference patterns can only match against references in the scrutinee when the DBM is `move`.

This minimal version is forward-compatible with the main proposals for match ergonomics 2024: [RFC3627](https://rust-lang.github.io/rfcs/3627-match-ergonomics-2024.html) itself, the alternative [rule 4-early variant](https://rust-lang.github.io/rfcs/3627-match-ergonomics-2024.html), and [others](https://hackmd.io/zUqs2ISNQ0Wrnxsa9nhD0Q). The idea is to give us more time to iron out a final proposal.

This includes a migration lint that desugars any offending pattern into one that doesn't make use of match ergonomics. Such patterns have identical meaning across editions.

This PR insta-stabilizes the proposed behavior onto edition 2024.

r? `@ghost`

Tracking:

- https://github.com/rust-lang/rust/issues/123076
2024-10-16 19:18:30 +02:00
Matthias Krüger
1817de609b
Rollup merge of #130822 - bjoernager:non-null-from-ref, r=dtolnay
Add `from_ref` and `from_mut` constructors to `core::ptr::NonNull`.

Relevant tracking issue: #130823

The `core::ptr::NonNull` type should have the convenience constructors `from_ref` and `from_mut` for parity with `core::ptr::from_ref` and `core::ptr::from_mut`.

Although the type in question already implements `From<&T>` and `From<&mut T>`, these new functions also carry the ability to be used in constant expressions (due to not being behind a trait).
2024-10-16 19:18:30 +02:00
dufucun
682bca30cc
Fix mismatched quotation mark 2024-10-17 00:16:19 +08:00
Charles Celerier
8991fd4bed Ignore lint-non-snake-case-crate#proc_macro_ on targets without unwind
The lint-non-snake-case-crate test may emit a warning in stderr if the
target does not support unwinding

```
warning: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic
```

Consequently, the test will fail on targets that don't support unwinding
as written.

This change prevents lint-non-snake-case-crate#proc_macro_ from running
on targets that don't support unwind by using the needs-unwind
directive.
2024-10-16 10:55:49 -04:00
bors
bed75e7c21 Auto merge of #131767 - cuviper:bump-stage0, r=Mark-Simulacrum
Bump bootstrap compiler to 1.83.0-beta.1

https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday
2024-10-16 14:40:08 +00:00
León Orell Valerian Liehr
6d82559bc1
rustdoc: Rename "object safe" to "dyn compatible" 2024-10-16 15:53:49 +02:00
Michal Piotrowski
b2b4ad4cc9
Fix explicit_iter_loop in rustc_serialize 2024-10-16 15:44:16 +02:00
bors
0037048da8 Auto merge of #131775 - Urgau:rollup-yc4a3sf, r=Urgau
Rollup of 10 pull requests

Successful merges:

 - #131582 (Add wasm32-unknown-emscripten platform support document)
 - #131694 (Make fuchsia-test-runner.py compatible with new JSON output from llvm-readelf)
 - #131700 (Fix match_same_arms in stable_mir)
 - #131712 (Mark the unstable LazyCell::into_inner const)
 - #131746 (Relax a memory order in `once_box`)
 - #131754 (Don't report bivariance error when nesting a struct with field errors into another struct)
 - #131760 (llvm: Match aarch64 data layout to new LLVM layout)
 - #131764 (Fix unnecessary nesting in run-make test output directories)
 - #131766 (Add mailmap entry for my dev-desktop setup)
 - #131771 (Handle gracefully true/false in `cfg(target(..))` compact)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-16 12:14:19 +00:00
Michal Piotrowski
a10a44956e
Fix needless_lifetimes in stable_mir 2024-10-16 13:31:23 +02:00
Michal Piotrowski
89ea9e44f0
Fix trivially_copy_pass_by_ref in stable_mir 2024-10-16 12:36:44 +02:00
Hood Chatham
476ea45c68 Emscripten: Xfail backtrace ui tests
It is possible to link libunwind and use the normal backtrace code, but it fails
to symbolize stack traces. I investigated and could get the list of instruction
pointers and symbol names, but I'm not sure how to use the dwarf info to map
from instruction pointer to source location. In any case, fixing this is
probably not a high priority.

See https://github.com/rust-lang/rust/issues/131738
2024-10-16 12:22:14 +02:00
Urgau
e0e1e35a48
Rollup merge of #131771 - Urgau:cfg-target-131759, r=jieyouxu
Handle gracefully true/false in `cfg(target(..))` compact

This PR handles gracefully `true`/`false` in `cfg(target(..))` compact instead of ICE.

r? `@nnethercote`
Fixes #131759
2024-10-16 12:03:45 +02:00
Urgau
ea063a2a20
Rollup merge of #131766 - jieyouxu:mailmap, r=lqd
Add mailmap entry for my dev-desktop setup
2024-10-16 12:03:44 +02:00
Urgau
43a142e4d0
Rollup merge of #131764 - Zalathar:double-dir, r=jieyouxu
Fix unnecessary nesting in run-make test output directories

Run-make tests were using `output_base_name` to determine their output directory, which results in a redundant subdirectory (e.g. `$build/test/run-make/<foo>/<foo>/`) because that method is intended to produce the name of an individual file.

The previous attempt to fix this double-nesting tried adding a special case in `output_base_dir`, which had the side-effect of breaking up-to-date checking for run-make tests, and had to be reverted in #131681.

The fix is simply to call `output_base_dir` directory, which gives the desired directory without any redundant part.

r? jieyouxu
2024-10-16 12:03:44 +02:00
Urgau
6b27c3057d
Rollup merge of #131760 - maurer:data-layout-aarch64, r=nikic
llvm: Match aarch64 data layout to new LLVM layout

LLVM has added 3 new address spaces to support special Windows use cases. These shouldn't trouble us for now, but LLVM requires matching data layouts.

See llvm/llvm-project#111879 for details
2024-10-16 12:03:43 +02:00
Urgau
329e570460
Rollup merge of #131754 - compiler-errors:bivariance-bivariance, r=estebank
Don't report bivariance error when nesting a struct with field errors into another struct

We currently have logic to avoid reporting lifetime bivariance ("lifetime parameter ... is never used") errors when a struct has field resolution errors. However, this doesn't apply transitively. This PR implements a simple visitor to do so.

This was reported [here](https://twitter.com/fasterthanlime/status/1846257921086165033) since a `derive(Deserialize, Serialize)` ends up generating helper structs which have bivariant lifetimes due to containing the offending struct (that's being derived on).
2024-10-16 12:03:43 +02:00
Urgau
66dc09f3da
Rollup merge of #131746 - slanterns:once_box_order, r=joboet
Relax a memory order in `once_box`

per https://github.com/rust-lang/rust/pull/131094#discussion_r1788536445.

In the successful path we don't need `Acquire` since we don't care if the store in `f()` happened in other threads has become visible to the current thread. We'll use our own results instead and just using `Release` to ensure other threads can see our store to `Box` when they fail the `compare_exchange` will suffice.

Also took https://marabos.nl/atomics/memory-ordering.html#example-lazy-initialization-with-indirection as a reference.

`@rustbot` label: +T-libs

r? `@ibraheemdev`
2024-10-16 12:03:42 +02:00