Commit Graph

5168 Commits

Author SHA1 Message Date
Matthias Krüger
5cab70ed7f
Rollup merge of #141362 - BoxyUwU:correct_error_term_kind, r=lcnr
Normalize aliases to correct kind of error term

Fixes #140642

When normalizing an alias to an error in the old solver, normalize to the same term kind as the alias being normalized instead of always to a type error.

r? lcnr
2025-05-22 16:04:12 +02:00
Matthias Krüger
654b2f39f1
Rollup merge of #141359 - compiler-errors:async-fn-once, r=lcnr
Fix `FnOnce` impl for `AsyncFn`/`AsyncFnMut` self-borrowing closures in new solver

This only affects closures that are "`AsyncFn`/`AsyncFnMut`" in their calling capability that are being called with the `FnOnce` trait.

fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/217

r? lcnr
2025-05-22 16:04:12 +02:00
Matthias Krüger
8c2508292b
Rollup merge of #141286 - compiler-errors:querify-coroutine, r=oli-obk
Querify `coroutine_hidden_types`

This is necessary if we ever want to add implied bounds that would be used for higher-ranked coroutine auto trait goals (e.g. future implements `Send`).

Modest perf regression in `hyper` full build which (afaict?) is the only async stress test, so definitely worth it IMO.

r? oli-obk
2025-05-22 16:02:31 +02:00
Matthias Krüger
c385715806
Rollup merge of #141130 - mejrs:use_self, r=compiler-errors
rustc_on_unimplemented cleanups

Addresses some of the fixmes from https://github.com/rust-lang/rust/pull/139091 and https://github.com/rust-lang/rust/pull/140307.

- switch from `_Self` to `Self` in library
- properly validate that arguments in the `on` filter and the format strings are actually valid

See https://github.com/rust-lang/rustc-dev-guide/pull/2357 for the relevant documentation.
2025-05-22 16:02:30 +02:00
Boxy
fdccb42167 Add test/comment about const patterns with unused params 2025-05-22 12:52:46 +01:00
Boxy
217c4ad427 Review Comments 2025-05-22 12:47:19 +01:00
bors
d423c815a6 Auto merge of #141135 - compiler-errors:fast-path-2, r=lcnr
Fast path for processing some obligations in the new solver

Fast path applies to:
- Dyn compatibility predicates
- Region and type outlives predicates
- Trivially sized predicates
2025-05-22 11:39:10 +00:00
Michael Goulet
16b6ffe0db Don't allow poly_select in new solver 2025-05-22 11:24:31 +00:00
Boxy
bc9cdc960f Return correct error term kind on projection errors 2025-05-22 12:02:45 +01:00
Matthias Krüger
de4055f3f1
Rollup merge of #141363 - BoxyUwU:doc_lta_norm_binders, r=lcnr
Document why we allow escaping bound vars in LTA norm

r? lcnr

followup from the const normalization PR. I think I now understand why free alias norm is funny about binders
2025-05-21 22:15:02 +02:00
Michael Goulet
ca912d794d Make captures state error more precise 2025-05-21 20:02:29 +00:00
Boxy
b4079c62bd Don't evaluate constants depending on infers or params 2025-05-21 20:20:19 +01:00
Boxy
996a185ba7 Introduce tcx.anon_const_kind query 2025-05-21 20:20:19 +01:00
Boxy
6d6259f310 Document why we allow escaping bound vars in LTA norm 2025-05-21 20:09:41 +01:00
bors
462cc099c9 Auto merge of #141345 - matthiaskrgr:rollup-vux7gok, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #141267 (only resolve top-level guard patterns' guards once)
 - #141280 (Use Docker cache from the current repository)
 - #141296 (Async drop fix for 'broken mir, place has deref as later projection')
 - #141328 (When AsyncDrop impl is empty, sync drop generated in elaborator)
 - #141332 (Do not eagerly fold consts in `normalize_param_env_or_error` if new solver)
 - #141333 (Use `DeepRejectCtxt` in `assemble_inherent_candidates_from_param`)
 - #141334 (eagerly check nested obligations when coercing fndefs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-21 16:42:18 +00:00
