Commit Graph

2633 Commits

Author SHA1 Message Date
Jana Dönszelmann 632ed10838 Revert "eagerly normalize during generalization"
This reverts commit 5d0863b147.
2026-03-23 12:09:34 +01:00
Jana Dönszelmann 4af62bdbac Revert "implement eager normalization in a fresh context during typeck"
This reverts commit 04f2c0191e.
2026-03-23 12:09:34 +01:00
Jana Dönszelmann e190973e4f Revert "merge generalizer state and structurally relate aliases"
This reverts commit 917713b4db.
2026-03-23 12:09:34 +01:00
Jana Dönszelmann df0f627bfc Revert "explicitly provide type in transmute"
This reverts commit 7a123e87b2.
2026-03-23 12:09:34 +01:00
Jana Dönszelmann c838deca23 Revert "normalize at the start of generalize if we can"
This reverts commit f50591fc10.
2026-03-23 12:09:34 +01:00
Jana Dönszelmann 38cb40091c Revert "try generalizing if normalization isn't a tyvar"
This reverts commit e8e3544a71.
2026-03-23 12:09:34 +01:00
Jana Dönszelmann bd781549f2 Revert "inline into"
This reverts commit 9aa065bc49.
2026-03-23 12:09:34 +01:00
Jana Dönszelmann 1fa1611e9f Revert "address review"
This reverts commit d665c0b371.
2026-03-23 12:09:34 +01:00
bors ac7f9ec7da Auto merge of #151746 - jdonszelmann:eagerly-normalize-in-generalize, r=lcnr
Eagerly normalize in generalize

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/151746)*

r? @lcnr 

cc: https://github.com/rust-lang/trait-system-refactor-initiative/issues/262
2026-03-20 18:22:43 +00:00
Jana Dönszelmann d665c0b371 address review 2026-03-20 14:02:24 +01:00
Shoyu Vanilla b77739ad81 Do not shallow resolve to root var while fudging 2026-03-19 00:26:19 +09:00
Zalathar 985b41d387 Remove the rustc_data_structures::assert_matches! re-exports 2026-03-08 22:02:23 +11:00
Josh Stone 32bae1353e Update cfg(bootstrap) 2026-03-07 10:42:02 -08:00
Jana Dönszelmann 9aa065bc49 inline into 2026-02-26 14:53:57 +01:00
Jana Dönszelmann e8e3544a71 try generalizing if normalization isn't a tyvar 2026-02-26 14:53:57 +01:00
Jana Dönszelmann f50591fc10 normalize at the start of generalize if we can 2026-02-26 14:53:57 +01:00
lcnr 7a123e87b2 explicitly provide type in transmute 2026-02-26 14:53:57 +01:00
Jana Dönszelmann 917713b4db merge generalizer state and structurally relate aliases 2026-02-26 14:53:57 +01:00
Jana Dönszelmann 04f2c0191e implement eager normalization in a fresh context during typeck 2026-02-26 14:53:57 +01:00
Jana Dönszelmann 5d0863b147 eagerly normalize during generalization 2026-02-26 11:44:24 +01:00
Zalathar 4b7a05eeee Stop using LinkedGraph in lexical_region_resolve 2026-02-26 13:00:28 +11:00
bors 75b9d89c68 Auto merge of #151380 - ShoyuVanilla:shallow-resolve-to-root-var, r=lcnr
Shallow resolve ty and const vars to their root vars

Continuation of https://github.com/rust-lang/rust/pull/147193
2026-02-15 03:04:28 +00:00
Lukas Bergdoll 2f3b952349 Stabilize assert_matches 2026-02-11 14:13:44 +01:00
Shoyu Vanilla 955f7750c1 Remove redundant shallow_resolve call 2026-02-11 18:08:14 +09:00
Shoyu Vanilla 13a83cb639 Shallow resolve ty and const vars to their root vars 2026-02-11 17:38:34 +09:00
Jonathan Brouwer 1722b8e06b Convert to inline diagnostics in rustc_infer 2026-02-03 15:14:49 +01:00
Jonathan Brouwer 40d7cb890f Rollup merge of #150271 - Jamesbarford:chore/refactor-struct-placeholder-pt2, r=lcnr
Move struct placeholder pt2

r? ghost
2026-01-29 17:47:29 +01:00
James Barford-Evans 25c1365507 Part 2 refactoring of moving placeholder types to rustc_type_ir 2026-01-29 11:11:40 +00:00
Adwin White f6efe7e1d5 don't return incorrectly constrained opaques in method_autoderef_steps 2026-01-26 17:30:18 +08:00
Zalathar 7ec34defe9 Temporarily re-export assert_matches! to reduce stabilization churn 2026-01-19 18:26:53 +11:00
Nicholas Nethercote 4ae3c85a5e Use the name var_kinds more.
Variables that are collections of `CanonicalVarKind` are sometimes
called `var_kinds` and sometimes called `variables`. The former is much
better, because `variables` is (a) non-descript, and (b) often used
nearby for collections of `I::GenericArg`. I found the inconsistency
made the canonicalization code harder to understand.

