Commit Graph

258083 Commits

Author SHA1 Message Date
bors
9889a6f5d3 Auto merge of #126657 - weihanglo:update-cargo, r=weihanglo
Update cargo

13 commits in a1f47ec3f7cd076986f1bfcd7061f2e8cb1a726e..3ed207e416fb2f678a40cc79c02dcf4f936a21ce
2024-06-15 01:10:07 +0000 to 2024-06-18 19:18:22 +0000
- test: prefer raw string for regex reduction (rust-lang/cargo#14099)
- test: migrate tree and tree_graph_features to snapbox (rust-lang/cargo#14094)
- test: Migrate some files to snapbox (rust-lang/cargo#14069)
- remove some legacy public dependency code from the resolver (rust-lang/cargo#14090)
- fix(fix): Address problems with implicit -> explicit feature migration (rust-lang/cargo#14018)
- refactor: 1.79 cleanup (rust-lang/cargo#14088)
- test: migrate `git_(gc|shallow)` to snapbox (rust-lang/cargo#14087)
- test: migrate timings_works to snapbox (rust-lang/cargo#14082)
- test: migrate minimal_versions to snapbox (rust-lang/cargo#14080)
- Remove `run_expect_error` to avoid tests incorrectly passing (rust-lang/cargo#14078)
- test: migrate help to snapbox (rust-lang/cargo#14060)
- test: Migrate tests/testsuite/co*.rs to snapbox (rust-lang/cargo#14079)
- Use `std::fs::absolute` instead of reimplementing it (rust-lang/cargo#14075)

<!--
r? ghost
-->
2024-06-19 04:03:14 +00:00
Weihang Lo
087add3cb2
Update cargo 2024-06-18 22:04:58 -04:00
bors
a1ca449981 Auto merge of #126655 - jieyouxu:rollup-z7k1k6l, r=jieyouxu
Rollup of 10 pull requests

Successful merges:

 - #124135 (delegation: Implement glob delegation)
 - #125078 (fix: break inside async closure has incorrect span for enclosing closure)
 - #125293 (Place tail expression behind terminating scope)
 - #126422 (Suggest using a standalone doctest for non-local impl defs)
 - #126493 (safe transmute: support non-ZST, variantful, uninhabited enums)
 - #126504 (Sync fuchsia test runner with clang test runner)
 - #126558 (hir_typeck: be more conservative in making "note caller chooses ty param" note)
 - #126586 (Add `@badboy` and `@BlackHoleFox` as Mac Catalyst maintainers)
 - #126615 (Add `rustc-ice*` to `.gitignore`)
 - #126632 (Replace `move||` with `move ||`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-19 01:49:20 +00:00
León Orell Valerian Liehr
2126c1d446
rustc_type_ir: Omit some struct fields from Debug output 2024-06-19 03:08:34 +02:00
许杰友 Jieyou Xu (Joe)
7450ab7acb
Rollup merge of #126632 - Vonr:fix/moving-closure-formatting-v2, r=Nilstrieb
Replace `move||` with `move ||`

Edit from #126631 to revert changes in `tests/ui`.

There are 18 instances of `move||` across 6 files in the repo:
- `compiler/rustc_hir_typeck/src/typeck_root_ctxt.rs`
- `library/core/src/sync/atomic.rs`
- `library/std/src/sync/condvar.rs`
- `library/std/src/sync/mpsc/mod.rs`
- `library/std/src/sync/barrier.rs`
- `library/std/src/thread/local.rs`

I have replaced all such instances with `move ||` instead as it better adheres to modern formatting standards.

Ideally, we would have this automated by rustfmt or some other tool, but I do not have the time to implement such a feature or tool.
Nonetheless, I would encourage any effort invested into such a tool or feature.
2024-06-19 01:51:42 +01:00
许杰友 Jieyou Xu (Joe)
a2436a83d3
Rollup merge of #126615 - tgross35:gitignore-ice, r=compiler-errors
Add `rustc-ice*` to `.gitignore`

I am a bit surprised this wasn't already here but there doesn't seem to be any reason not to add it. This will be nice to cut down on `git {add, diff, etc}` noise when debugging crashes.
2024-06-19 01:51:42 +01:00
许杰友 Jieyou Xu (Joe)
87ca0731c3
Rollup merge of #126586 - madsmtm:mac-catalyst-maintainers, r=Nilstrieb
Add @badboy and @BlackHoleFox as Mac Catalyst maintainers

Assented in https://github.com/rust-lang/compiler-team/issues/761#issuecomment-2173071316 and https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Promote.20Mac.20Catalyst.20targets.20to.20Tier.202.20compiler-team.23761/near/444590303.
2024-06-19 01:51:41 +01:00
许杰友 Jieyou Xu (Joe)
bf841c4773
Rollup merge of #126558 - jieyouxu:caller-chooses-ty, r=fmease
hir_typeck: be more conservative in making "note caller chooses ty param" note

In https://github.com/rust-lang/rust/pull/122195 I added a "caller chooses ty for type param" note for when the return expression type a.k.a. found type does not match the expected return type.

#126547 found that this note was confusing when the found return type *contains* the expected type, e.g.

```rs
fn f<T>(t: &T) -> T {
    t
}
```

because the found return type `&T` will *always* be different from the expected return type `T`, so the note was needlessly redundant and confusing.

This PR addresses that by not making the note if the found return type contains the expected return type.

r? ``@fmease`` (since you reviewed the original PR)

Fixes https://github.com/rust-lang/rust/issues/126547
2024-06-19 01:51:41 +01:00
许杰友 Jieyou Xu (Joe)
3c61378c5a
Rollup merge of #126504 - erickt:bump-fuchsia, r=tmandry
Sync fuchsia test runner with clang test runner

This synchronizes the fuchsia test running code with the clang test runner. This brings with it:

* Improved logging
* Uses the fuchsia image from the SDK version
* Caches the product bundle across test runs
* Strips the binaries to reduce the data sent to the emulator

r? ``@tmandry``
2024-06-19 01:51:40 +01:00
许杰友 Jieyou Xu (Joe)
0e46111660
Rollup merge of #126493 - jswrenn:fix-126460, r=compiler-errors
safe transmute: support non-ZST, variantful, uninhabited enums

Previously, `Tree::from_enum`'s implementation branched into three disjoint cases:

 1. enums that uninhabited
 2. enums for which all but one variant is uninhabited
 3. enums with multiple variants

This branching (incorrectly) did not differentiate between variantful and variantless uninhabited enums. In both cases, we assumed (and asserted) that uninhabited enums are zero-sized types. This assumption is false for enums like:

    enum Uninhabited { A(!, u128) }

...which, currently, has the same size as `u128`. This faulty assumption manifested as the ICE reported in #126460.

In this PR, we revise the first case of `Tree::from_enum` to consider only the narrow category of "enums that are uninhabited ZSTs". These enums, whose layouts are described with `Variants::Single { index }`, are special in their layouts otherwise resemble the `!` type and cannot be descended into like typical enums. This first case captures uninhabited enums like:

    enum Uninhabited { A(!, !), B(!) }

The second case is revised to consider the broader category of "enums that defer their layout to one of their variants"; i.e., enums whose layouts are described with `Variants::Single { index }` and that do have a variant at `index`. This second case captures uninhabited enums that are not ZSTs, like:

    enum Uninhabited { A(!, u128) }

...which represent their variants with `Variants::Single`.

Finally, the third case is revised to cover the broader category of "enums with multiple variants", which captures uninhabited enums like:

    enum Uninhabited { A(u8, !), B(!, u32) }

...which represent their variants with `Variants::Multiple`.

This PR also adds a comment requested by ````@RalfJung```` in his review of #126358 to `compiler/rustc_const_eval/src/interpret/discriminant.rs`.

Fixes #126460

r? ````@compiler-errors````
2024-06-19 01:51:39 +01:00
许杰友 Jieyou Xu (Joe)
081cc5cc2d
Rollup merge of #126422 - Urgau:doctest-impl-non-local-def, r=fmease
Suggest using a standalone doctest for non-local impl defs

This PR tweaks the lint output of the `non_local_definitions` lint to suggest using a standalone doctest instead of a moving the `impl` def to an impossible place as was already done with `macro_rules!` case in https://github.com/rust-lang/rust/pull/124568.

Fixes #126339
r? ```@fmease```
2024-06-19 01:51:39 +01:00
许杰友 Jieyou Xu (Joe)
8eb2e5f4c8
Rollup merge of #125293 - dingxiangfei2009:tail-expr-temp-lifetime, r=estebank,davidtwco
Place tail expression behind terminating scope

This PR implements #123739 so that we can do further experiments in nightly.

A little rewrite has been applied to `for await` lowering. It was previously `unsafe { Pin::unchecked_new(into_async_iter(..)) }`. Under the edition 2024 rule, however, `into_async_iter` gets dropped at the end of the `unsafe` block. This presumably the first Edition 2024 migration rule goes by hoisting `into_async_iter(..)` into `match` one level above, so it now looks like the following.
```rust
match into_async_iter($iter_expr) {
  ref mut iter => match unsafe { Pin::unchecked_new(iter) } {
    ...
  }
}
```
2024-06-19 01:51:38 +01:00
许杰友 Jieyou Xu (Joe)
c9a9d5cee7
Rollup merge of #125078 - linyihai:issue-124496, r=compiler-errors
fix: break inside async closure has incorrect span for enclosing closure

Fixes #124496
2024-06-19 01:51:38 +01:00
许杰友 Jieyou Xu (Joe)
f8ce1cfbf5
Rollup merge of #124135 - petrochenkov:deleglob, r=fmease
delegation: Implement glob delegation

Support delegating to all trait methods in one go.
Overriding globs with explicit definitions is also supported.

The implementation is generally based on the design from https://github.com/rust-lang/rfcs/pull/3530#issuecomment-2020869823, but unlike with list delegation in https://github.com/rust-lang/rust/pull/123413 we cannot expand glob delegation eagerly.
We have to enqueue it into the queue of unexpanded macros (most other macros are processed this way too), and then a glob delegation waits in that queue until its trait path is resolved, and enough code expands to generate the identifier list produced from the glob.

Glob delegation is only allowed in impls, and can only point to traits.
Supporting it in other places gives very little practical benefit, but significantly raises the implementation complexity.

Part of https://github.com/rust-lang/rust/issues/118212.
2024-06-19 01:51:36 +01:00
Trevor Gross
1299aef921 Make pretty printing for f16 and f128 consistent
Currently the docs show e.g.

    {transmute(0xfffeffffffffffffffffffffffffffff): f128}

for f128 constants. This should fix that to instead use apfloat for
printing, as is done for `f32` and `f64`.
2024-06-18 19:40:37 -05:00
bors
4e63822fc4 Auto merge of #126607 - Oneirical:the-testern-world, r=jieyouxu
Rewrite `separate-link`, `separate-link-fail` and `allocator-shim-circular-deps` `run-make` tests to `ui` or `rmake`

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
2024-06-18 23:38:09 +00:00
Michael Goulet
9b0f9ef42e Make rustc_next_trait_solver nightly again 2024-06-18 18:52:48 -04:00
Michael Goulet
c20d909701 Make rustc_type_ir nightly again 2024-06-18 18:51:26 -04:00
ardi
9f6371236f make this comment correct 2024-06-19 00:27:41 +02:00
ardi
d51b4462ec Improve conflict marker recovery 2024-06-19 00:27:41 +02:00
Guillaume Gomez
1ba5c9808c Migrate run-make/rustdoc-io-error to rmake.rs 2024-06-18 23:28:55 +02:00
许杰友 Jieyou Xu (Joe)
939026c8fb tests: update tests for more conservative return ty mismatch note 2024-06-18 21:06:53 +00:00
许杰友 Jieyou Xu (Joe)
bfe6a26af6 hir_typeck: be more conservative in making "note caller chooses ty param" note
- Avoid "caller chooses ty for type param" note if the found type a.k.a.
  the return expression type *contains* the type parameter, because e.g.
  `&T` will always be different from `T` (i.e. "well duh").
- Rename `note_caller_chooses_ty_for_ty_param` to
  `try_note_caller_chooses_ty_for_ty_param` because the note is not
  always made.

Issue: https://github.com/rust-lang/rust/issues/126547
2024-06-18 21:05:59 +00:00
Oneirical
d1e8c6bc7e rewrite extern-overrides-distribution to rmake 2024-06-18 16:30:26 -04:00
Oneirical
dff354e57f rewrite metadata-flag-frobs-symbols to rmake 2024-06-18 16:20:32 -04:00
Oneirical
9e2ace85f9 rewrite debugger-visualizer-dep-info to rmake 2024-06-18 16:05:56 -04:00
Oneirical
060a13e9fd rewrite extern-flag-rename-transitive to rmake 2024-06-18 15:59:33 -04:00
bors
8fcd4dd08e Auto merge of #126614 - compiler-errors:uplift-next-trait-solver, r=lcnr
Uplift next trait solver to `rustc_next_trait_solver`

🎉

There's so many FIXMEs! Sorry! Ideally this merges with the FIXMEs and we track and squash them over the near future.

Also, this still doesn't build on anything other than rustc. I still need to fix `feature = "nightly"` in `rustc_type_ir`, and remove and fix all the nightly feature usage in the new trait solver (notably: let-chains).

Also, sorry `@lcnr` I know you asked for me to separate the commit where we `mv rustc_trait_selection/solve/... rustc_next_trait_solver/solve/...`, but I had already done all the work by that point. Luckily, `git` understands the file moves so it should still be relatively reviewable.

If this is still very difficult to review, then I can do some rebasing magic to try to separate this out. Please let me know!

r? lcnr
2024-06-18 19:41:33 +00:00
Guillaume Gomez
62431b73e0 Migrate run-make/compressed-debuginfo to rmake.rs 2024-06-18 21:32:24 +02:00
Oneirical
977d3f6f96 use llvm_readobj in run-make test instead of nm 2024-06-18 14:57:00 -04:00
Oneirical
c1597f9039 try implementing suggestions 2024-06-18 14:43:35 -04:00
Oneirical
83cb760e2c run_make_support nm implementation + bin-emit-no-symbols rmake rewrite 2024-06-18 14:38:33 -04:00
Oneirical
78998f3fea rewrite allocator-shim-circular-deps to ui test 2024-06-18 14:25:59 -04:00
Oneirical
03a4259c8b Rewrite lto-readonly-lib to rmake 2024-06-18 12:55:44 -04:00
Oneirical
594135ea37 Rewrite ls-metadata to rmake 2024-06-18 12:54:55 -04:00
Oneirical
fa2b612213 Rewrite link-args-order to rmake 2024-06-18 12:54:53 -04:00
bors
dd104ef163 Auto merge of #126623 - oli-obk:do_not_count_errors, r=davidtwco
Replace all `&DiagCtxt` with a `DiagCtxtHandle<'_>` wrapper type

r? `@davidtwco`

This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle

Basically I will add a field to the `DiagCtxtHandle` that refers back to the `InferCtxt`'s (and others) `Option<ErrorHandled>`, allowing us to immediately taint these contexts when emitting an error and not needing manual tainting anymore (which is easy to forget and we don't do in general anyway)
2024-06-18 16:49:19 +00:00
Oli Scherer
a183989e88 Only check locally for reported errors 2024-06-18 15:43:27 +00:00
Oli Scherer
3f34196839 Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
Oli Scherer
7ba82d61eb Use a dedicated type instead of a reference for the diagnostic context
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-18 15:42:11 +00:00
Oli Scherer
de473a5a2b Test that opaque types can't have themselves as a hidden type with incompatible lifetimes 2024-06-18 15:41:27 +00:00
Vonr
7321e79114
Replace move|| with move || in compiler/ and library/
Edit from #126631 to revert changes on ui tests
2024-06-18 23:25:08 +08:00
Michael Goulet
6609501ca7 Fix transmute goal 2024-06-18 11:04:01 -04:00
Michael Goulet
fb6f4b4a6e Explicitly import tracing macros 2024-06-18 11:04:01 -04:00
Michael Goulet
7d2be888b6 Fix impl for SolverDelegate 2024-06-18 11:04:01 -04:00
Michael Goulet
532149eb88 Uplift the new trait solver 2024-06-18 10:55:34 -04:00
Michael Goulet
baf94bddf0 SolverDelegate 2024-06-18 10:40:30 -04:00
Michael Goulet
e7d2d95e5a Uplift PredefinedOpaquesData 2024-06-18 10:40:30 -04:00
Michael Goulet
dba4147633 Make SearchGraph fully generic 2024-06-18 10:40:30 -04:00
bors
8814b926f4 Auto merge of #126630 - GuillaumeGomez:rollup-hlwbpa2, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - #125988 (Migrate `run-make/used` to `rmake.rs`)
 - #126500 (Migrate `error-found-staticlib-instead-crate`, `output-filename-conflicts-with-directory`, `output-filename-overwrites-input`, `native-link-modifier-verbatim-rustc` and `native-link-verbatim-linker` `run-make` tests to `rmake.rs` format)
 - #126583 (interpret: better error when we ran out of memory)
 - #126587 (coverage: Add debugging flag `-Zcoverage-options=no-mir-spans`)
 - #126621 (More thorough status-quo tests for `#[coverage(..)]`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-18 14:20:38 +00:00