Matthias Krüger
9fd0ab6876
Rollup merge of #141334 - lcnr:coerce-nested-obligations, r=compiler-errors
eagerly check nested obligations when coercing fndefs

fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/212

r? `@compiler-errors`
2025-05-21 15:38:12 +02:00
Matthias Krüger
6606fd9a14
Rollup merge of #141332 - compiler-errors:no-fold-const, r=lcnr
Do not eagerly fold consts in `normalize_param_env_or_error` if new solver

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

Given:

```
trait Trait: Deref<Target = [u8; { 1 + 1 }]> {}
```

when elaborating param env for `Trait`, we have `Self: Trait`, `Self: Deref<Target = [u8; {anon const}]>`.

Before this PR, we would fold the anon consts away *before* elaborating. However, we end up getting another *un-folded* copy of the anon const from elaborating `Self: Trait`. This leads to normalization ambiguity.

r? lcnr
2025-05-21 15:38:11 +02:00
bors
356f2d0774 Auto merge of #140386 - oli-obk:match-on-lang-item-kind, r=compiler-errors
Match on lang item kind instead of using an if/else chain

Similar to how the new solver does this. Just noticed while I was adding a new entry to the chain 😆
2025-05-21 13:31:13 +00:00
lcnr
196c3b3ef4 eagerly check nested obligations when coercing fndefs 2025-05-21 11:09:48 +00:00
Michael Goulet
44a2af3068 Do not eagerly fold consts in normalize_param_env_or_error if new solver 2025-05-21 09:23:36 +00:00
Santiago Pastorino
66d47c1687
Do not call name() on rpitit assoc_item 2025-05-20 17:30:08 -03:00
Michael Goulet
6555ef7f09 Querify coroutine_hidden_types 2025-05-20 11:50:25 +00:00
Michael Goulet
407fac5479 Fast path for sized pred 2025-05-18 12:18:44 +00:00
Michael Goulet
1d0d258a86 Fast path for processing some obligations in the new solver 2025-05-18 12:18:44 +00:00
Matthias Krüger
616650b6ca
Rollup merge of #141121 - compiler-errors:ambig-is-not-err, r=lcnr
Only select true errors in `impossible_predicates`

See description in test.

Fixes #141119

r? lcnr
2025-05-17 15:45:22 +02:00
mejrs
9ffd0bf75a do away with _Self and TraitName and check generic params for rustc_on_unimplemented 2025-05-17 15:15:53 +02:00
Michael Goulet
9578b59eac Only select true errors in impossible_predicates 2025-05-17 12:09:15 +00:00
Matthias Krüger
8c14588fbb
Rollup merge of #140208 - compiler-errors:wf-coinductive, r=lcnr
Make well-formedness predicates no longer coinductive

This PR makes well-formedness no longer coinductive. It was made coinductive in https://github.com/rust-lang/rust/pull/98542, but AFAICT this was only to fix UI tests since we stopped lowering `where Ty:` to an empty-region outlives predicate but to a WF predicate instead.

Arguably it should lower to something completely different, something like a "type mentioned no-op predicate", but well-formedness serves this purpose fine today, and since no code (according to crater) relies on this coinductive behavior, we'd like to avoid having to emulate it in the new solver.

Fixes #123456 (I didn't want to add a test since it seems low-value to have a ICE test for a fuzzer minimization that is basically garbage code.)

Fixes #109764 (not sure if this behavior is emulatable w/o coinductive WF?)

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

r? lcnr
2025-05-17 10:33:08 +02:00
bors
c8bda740ea Auto merge of #140978 - davidtwco:deep-reject-in-match-norm-trait-ref, r=lcnr
trait_sel: deep reject `match_normalize_trait_ref`

Spotted during an in-person review of #137944 at RustWeek: `match_normalize_trait_ref` could be using `DeepRejectCtxt` to exit early as an optimisation for projection candidates, like is done with param candidates.

r? `@lcnr`
cc `@oli-obk`
2025-05-16 23:39:39 +00:00
Matthias Krüger
d0ea342440
Rollup merge of #140947 - compiler-errors:pending-norm, r=lcnr
Flush errors before deep normalize in `dropck_outlives`

