Commit graph

17747 commits

Author SHA1 Message Date
bors
a7c39b6861 Auto merge of #139114 - m-ou-se:super-let-pin, r=davidtwco
Implement `pin!()` using `super let`

Tracking issue for super let: https://github.com/rust-lang/rust/issues/139076

This uses `super let` to implement `pin!()`.

This means we can remove [the hack](https://github.com/rust-lang/rust/pull/138717) we had to put in to fix https://github.com/rust-lang/rust/issues/138596.

It also means we can remove the original hack to make `pin!()` work, which used a questionable public-but-unstable field rather than a proper private field.

While `super let` is still unstable and subject to change, it seems safe to assume that future Rust will always have a way to express `pin!()` in a compatible way, considering `pin!()` is already stable.

It'd help [the experiment](https://github.com/rust-lang/rust/issues/139076) to have `pin!()` use `super let`, so we can get some more experience with it.
2025-04-19 08:01:53 +00:00
bors
191df20fca Auto merge of #139996 - matthiaskrgr:rollup-0nka2hw, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #138528 (deref patterns: implement implicit deref patterns)
 - #139393 (rustdoc-json: Output target feature information)
 - #139553 (sync::mpsc: prevent double free on `Drop`)
 - #139615 (Remove `name_or_empty`)
 - #139853 (Disable combining LLD with external llvm-config)
 - #139913 (rustdoc/clean: Fix lowering of fn params (fixes correctness & HIR vs. middle parity regressions))
 - #139942 (Ignore aix for tests/ui/erros/pic-linker.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-18 13:49:17 +00:00
Matthias Krüger
1b03b826c4
Rollup merge of #139989 - durin42:llvm-21-issue-101082, r=cuviper
tests: adjust 101082 test for LLVM 21 fix

Fixes #139987.
2025-04-18 05:17:54 +02:00
Matthias Krüger
095486e125
Rollup merge of #139976 - jieyouxu:plumbing, r=Kobzol
run-make: drop `os_pipe` workaround now that `anonymous_pipe` is stable on beta

Follow-up to #137537 where I had to include a temporary dep on `os_pipe` before `anonymous_pipe` was stabilized. Now that `anonymous_pipe` is stable on beta, we can get rid of this workaround.

Closes #137532. (Final cleanup item)

r? `@Kobzol`
2025-04-18 05:17:54 +02:00
Matthias Krüger
68b439c63b
Rollup merge of #138599 - adwinwhite:recursive-overflow, r=wesleywiser
avoid overflow when generating debuginfo for expanding recursive types

Fixes #135093
Fixes #121538
Fixes #107362
Fixes #100618
Fixes #115994

The overflow happens because expanding recursive types keep creating new nested types when recurring into sub fields.
I fixed that by returning an empty stub node when expanding recursion is detected.
2025-04-18 05:17:53 +02:00
Matthias Krüger
8cb57ed74b
Rollup merge of #139942 - dalvescb:master, r=jieyouxu
Ignore aix for tests/ui/erros/pic-linker.rs

This test case fails on AIX because of how the linker arguments are passed. Furthermore on AIX `-z text` only works in dynamic mode, making this test case irrelevant.
2025-04-18 05:16:31 +02:00
Matthias Krüger
cbf26629c4
Rollup merge of #139913 - fmease:rustdoc-fix-fn-param-handling, r=GuillaumeGomez
rustdoc/clean: Fix lowering of fn params (fixes correctness & HIR vs. middle parity regressions)

**(0)** PR #136411 aimed to stop rendering unnamed params of fn ptr types as underscores in the common case (e.g., `fn(_: i32)` → `fn(i32)`) to make the rendered output stylistically more conventional.

**(0.a)** However, since the cleaning fn that the PR modified is also used for lowering the HIR params of foreign fns and required assoc fns in traits, it accidentally butchered the rendering of the latter two:

```rs
pub trait Trait { fn assoc_fn(_: i32); } // as well as (Rust 2015 only): fn assoc_fn(i32);
unsafe extern "C" { pub fn foreign_fn(_: i32); }

// Since 1.86 the fns above gets mis-rendered as:
pub fn assoc_fn(: i32) // <-- BUTCHERED
pub unsafe extern "C" fn foreign_fn(: i32) // <-- BUTCHERED
```

**(0.b)** Furthermore, it broke parity with middle cleaning (which includes inlined cross-crate re-exports) re-regressing parts of #44306 I once fixed in PR #103885.

**(1)** Lastly, PR #139035 introduced an ICE triggered by the following input file:

```rs
trait Trait { fn anon(()) {} } // internal error: entered unreachable code
```

---

This PR fixes all of these regressions and in the first commit renames several types and fns to be more ~~correct~~ descriptive and legible.

~~It also refactors `Param.name` to be of type `Option<Symbol>` instead `Symbol` (where `None` ~ `kw::Empty`), so rendering mistakes like that can no longer creep in like that (ignoring tests). CC #137978.~~ Independently done in PR #139846 a day prior.
2025-04-18 05:16:31 +02:00
Matthias Krüger
540fb228af
Rollup merge of #139615 - nnethercote:rm-name_or_empty, r=jdonszelmann
Remove `name_or_empty`

Another step towards #137978.

r? ``@jdonszelmann``
2025-04-18 05:16:29 +02:00
Matthias Krüger
e15cf92b67
Rollup merge of #139393 - willglynn:rustdoc_output_target_feature_information, r=aDotInTheVoid
rustdoc-json: Output target feature information

`#[target_feature]` attributes refer to a target-specific list of features. Enabling certain features can imply enabling other features. Certain features are always enabled on certain targets, since they are required by the target's ABI. Features can also be enabled indirectly based on other compiler flags.

Feature information is ultimately known to `rustc`. Rather than force external tools to track it – which may be wildly impractical due to `-C target-cpu` – have `rustdoc` output `rustc`'s feature data.

This change is motivated by https://github.com/obi1kenobi/cargo-semver-checks/issues/1246, which intends to detect semver hazards caused by `#[target_feature]`.

try-job: aarch64-gnu
try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: aarch64-apple
2025-04-18 05:16:28 +02:00
Matthias Krüger
c8a9095f0f
Rollup merge of #138528 - dianne:implicit-deref-patterns, r=Nadrieril
deref patterns: implement implicit deref patterns

This implements implicit deref patterns (per https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Implicit-deref-patterns) and adds tests and an unstable book chapter.

Best reviewed commit-by-commit. Overall there's a lot of additions, but a lot of that is tests, documentation, and simple(?) refactoring.

Tracking issue: #87121

r? ``@Nadrieril``
2025-04-18 05:16:28 +02:00
Matthias Krüger
18f6c595ee
Rollup merge of #139971 - LukasWoodtli:gardena/lw/fix-cstring-merging-test, r=wesleywiser
Make C string merging test work on MIPS

Assembly for MIPS uses, by convention, a different prefix for local anonymous variables.
2025-04-17 21:53:26 +02:00
Matthias Krüger
026d56b0f6
Rollup merge of #139967 - jieyouxu:auxiliary, r=wesleywiser
Introduce and use specialized `//@ ignore-auxiliary` for test support files instead of using `//@ ignore-test`

### Summary

Add a semantically meaningful directive for ignoring test *auxiliary* files. This is for auxiliary files that *participate* in actual tests but should not be built by `compiletest` (i.e. these files are involved through `mod xxx;` or `include!()` or `#[path = "xxx"]`, etc.).

### Motivation

A specialized directive like `//@ ignore-auxiliary` makes it way easier to audit disabled tests via `//@ ignore-test`.
  - These support files cannot use the canonical `auxiliary/` dir because they participate in module resolution or are included, or their relative paths can be important for test intention otherwise.

Follow-up to:
- #139705
- #139783
- #139740

See also discussions in:

- [#t-compiler > Directive name for non-test aux files?](512773817)
- [#t-compiler > Handling disabled &#96;//@ ignore-test&#96; tests](512005974)
- [#t-compiler/meetings > &#91;steering&#93; 2025-04-11 Dealing with disabled tests](511717981)

### Remarks on remaining unconditionally disabled tests under `tests/`

After this PR, against commit 79a272c640, only **14** remaining test files are disabled through `//@ ignore-test`:

<details>
<summary>Remaining `//@ ignore-test` files under `tests/`</summary>

```
tests/debuginfo/drop-locations.rs
4://@ ignore-test (broken, see #128971)

tests/rustdoc/macro-document-private-duplicate.rs
1://@ ignore-test (fails spuriously, see issue #89228)

tests/rustdoc/inline_cross/assoc-const-equality.rs
3://@ ignore-test (FIXME: #125092)

tests/ui/match/issue-27021.rs
7://@ ignore-test (#54987)

tests/ui/match/issue-26996.rs
7://@ ignore-test (#54987)

tests/ui/issues/issue-49298.rs
9://@ ignore-test (#54987)

tests/ui/issues/issue-59756.rs
2://@ ignore-test (rustfix needs multiple suggestions)

tests/ui/precondition-checks/write.rs
5://@ ignore-test (unimplemented)

tests/ui/precondition-checks/read.rs
5://@ ignore-test (unimplemented)

tests/ui/precondition-checks/write_bytes.rs
5://@ ignore-test (unimplemented)

tests/ui/explicit-tail-calls/drop-order.rs
2://@ ignore-test: tail calls are not implemented in rustc_codegen_ssa yet, so this causes 🧊

tests/ui/panics/panic-short-backtrace-windows-x86_64.rs
3://@ ignore-test (#92000)

tests/ui/json/json-bom-plus-crlf-multifile-aux.rs
3://@ ignore-test Not a test. Used by other tests

tests/ui/traits/next-solver/object-soundness-requires-generalization.rs
2://@ ignore-test (see #114196)
```
</details>

Of these, most are either **unimplemented**, or **spurious**, or **known-broken**. The outstanding one is `tests/ui/json/json-bom-plus-crlf-multifile-aux.rs` which I did not want to touch in *this* PR -- that aux file has load-bearing BOM and carriage returns and byte offset matters. I think those test files that require special encoding / BOM probably are better off as `run-make` tests. See #139968 for that aux file.

### Review advice

- Best reviewed commit-by-commit.
- The directive name diverged from the most voted `//@ auxiliary` because I think that's easy to confuse with `//@ aux-{crate,dir}`.

r? compiler
2025-04-17 21:53:25 +02:00
Matthias Krüger
8b7a2897c8
Rollup merge of #139498 - alexcrichton:wasm-zst-safe, r=wesleywiser
Ignore zero-sized types in wasm future-compat warning

This commit fixes a false positive of the warning triggered for #138762 and the fix is to codify that zero-sized types are "safe" in both the old and new ABIs.
2025-04-17 21:53:24 +02:00
Matthias Krüger
87a163523f
Rollup merge of #139351 - EnzymeAD:autodiff-batching2, r=oli-obk
Autodiff batching2

~I will rebase it once my first PR landed.~ done.
This autodiff batch mode is more similar to scalar autodiff, since it still only takes one shadow argument.
However, that argument is supposed to be `width` times larger.

r? `@oli-obk`

Tracking:

- https://github.com/rust-lang/rust/issues/124509
2025-04-17 21:53:23 +02:00
Augie Fackler
d3b167493e tests: adjust 101082 test for LLVM 21 fix
Fixes #139987.
2025-04-17 15:11:21 -04:00
Matthias Krüger
7a4525c883
Rollup merge of #139943 - fmease:rustdoc-ixcre-trait-aliases, r=GuillaumeGomez
rustdoc: Support inlined cross-crate re-exported trait aliases

Previously we'd just drop them. As a result of this PR, [`core::ptr::Thin`](https://doc.rust-lang.org/nightly/core/ptr/traitalias.Thin.html) will be admitted into the `std` façade!

Also, render the where clause *after* the bounds / the `=`, not before them, as it should be.

r? rustdoc
2025-04-17 17:40:30 +02:00
Matthias Krüger
67e2358fbb
Rollup merge of #139902 - lcnr:no-opaque-cast-projection, r=oli-obk
do not emit `OpaqueCast` projections with `-Znext-solver`

We normalize opaque types in their defining scope if the new solver is enabled. This means projections do not contain any 'revealable' opaque types we need to worry about. We either have a type which has been normalized by writeback or we need to normalize it anyways.

r? ```@compiler-errors``` ```@oli-obk```
2025-04-17 17:40:28 +02:00
Matthias Krüger
d2db1c1df9
Rollup merge of #139850 - xizheyin:issue-138698, r=jieyouxu
Hide unstable print kinds within emit_unknown_print_request_help in stable channel

Fixes #138698

We need to get the channel from `matches`. However, since `matches`(Line 1169) is constructed after `rustc_optgroups` (Line1165, where `RustcOptGroup::value_hint` is generated, i.e. what `rustc --print print` prints), I've left it unchanged here for now.

2da29dbe8f/compiler/rustc_driver_impl/src/lib.rs (L1161-L1169)

There is actually a way to manually parse the `--crate-name` parameter, but I'm afraid that's an unorthodox practice. So I conservatively just modified `emit_unknown_print_request_help` to print different parameters depending on whether they are nightly or not when passing the error parameter.

r? ```@jieyouxu```
2025-04-17 17:40:27 +02:00
Matthias Krüger
da43826398
Rollup merge of #139774 - compiler-errors:supertrait-alias, r=lcnr
Fix replacing supertrait aliases in `ReplaceProjectionWith`

The new solver has a procedure called `predicates_for_object_candidate`, which elaborates the super-bounds and item-bounds that are required to hold for a dyn trait to implement something via a built-in object impl.

In that procedure, there is a folder called `ReplaceProjectionWith` which is responsible for replacing projections that reference `Self`, so that we don't encounter cycles when we then go on to normalize those projections in the process of proving these super-bounds.

That folder had a few problems: Firstly, it wasn't actually checking that this was a super bound originating from `Self`. Secondly, it only accounted for a *single* projection type def id, but trait objects can have multiple (i.e. `trait Foo<A, B>: Bar<A, Assoc = A> + Bar<B, Assoc = B>`).

To fix the first, it's simple enough to just add an equality check for the self ty. To fix the second, I implemented a matching step that's very similar to the `projection_may_match` check we have for upcasting, since on top of having multiple choices, we need to deal with both non-structural matches and ambiguity.

This probably lacks a bit of documentation, but I think it works pretty well.

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/171

r? lcnr
2025-04-17 17:40:27 +02:00
Jieyou Xu
83af9f57c1
run-make: drop os_pipe workaround now that anonymous_pipe is stable on beta 2025-04-17 23:23:30 +08:00
Alex Crichton
f9091e24a0 Ignore zero-sized types in wasm future-compat warning
This commit fixes a false positive of the warning triggered for #138762
and the fix is to codify that zero-sized types are "safe" in both the
old and new ABIs.
2025-04-17 07:42:55 -07:00
Lukas Woodtli
7a5a884275 Make C string merging test work on MIPS
Assembly for MIPS uses, by convention, a different prefix for local
anonymous variables.
2025-04-17 16:08:22 +02:00
xizheyin
8562110e0d Hide unstable print kinds within emit_unknown_print_request_help in stable channel
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-17 22:02:31 +08:00
Jieyou Xu
6c5a481f93
tests: remove unused auxiliaries under tests/ui/directory_ownership/ 2025-04-17 19:45:28 +08:00
Jieyou Xu
89cac55bb8
tests: use //@ ignore-auxiliary with backlinked primary test file 2025-04-17 19:45:28 +08:00
bors
883f9f72e8 Auto merge of #139949 - matthiaskrgr:rollup-pxc5tsx, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #138632 (Stabilize `cfg_boolean_literals`)
 - #139416 (unstable book; document `macro_metavar_expr_concat`)
 - #139782 (Consistent with treating Ctor Call as Struct in liveness analysis)
 - #139885 (document RUSTC_BOOTSTRAP, RUSTC_OVERRIDE_VERSION_STRING, and -Z allow-features in the unstable book)
 - #139904 (Explicitly annotate edition for `unpretty=expanded` and `unpretty=hir` tests)
 - #139932 (transmutability: Refactor tests for simplicity)
 - #139944 (Move eager translation to a method on Diag)
 - #139948 (git: ignore `60600a6fa4` for blame purposes)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-17 11:21:54 +00:00
Jieyou Xu
d1178faa93
tests: refine disable reason for tests/debuginfo/drop-locations.rs 2025-04-17 18:52:57 +08:00
lcnr
c85b5fcd07 check OpaqueCast tests with next-solver 2025-04-17 12:41:20 +02:00
León Orell Valerian Liehr
82ff0a0e6a
rustdoc: Properly clean fn params in all contexts 2025-04-17 08:55:53 +02:00
bors
15c4ccef03 Auto merge of #139940 - matthiaskrgr:rollup-rd4d3fn, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #135340 (Add `explicit_extern_abis` Feature and Enforce Explicit ABIs)
 - #139440 (rustc_target: RISC-V: feature addition batch 2)
 - #139667 (cfi: Remove #[no_sanitize(cfi)] for extern weak functions)
 - #139828 (Don't require rigid alias's trait to hold)
 - #139854 (Improve parse errors for stray lifetimes in type position)
 - #139889 (Clean UI tests 3 of n)
 - #139894 (Fix `opt-dist` CLI flag and make it work without LLD)
 - #139900 (stepping into impls for normalization is unproductive)
 - #139915 (replace some #[rustc_intrinsic] usage with use of the libcore declarations)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-17 04:52:34 +00:00
Matthias Krüger
059b7d07ef
Rollup merge of #139944 - shepmaster:eager-diagnostics, r=nnethercote
Move eager translation to a method on Diag

This will allow us to eagerly translate messages on a top-level diagnostic, such as a `LintDiagnostic`. As a bonus, we can remove the awkward closure passed into Subdiagnostic and make better use of `Into`.

r? `@nnethercote`
2025-04-17 06:25:18 +02:00
Matthias Krüger
4a83f43e63
Rollup merge of #139904 - ferrocene:lw-wkumpwrytvtp, r=nnethercote,jieyouxu
Explicitly annotate edition for `unpretty=expanded` and `unpretty=hir` tests

These emit prelude imports which means they are always edition dependent and so running them with a different `--edition` will fail.
2025-04-17 06:25:17 +02:00
Matthias Krüger
0757d24f71
Rollup merge of #139782 - xizheyin:issue-139627, r=wesleywiser
Consistent with treating Ctor Call as Struct in liveness analysis

Fixes #139627

When `ExprKind::Call` is a `Ctor`, skips the checking of `expr` and only checks the arguments, thus being consistent with `ExprKind::Struct`.

r? compiler
2025-04-17 06:25:16 +02:00
Matthias Krüger
0de803c38d
Rollup merge of #138632 - clubby789:stabilize-cfg-boolean-lit, r=davidtwco,Urgau,traviscross
Stabilize `cfg_boolean_literals`

Closes #131204
`@rustbot` labels +T-lang +I-lang-nominated
This will end up conflicting with the test in #138293 so whichever doesn't land first will need updating

--

# Stabilization Report

## General design

### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized?

[RFC 3695](https://github.com/rust-lang/rfcs/pull/3695), none.

### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con.

None

### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those?

None

## Has a call-for-testing period been conducted? If so, what feedback was received?

Yes; only positive feedback was received.

## Implementation quality

### Summarize the major parts of the implementation and provide links into the code (or to PRs)

Implemented in [#131034](https://github.com/rust-lang/rust/pull/131034).

### Summarize existing test coverage of this feature

- [Basic usage, including `#[cfg()]`, `cfg!()` and `#[cfg_attr()]`](6d71251cf9/tests/ui/cfg/true-false.rs)
- [`--cfg=true/false` on the command line being accessible via `r#true/r#false`](6d71251cf9/tests/ui/cfg/raw-true-false.rs)
- [Interaction with the unstable `#[doc(cfg(..))]` feature](6d71251/tests/rustdoc-ui/cfg-boolean-literal.rs)
- [Denying `--check-cfg=cfg(true/false)`](6d71251/tests/ui/check-cfg/invalid-arguments.rs)
- Ensuring `--cfg false` on the command line doesn't change the meaning of `cfg(false)`: `tests/ui/cfg/cmdline-false.rs`
- Ensuring both `cfg(true)` and `cfg(false)` on the same item result in it being disabled: `tests/ui/cfg/both-true-false.rs`

### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking?

The above mentioned issue; it should not block as it interacts with another unstable feature.

### What FIXMEs are still in the code for that feature and why is it ok to leave them there?

None

### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization
- `@clubby789` (RFC)
- `@Urgau` (Implementation in rustc)

### Which tools need to be adjusted to support this feature. Has this work been done?

`rustdoc`'s  unstable`#[doc(cfg(..)]` has been updated to respect it. `cargo` has been updated with a forward compatibility lint to enable supporting it in cargo once stabilized.

## Type system and execution rules

### What updates are needed to the reference/specification? (link to PRs when they exist)

A few lines to be added to the reference for configuration predicates, specified in the RFC.
2025-04-17 06:25:15 +02:00
Jake Goulding
0117884917 Move eager translation to a method on Diag
This will allow us to eagerly translate messages on a top-level
diagnostic, such as a `LintDiagnostic`. As a bonus, we can remove the
awkward closure passed into Subdiagnostic and make better use of
`Into`.
2025-04-16 21:38:59 -04:00
bors
79a272c640 Auto merge of #139938 - matthiaskrgr:rollup-19ddpus, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #139084 (hygiene: Rename semi-transparent to semi-opaque)
 - #139236 (Use a session counter to make anon dep nodes unique)
 - #139650 (Fix `register_group_alias` for tools)
 - #139770 (Rename `LifetimeName` as `LifetimeKind`.)
 - #139846 (Remove `kw::Empty` uses in rustdoc)
 - #139891 (Include optional dso_local marker for functions in `enum-match.rs`)
 - #139908 (parser: Remove old diagnostic notes for type ascription syntax)
 - #139917 (fix for multiple `#[repr(align(N))]` on functions)

Failed merges:

 - #139615 (Remove `name_or_empty`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-17 01:38:17 +00:00
León Orell Valerian Liehr
9f548e298d
Support inlined cross-crate re-exported trait aliases 2025-04-17 02:35:05 +02:00
Nicholas Nethercote
2fef0a30ae Replace infallible name_or_empty methods with fallible name methods.
I'm removing empty identifiers everywhere, because in practice they
always mean "no identifier" rather than "empty identifier". (An empty
identifier is impossible.) It's better to use `Option` to mean "no
identifier" because you then can't forget about the "no identifier"
possibility.

Some specifics:
- When testing an attribute for a single name, the commit uses the
  `has_name` method.
- When testing an attribute for multiple names, the commit uses the new
  `has_any_name` method.
- When using `match` on an attribute, the match arms now have `Some` on
  them.

In the tests, we now avoid printing empty identifiers by not printing
the identifier in the `error:` line at all, instead letting the carets
point out the problem.
2025-04-17 09:50:52 +10:00
Nicholas Nethercote
7e1f2f9c54 Augment some tests involving attributes.
This shows places where the use of `name_or_empty` causes problems, i.e.
we print empty identifiers in error messages:
```
error: unrecognized field name ``
error: `` isn't a valid `#[macro_export]` argument
`#[no_sanitize()]` should be applied to a function
```
(The last one is about an attribute `#[no_sanitize("address")]`.)

The next commit will fix these.
2025-04-17 09:50:52 +10:00
Nicholas Nethercote
400e8e5dc8 Fix attribute printing in an error.
The current code assumes that the attribute is just an identifier, and
so misprints paths.
2025-04-17 09:50:52 +10:00
Nicholas Nethercote
4be670f89b Warnings-as-errors in check-builtin-attr-ice.rs.
This adds two new warnings, both of which print the attribute
incorrectly as `#[]`. The next commit will fix this.
2025-04-17 09:50:52 +10:00
Curtis D'Alves
92ce44f372 ignore aix for tests/ui/erros/pic-linker.rs 2025-04-16 19:26:26 -04:00
Nadrieril
3b91b7ac57 Make cow_of_cow test a teeny bit more explicit 2025-04-16 15:42:13 -07:00
dianne
4c4b61b730 add a feature gate test
Implicit deref patterns allow previously ill-typed programs. Make sure
they're still ill-typed without the feature gate. I've thrown in a test
for `deref!(_)` too, though it seems it refers to `deref_patterns` as a
library feature.
2025-04-16 15:42:13 -07:00
dianne
ff0d4bc743 upvar inference for implicit deref patterns 2025-04-16 15:42:12 -07:00
dianne
977c9ab7a2 respect the tcx's recursion limit when peeling 2025-04-16 15:42:12 -07:00
dianne
923d95cc9f don't peel ADTs the pattern could match
This is the use for the previous commits' refactors; see the messages
there for more information.
2025-04-16 15:42:12 -07:00
Matthias Krüger
f8f22add3b
Rollup merge of #139915 - RalfJung:intrinsic-imports, r=compiler-errors
replace some #[rustc_intrinsic] usage with use of the libcore declarations

Better to centralize the `#[rustc_intrinsic]` declarations in libcore than have them spread across the test suite as well.
2025-04-17 00:16:24 +02:00
Matthias Krüger
9e0be6c15b
Rollup merge of #139900 - lcnr:normalizes-to-where-bounds-unproductive, r=compiler-errors
stepping into impls for normalization is unproductive

See the inline comment. This builds on the reasoning from #136824 (https://gist.github.com/lcnr/c49d887bbd34f5d05c36d1cf7a1bf5a5). Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/176.

Looking at the end of the gist:
> The only ways to project out of a constructor are the following:
> - accessing an associated item, either its type or its item bounds
> - accessing super predicates

Detecting cases where we accessing the type of an associated item is easy, it's simply when we normalize. I don't yet know how to detect whether we step out of an impl by accessing item bounds. Once we also detect these cases we should be able to soundly support arbitrary coinductive traits. Luckily this does not matter for this PR :>

r? `@compiler-errors` cc `@nikomatsakis`
2025-04-17 00:16:24 +02:00
Matthias Krüger
afb60d3097
Rollup merge of #139889 - spencer3035:clean-ui-tests-3-of-n, r=jieyouxu
Clean UI tests 3 of n

Cleaned up 2 tests in `tests/ui/numbers-arithemetic` to be more useful. One for each commit. I can squash these into one commit when approved.

Related Issues:
#73494
#133895

r? jieyouxu
2025-04-17 00:16:23 +02:00