This commit renames various `variables` things as `var_kinds`.
2026-01-08 13:37:34 +11:00
Nicholas Nethercote ec5e96e58b Remove Option from fold_infer_ty return type.
It's no longer needed.
2025-12-23 07:46:12 +11:00
Nicholas Nethercote 2d10f47693 Disallow freshening an already-freshened type/const.
It never happens in practice.
2025-12-22 23:46:39 +11:00
Nicholas Nethercote 5c49aee9ec Remove InferCtxt::freshen.
Sometimes we freshen using a new `TypeFreshener`, and sometimes we
freshen with an existing `TypeFreshener`. For the former we have the
method `InferCtxt::freshen`. For the latter we just call `fold_with`.
This asymmetry has been confusing to me.

This commit removes `InferCtxt::freshen` so that all the freshening
sites consistently use `fold_with` and it's obvious if each one is using
a new or existing `TypeFreshener`.
2025-12-22 23:32:11 +11:00
Nicholas Nethercote 1bb9ff05c0 Remove InferCtxt::freshener.
I have always found this confusingly named, because it creates a new
freshener rather than returning an existing one. We can remove it and
just use `TypeFreshener::new()` at the two call sites, avoiding this
confusion.
2025-12-22 17:48:37 +11:00
Nicholas Nethercote 4652295a3e Simplify TypeFreshener methods.
`freshen_{ty,const}` take a `Result` and just do a fold if the input is
`Ok`. It's simpler to do those folds at the call site, and only call
`freshen_{ty,const}` in the `Err` case. That way we can also avoid
useless fold operations on the results of `new_{int,uint,float}`.

Also, make some `bug!` calls more concise.
2025-12-22 17:22:28 +11:00
James Barford-Evans 1986be2bcd Moved struct Placeholder<T> 2025-12-09 13:40:18 +00:00
lcnr 1b71459736 emit WF goals in relate, not in generalize 2025-12-04 15:43:05 +01:00
Adwin White b111aed11f fudge infer vars in cause code intentionally 2025-12-01 12:40:49 +08:00
bjorn3 973c7527b4 Unify the configuration of the compiler docs
Previously it was rather inconsistent which crates got the rust logo and
which didn't and setting html_root_url was forgotten in many cases.
2025-11-05 11:25:27 +00:00
lcnr 5f312079f2 add logging to fudge_inference_if_ok 2025-11-04 12:03:19 +01:00
Matthias Krüger 844a41903e Rollup merge of #148290 - oli-obk:push-qwxvxyopypry, r=nnethercote
Do not emit solver errors that contain error types

any follow-up errors are going to either be duplicates or often disappear if the error itself is fixed.

in this PR it mostly silences dyn-compat errors as all the other errors are already deduplicated outside of the test suite. The dyn compat errors are independent errors and I think if the dyn compatiblity depended on an error type it would not actually show, so this is PR is actually silencing independent errors, too.

I am opening this PR because I am seeing lots of `{type error}: const Trait` errors when adding more const checking. So instead of targetting just those specific errors, I wanted to try out fully avoiding such errors near the trait solver.

cc ````@rust-lang/types```` for thoughts
2025-11-02 09:10:38 +01:00
lcnr 5cbb5d0ac6 rename OpaqueHiddenType 2025-10-31 14:53:03 +01:00
Oli Scherer cac6f8760a Do not emit solver errors that contain error types 2025-10-31 08:17:44 +00:00
Boxy Uwu 8e9b0c4ca9 rename select_where_possible and select_all_or_error 2025-10-07 23:02:23 +01:00
bors 4b9c62b4da Auto merge of #147138 - jackh726:split-canonical-bound, r=lcnr
Split Bound index into Canonical and Bound

See [#t-types/trait-system-refactor > perf &#96;async-closures/post-mono-higher-ranked-hang.rs&#96;](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context

Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run.

r? lcnr
2025-10-02 08:09:33 +00:00
Stuart Cook d4a0f21290 Rollup merge of #147199 - jdonszelmann:outdated-comment-infctx, r=lcnr
remove outdated comment in (inner) `InferCtxt`

This comment seems to have stopped being relevant around 3 years ago after https://github.com/rust-lang/rust/commit/9f95c605f83bcf4c158ea4b3fd5a7abb825a4178. A map? what map? :P

r? `@lcnr`
2025-10-01 22:15:01 +10:00
Jana Dönszelmann bdebd479ac remove outdated context (inner) infctx 2025-09-30 21:56:06 +02:00
Jana Dönszelmann 80e598bb12 clone region obligations instead of taking in implied bounds hack 2025-09-30 21:48:55 +02:00
jackh726 d1bbd39c59 Split Bound into Canonical and Bound 2025-09-30 12:58:28 -04:00