Deep normalization doesn't allow the ocx to have pending obligations, so process them before deeply normalizing.

Fixes https://github.com/rust-lang/rust/issues/140931
Fixes https://github.com/rust-lang/rust/issues/140462
2025-05-15 22:28:51 +02:00
Matthias Krüger
1f84e114f1
Rollup merge of #140712 - lcnr:normalization-gat-args, r=compiler-errors
normalization: avoid incompletely constraining GAT args

We need to copy the behavior of #125214 in the new solver. This fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/202 which seems to be the cause of the regression in `deptypes`.

r? ```@compiler-errors```
2025-05-15 22:28:50 +02:00
bors
c4e05e53d1 Auto merge of #136988 - compiler-errors:impossible_predicates, r=lcnr
Use the new solver in the `impossible_predicates`

The old solver is unsound for many reasons. One of which was weaponized by `@lcnr` in #140212, where the old solver was incompletely considering a dyn vtable method to be impossible and replacing its vtable entry with a null value. This null function could be called post-mono.

The new solver is expected to be less incomplete due to its correct handling of higher-ranked aliases in relate. This PR switches the `impossible_predicates` query to use the new solver, which patches this UB.

r? lcnr
2025-05-15 15:31:24 +00:00
bors
4eca99a18e Auto merge of #140887 - pietroalbini:pa-bootstrap-update, r=compiler-errors
Stage0 bootstrap update

This PR [follows the release process](https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday) to update the stage0 compiler.

The only thing of note is 58651d1b31, which was flagged by clippy as a correctness fix. I think allowing that lint in our case makes sense, but it's worth to have a second pair of eyes on it.

r? `@Mark-Simulacrum`
2025-05-13 09:54:28 +00:00
Michael Goulet
a508011b1f Expect deep norm to fail if query norm failed 2025-05-13 09:18:17 +00:00
David Wood
a5e1dba0cd
trait_sel: deep reject match_normalize_trait_ref
Spotted during an in-person review of unrelated changes,
`match_normalize_trait_ref` could be using `DeepRejectCtxt` to exit early
as an optimisation for prejection candidates, like is done in param
candidates.
2025-05-13 07:33:51 +00:00
Michael Goulet
df1da673f7 Flush errors before deep normalize in dropck_outlives 2025-05-12 21:04:38 +00:00
omahs
1caaa88700 Fix typos 2025-05-12 17:20:49 +00:00
Pietro Albini
2ce08ca5d6
update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
Jieyou Xu
7dae31828b
Disarm time bomb (diagnostics)
Revert "Rollup merge of #129343 - estebank:time-version, r=jieyouxu"

This reverts commit 26f75a65d7, reversing
changes made to 2572e0e8c9.

Imports are modified to fix merge conflicts and remove unused ones.
2025-05-09 12:09:15 +02:00
lcnr
31ebe11f61 normalization: avoid incompletely constraining GAT args 2025-05-08 14:38:47 +00:00
Matthias Krüger
4ed13189ec
Rollup merge of #140736 - xizheyin:issue-140166, r=petrochenkov
trait selection: check `&` before suggest remove deref

FIxes #140166

r? compiler
2025-05-08 13:55:44 +02:00
Matthias Krüger
74b79aee60
Rollup merge of #140711 - compiler-errors:combine-maybes, r=lcnr
Do not discard constraints on overflow if there was candidate ambiguity

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

There's a pretty chunky justification in the test.

r? lcnr
2025-05-08 08:14:18 +02:00
Matthias Krüger
aace48811b
Rollup merge of #140641 - lcnr:opaque-type-storage-entries, r=compiler-errors
detect additional uses of opaques after writeback

Based on #140607. It's a lot harder to encounter in practice than I though 😅 😁 I've still added it with the expectation that somebody will encounter it at some point.

Also modifies the `EvalCtxt` to use the same impl to detect newly added opaque types.

r? ``@compiler-errors``
2025-05-08 08:14:18 +02:00
lcnr
fc0ef54fd9 opaque_type_storage to InferCtxtLike 2025-05-07 17:58:20 +00:00
Michael Goulet
a910329c67 Use MaybeCause::or to allow constraints from overflows if they are combined with ambiguity 2025-05-07 17:12:15 +00:00
Michael Goulet
df13f7c1fa Require T: TypeFoldable in Binder<T> visit 2025-05-07 16:00:21 +00:00
xizheyin
bd88f3e3e3
Check & before suggest remove deref when trait_selection
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-07 23:23:25 +08:00
bors
f76c7367c6 Auto merge of #137995 - hkBst:parse_format_reuse_unescape, r=nnethercote
Remove duplicate impl of string unescape from parse_format

r? `@nnethercote`
2025-05-07 06:18:39 +00:00
lcnr
431f02d531 support duplicates in the opaque_types_storage 2025-05-06 14:59:09 +00:00
Marijn Schouten
3d4737fb5e Remove duplicate impl of string unescape 2025-05-06 10:00:22 +00:00
Guillaume Gomez
1c801a385c
Rollup merge of #140605 - lcnr:defer-opaque-type-error, r=compiler-errors
`fn check_opaque_type_parameter_valid` defer error

Will be used in #139587 to silence opaque type errors if there are other borrowck failures. I think it can be merged separately.

r? `@compiler-errors`
2025-05-05 21:32:33 +02:00
Guillaume Gomez
224e3ca096
Rollup merge of #140559 - rperier:type-ir-to-type-middle, r=compiler-errors
Removing rustc_type_ir in the rustc_infer codebase

cc #138449

This is a second refactoring of rustc_type_ir to use rustc_middle instead, this time that's for rustc_infer
2025-05-05 21:32:32 +02:00
Trevor Gross
e9a50b8a0a
Rollup merge of #140307 - mejrs:condition_parser, r=nnethercote
Refactor rustc_on_unimplemented's filter parser

Followup to https://github.com/rust-lang/rust/pull/139091; I plan on moving most of this code into `rustc_attr_parsing` at some point, but want to land this separately first.

I have taken care to preserve the original behavior as much as I could:
- All but one of the new error variants are replacements for the ones originally emitted by the cfg parsing machinery; so these errors are not "new".
- the `InvalidFlag` variant is new, this PR turns this (from being ignored and silently doing nothing) into an error:
    ```rust
    #[rustc_on_unimplemented(on(something, message = "y"))]
    //~^ ERROR invalid boolean flag
    //~^^ NOTE expected one of `crate_local`, `direct` or `from_desugaring`, not `something`
    trait InvalidFlag {}
    ```
    This does not occur anywhere except in this test. I couldn't find a way that I liked to keep allowing this or to do nothing, erroring was the cleanest solution.
- There are a bunch of FIXME throughout this and the previous PR, I plan on addressing those in follow up prs..

Finally, this gets rid of the "longest" dependency in rustc:
![image](https://github.com/user-attachments/assets/3c3eb3a0-b7b3-40d9-aada-a752e28c8678)
2025-05-05 00:20:57 -04:00
bors
1bea580f36 Auto merge of #140549 - BoxyUwU:proper_const_norm, r=lcnr
Set groundwork for proper const normalization

r? lcnr

Updates a lot of our normalization/alias infrastructure to be setup to handle mgca aliases and normalization once const items are represented more like aliases than bodies. Inherent associated consts are still super busted, I didn't update the assertions that IACs the right arg setup because that winds up being somewhat involved to do *before* proper support for normalizing const aliases is implemented.

I dont *intend* for this to have any effect on stable. We continue normalizing via ctfe on stable and the codepaths in `project` for consts should only be reachable with mgca or ace.
2025-05-04 03:12:41 +00:00
lcnr
d0216b5386 fn check_opaque_type_parameter_valid defer error 2025-05-03 21:32:24 +00:00
mejrs
4671081bdb Refactor rustc_on_unimplemented's filter parser 2025-05-02 22:08:35 +02:00
Matthias Krüger
296733d5ac
Rollup merge of #140519 - compiler-errors:name-based-comparison, r=oli-obk
Use select in projection lookup in `report_projection_error`

Using `for_each_relevant_impl` doesn't actually select the correct impl; we can use `select` here to actually get the correct impl with certainty. Follow-up to https://github.com/rust-lang/rust/pull/140278.

r? oli-obk
2025-05-02 19:37:57 +02:00
Romain Perier
6970813e78 Use less rustc_type_ir in the compiler codebase
This commit does the following:
  - Replaces use of rustc_type_ir by rustc_middle in rustc_infer.
  - The DelayedMap type is exposed by rustc_middle so everything can be
    accessed through rustc_middle in a coherent manner.
  - API-layer traits, like InferCtxtLike, Interner or inherent::* must be
    accessed via rustc_type_ir, not rustc_middle::ty. For this reason
    these are not reexported by rustc_middle::ty.
  - Replaces use of ty::Interner by rustc_type_ir::Interner in
    rustc_trait_selection
2025-05-02 09:37:06 +02:00
Boxy
238d113b07 Set groundwork for proper const normalization 2025-05-01 20:05:02 +01:00
Boxy
53e3907bcb No-op split into sub functions 2025-05-01 14:34:19 +01:00
Matthias Krüger
6423d75076
Rollup merge of #140468 - BoxyUwU:normalization_confusings2, r=lcnr
Minor tweaks to make some normalization (adjacent) code less confusing

r? lcnr

sorry for double ping lol
2025-04-30 22:36:41 +02:00
Michael Goulet
f2930001aa Use select in projection lookup 2025-04-30 18:07:52 +00:00
Matthias Krüger
1e440aecc8
Rollup merge of #140516 - rperier:type-ir-to-type-middle, r=lcnr
Replace use of rustc_type_ir by rustc_middle

cc #138449

I want to help on this issue. I have replaced all the rustc_type_ir uses by the equivalent type in rustc_middle.
DelayedSet is also re-exposed by rustc_middle.
2025-04-30 17:28:02 +02:00
Romain Perier
ea7af1803f Use less rustc_type_ir in the compiler codebase
This commit does the following:
 - Replaces use of rustc_type_ir by rustc_middle
 - Removes the rustc_type_ir dependency
 - The DelayedSet type is exposed by rustc_middle so everything can be
   accessed through rustc_middle in a coherent manner.
2025-04-30 16:42:33 +02:00
Matthias Krüger
9625096d2c
Rollup merge of #140445 - oli-obk:const-manually-drop, r=fee1-dead
Treat ManuallyDrop as ~const Destruct

cc https://github.com/rust-lang/rust/issues/133214#issuecomment-2838078133

r? ```@compiler-errors```

cc ```@fee1-dead```
2025-04-30 10:18:28 +02:00
Boxy
c31794d6d3 confusings 2025-04-29 18:55:21 +01:00
Trevor Gross
a20fe8ff23
Rollup merge of #139909 - oli-obk:or-patterns, r=BoxyUwU
implement or-patterns for pattern types

These are necessary to represent `NonZeroI32`, as the range for that is `..0 | 1..`. The `rustc_scalar_layout_range_*` attributes avoided this by just implementing wraparound and having a single `1..=-1` range effectively. See https://rust-lang.zulipchat.com/#narrow/channel/481660-t-lang.2Fpattern-types/topic/.60or.20pattern.60.20representation.20in.20type.20system/with/504217694 for some background discussion

cc https://github.com/rust-lang/rust/issues/123646

r? `@BoxyUwU`
2025-04-29 12:28:22 -04:00
Oli Scherer
a1c70590b2 Treat ManuallyDrop as ~const Destruct 2025-04-29 10:39:54 +00:00
Oli Scherer
03c05c9a95 Also match on the lang item in confirmation 2025-04-29 06:52:42 +00:00
Oli Scherer
dd714276e5 Always check the lang item first 2025-04-29 06:52:42 +00:00
Oli Scherer
19fc3a1a6e Replace if/elseif chain with match 2025-04-29 06:52:42 +00:00
Michael Goulet
38c05a68ee Adjust tests 2025-04-29 03:07:24 +00:00
Michael Goulet
f918b89f61 Wf is not coinductive 2025-04-29 02:43:06 +00:00
bors
25cdf1f674 Auto merge of #140388 - GuillaumeGomez:rollup-aj9o3ch, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #140056 (Fix a wrong error message in 2024 edition)
 - #140220 (Fix detection of main function if there are expressions around it)
 - #140249 (Remove `weak` alias terminology)
 - #140316 (Introduce `BoxMarker` to improve pretty-printing correctness)
 - #140347 (ci: clean more disk space in codebuild)
 - #140349 (ci: use aws codebuild for the `dist-x86_64-linux` job)
 - #140379 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-28 17:22:11 +00:00
Guillaume Gomez
7843686ffe
Rollup merge of #140249 - BoxyUwU:remove_weak_alias_terminology, r=oli-obk
Remove `weak` alias terminology

I find the "weak" alias terminology to be quite confusing. It implies the existence of "strong" aliases (which do not exist) and I'm not really sure what about weak aliases is "weak". I much prefer "free alias" as the term. I think it's much more obvious what it means as "free function" is a well defined term that already exists in rust.

It's also a little confusing given "weak alias" is already a term in linker/codegen spaces which are part of the compiler too. Though I'm not particularly worried about that as it's usually very obvious if you're talking about the type system or not lol. I'm also currently trying to write documentation about aliases and it's somewhat awkward/confusing to be talking about *weak* aliases, when I'm not really sure what the basis for that as the term actually *is*.

I would also be happy to just find out there's a nice meaning behind calling them "weak" aliases :-)

r? `@oli-obk`

maybe we want a types MCP to decide on a specific naming here? or maybe we think its just too late to go back on this naming decision ^^'
2025-04-28 13:30:45 +02:00
Andrew Zhogin
c366756a85 AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
Oli Scherer
b023856f29 Add or-patterns to pattern types 2025-04-28 07:50:18 +00:00
Oli Scherer
cb6d3715a5 Split out various pattern type matches into their own function 2025-04-28 07:46:50 +00:00
Matthias Krüger
3c322bc1cc
Rollup merge of #140320 - lcnr:wf-use-term, r=compiler-errors
replace `GenericArg` with `Term` where applicable

r? types
2025-04-26 16:12:33 +02:00
Matthias Krüger
443358d25d
Rollup merge of #140318 - compiler-errors:specialized-async-fn-kind-err, r=fee1-dead
Simply try to unpeel AsyncFnKindHelper goal in `emit_specialized_closure_kind_error`

Tweak the handling of `AsyncFnKindHelper` goals in `emit_specialized_closure_kind_error` to not be so special-casey, and just try to unpeel one or two layers of obligation causes to get to their underlying `AsyncFn*` goal.

Fixes https://github.com/rust-lang/rust/issues/140292
2025-04-26 16:12:33 +02:00
lcnr
855035b038 convert some GenericArg to Term 2025-04-26 02:05:31 +00:00
Michael Goulet
4b309c67c6 Simply try to unpeel AsyncFnKindHelper goal in emit_specialized_closure_kind_error 2025-04-26 01:42:52 +00:00
Michael Goulet
31c8d10342 Track per-obligation recursion depth only if there is inference 2025-04-25 18:14:39 +00:00
Matthias Krüger
3c08a50a15
Rollup merge of #140278 - compiler-errors:name-based-comparison, r=nnethercote
Don't use item name to look up associated item from trait item

This fix should be self-justifying b/c the fact that we were using identifiers here was kinda sus anyways, esp b/c we have a failproof way of doing the comparison :) I'll leave some info about why this repro needs a macro.

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

r? `@nnethercote`
2025-04-25 07:50:27 +02:00
Matthias Krüger
564e5ccb5c
Rollup merge of #140202 - est31:let_chains_feature_compiler, r=lcnr
Make #![feature(let_chains)] bootstrap conditional in compiler/

Let chains have been stabilized recently in #132833, so we can remove the gating from our uses in the compiler (as the compiler uses edition 2024).
2025-04-25 07:50:25 +02:00
Michael Goulet
1d0b3be659 Don't use item name to look up associated item from trait item 2025-04-25 01:57:45 +00:00
bors
3c877f6a47 Auto merge of #140245 - matthiaskrgr:rollup-e0fwsfv, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #139261 (mitigate MSVC alignment issue on x86-32)
 - #140075 (Mention average in midpoint documentations)
 - #140184 (Update doc of cygwin target)
 - #140186 (Rename `compute_x` methods)
 - #140194 (minicore: Have `//@ add-core-stubs` also imply `-Cforce-unwind-tables=yes`)
 - #140195 (triagebot: label minicore changes w/ `A-test-infra-minicore` and ping jieyouxu on changes)
 - #140214 (Remove comment about handling non-global where bounds with corresponding projection)
 - #140228 (Revert overzealous parse recovery for single colons in paths)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-24 12:06:16 +00:00
Boxy
bdfeb8f36b Remove weak alias terminology 2025-04-24 11:59:20 +01:00
Matthias Krüger
1553cfa4e6
Rollup merge of #140214 - compiler-errors:remove-hack, r=lcnr
Remove comment about handling non-global where bounds with corresponding projection

This comment is no longer relevant since we only assemble rigid projections if no param-env candidates hold.

Also remove a stray comment from the old solver.

r? lcnr
2025-04-24 11:40:46 +02:00
Matthias Krüger
60c2c34d1d
Rollup merge of #140186 - BoxyUwU:compute_what, r=compiler-errors
Rename `compute_x` methods

r? ```@lcnr```

I find the `compute_x` naming scheme to be overly confusing. It means `compute_wf_obligations_for_x_and_add_them_to_self` but shortens out all of the important parts of the actual operation being performed. `compute_x` sounds like its somehow performing `x`, maybe even returning it from the function, which is not true.

I've had some newer contributors be confused by this naming scheme so I think it's good to change it to something more self-evident

Some misc drive by niceties while I was here too.
2025-04-24 11:40:40 +02:00
Matthias Krüger
986750ded4
Rollup merge of #140232 - nnethercote:rm-unnecessary-clones, r=SparrowLii
Remove unnecessary clones

r? `@SparrowLii`
2025-04-24 08:13:01 +02:00
Matthias Krüger
2ba3a5c909
Rollup merge of #139945 - shepmaster:hir-lifetime-syntax-source, r=nnethercote
Extend HIR to track the source and syntax of a lifetime

An upcoming lint will want to be able to know if a lifetime is hidden (e.g. `&u8`, `ContainsLifetime`) or anonymous: (e.g. `&'_ u8`, `ContainsLifetime<'_>`). It will also want to know if the lifetime is related to a reference (`&u8`) or a path (`ContainsLifetime`).

r? ``@nnethercote``
2025-04-24 08:12:59 +02:00
Nicholas Nethercote
055a27da2a Remove some unnecessary clones.
I found these by grepping for `&[a-z_\.]*\.clone()`, i.e. expressions
like `&a.b.clone()`, which are sometimes unnecessary clones, and also
looking at clones nearby to cases like that.
2025-04-24 11:12:34 +10:00
bors
fa58ce343a Auto merge of #138845 - compiler-errors:stall-generators, r=lcnr
Properly stall coroutine witnesses in new solver

TODO: write description

r? lcnr
2025-04-23 21:35:15 +00:00
Jake Goulding
2a5c349f42 Extend HIR to track the source and syntax of a lifetime
An upcoming lint will want to be able to know if a lifetime is
hidden (e.g. `&u8`, `ContainsLifetime`) or anonymous: (e.g. `&'_ u8`,
`ContainsLifetime<'_>`). It will also want to know if the lifetime is
related to a reference (`&u8`) or a path (`ContainsLifetime`).
2025-04-23 16:37:39 -04:00
Michael Goulet
1162f42b86 Remove hack 2025-04-23 18:36:37 +00:00
Michael Goulet
257f68777f Use the new solver in the impossible_predicates 2025-04-23 18:04:25 +00:00
Michael Goulet
f943f73db4 More 2025-04-23 15:09:25 +00:00
est31
7493e1cdf6 Make #![feature(let_chains)] bootstrap conditional in compiler/ 2025-04-23 16:40:30 +02:00
Boxy
c6e6ac9575 Module docs 2025-04-23 04:14:35 +01:00