summary refs log tree commit diff
path: root/compiler/rustc_next_trait_solver/src
AgeCommit message (Collapse)AuthorLines
2025-06-22Rollup merge of #142617 - lcnr:search_graph-3, r=compiler-errorsJacob Pratt-1/+1
improve search graph docs, reset `encountered_overflow` between reruns I think this shouldn't really matter for now. It will be more relevant for my current rework as we otherwise cannot partially reevaluate the root goal in case there has been overflow during the prervious iteration. r? ````@BoxyUwU````
2025-06-18`evaluate_goal`: accept different inputslcnr-1/+1
2025-06-18Implement lint against direct uses of rustc_type_ir in compiler cratesRomain Perier-0/+1
This commit adds a lint to prevent the use of rustc_type_ir in random compiler crates, except for type system internals traits, which are explicitly allowed. Moreover, this fixes diagnostic_items() to include the CRATE_OWNER_ID, otherwise rustc_diagnostic_item attribute is ignored on the crate root.
2025-06-16trait_sel: skip elaboration of sizedness supertraitDavid Wood-4/+47
As a performance optimization, skip elaborating the supertraits of `Sized`, and if a `MetaSized` obligation is being checked, then look for a `Sized` predicate in the parameter environment. This makes the `ParamEnv` smaller which should improve compiler performance as it avoids all the iteration over the larger `ParamEnv`.
2025-06-16trait_sel: `{Meta,Pointee}Sized` on `?Sized` typesDavid Wood-111/+60
Expand the automatic implementation of `MetaSized` and `PointeeSized` so that it is also implemented on non-`Sized` types, just not `ty::Foreign` (extern type).
2025-06-16trait_sel: `{Meta,Pointee}Sized` on `Sized` typesDavid Wood-0/+82
Introduce the `MetaSized` and `PointeeSized` traits as supertraits of `Sized` and initially implement it on everything that currently implements `Sized` to isolate any changes that simply adding the traits introduces.
2025-06-13TypeVisiting binders no longer requires TypeFolding its interiorMichael Goulet-1/+1
2025-06-13Replace escaping bound vars in ty/ct visiting, not binder visitingMichael Goulet-12/+44
2025-06-13Uplift BoundVarReplacerMichael Goulet-0/+159
2025-06-13Make connection between Placeholder and Bound a bit more clear in the type ↵Michael Goulet-4/+4
abstraction
2025-06-11Auto merge of #141763 - lcnr:fixme-gamer, r=BoxyUwUbors-3/+10
`FIXME(-Znext-solver)` triage r? `@BoxyUwU`
2025-06-08add `param_env` cache to canonicalizationlcnr-14/+60
2025-06-08move `canonicalize_param_env` into sub-fnlcnr-25/+30
2025-06-06Filter out universals and lifetimes from stalled_varsMichael Goulet-1/+12
2025-06-03`FIXME(-Znext-solver)` triagelcnr-3/+10
Co-authored-by: Michael Goulet <michael@errs.io>
2025-06-01Auto merge of #141731 - compiler-errors:tweak-fast-path-trait, r=lcnrbors-7/+8
Tweak fast path trait handling (1.) Make it more sound by considering polarity (lol) (2.) Make it more general, by considering higher-ranked size/copy/clone (2.) Make it less observable, by only doing copy/clone fast path if there are no regions involved r? lcnr
2025-05-30Auto merge of #141651 - compiler-errors:less-assert, r=lcnrbors-11/+12
Make some assertions in solver into debug assertions These may or may not be expensive :> r? lcnr
2025-05-29Tweak fast path trait handlingMichael Goulet-7/+8
2025-05-29Auto merge of #141581 - lcnr:fold-clauses, r=compiler-errorsbors-8/+50
add additional `TypeFlags` fast paths Some crates, e.g. `diesel`, have items with a lot of where-clauses (more than 150). In these cases checking the `TypeFlags` of the whole `param_env` can be very beneficial. This adds `fn fold_clauses` to mirror the existing `fn visit_clauses` and then uses this in folders which fold `ParamEnv`s. Split out from rust-lang/rust#141451, depends on rust-lang/rust#141442. r? `@compiler-errors`
2025-05-27Make some assertions in solver into debug assertionsMichael Goulet-11/+12
2025-05-27Fix some var namesMichael Goulet-2/+2
2025-05-26Auto merge of #141605 - jieyouxu:rollup-3gjqh5l, r=jieyouxubors-1/+1
Rollup of 10 pull requests Successful merges: - rust-lang/rust#140898 (minor improvements on running miri) - rust-lang/rust#141392 (Avoid obligation construction dance with query region constraints) - rust-lang/rust#141431 (Emit dummy open drop for unsafe binder) - rust-lang/rust#141433 (Properly analyze captures from unsafe binders) - rust-lang/rust#141439 (Deduplicate dyn compatibility violations due to coercion) - rust-lang/rust#141449 (further deduplicate ast visitor code) - rust-lang/rust#141513 (interpret: add allocation parameters to `AllocBytes`) - rust-lang/rust#141516 (speed up charsearcher for ascii chars) - rust-lang/rust#141526 (add a dedicated section for compiler environment variables in the unstable book) - rust-lang/rust#141550 (Fix `unused_braces` lint suggestion when encountering attributes) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-26assert we never incorrectly canonicalize envslcnr-0/+7
2025-05-26add additional `TypeFlags` fast pathslcnr-8/+43
2025-05-27Rollup merge of #141392 - compiler-errors:query-outlives, r=lcnr许杰友 Jieyou Xu (Joe)-1/+1
Avoid obligation construction dance with query region constraints And some renaming...
2025-05-26Auto merge of #141500 - compiler-errors:rerun-cache-2, r=lcnrbors-31/+132
Don't rerun goals if none of their vars have changed r? `@ghost` Alternative to rust-lang/rust#141488. I'm pretty sure that we don't need to re-run the goal at all if the inputs don't change... 🤔
2025-05-26Don't rerun goals if none of its vars have changedMichael Goulet-31/+132
2025-05-26RenameMichael Goulet-1/+1
2025-05-25Do not canonicalize in new solver if it has nothing to canonicalizeMichael Goulet-8/+55
2025-05-23yeet `CanonicalVarInfo`lcnr-40/+41
2025-05-22Auto merge of #141396 - matthiaskrgr:rollup-feg050g, r=matthiaskrgrbors-2/+2
Rollup of 7 pull requests Successful merges: - #135562 (Add ignore value suggestion in closure body) - #139635 (Finalize repeat expr inference behaviour with inferred repeat counts) - #139668 (Handle regions equivalent to 'static in non_local_bounds) - #140218 (HIR ty lowering: Clean up & refactor the lowering of type-relative paths) - #140435 (use uX::from instead of _ as uX in non - const contexts) - #141130 (rustc_on_unimplemented cleanups) - #141286 (Querify `coroutine_hidden_types`) Failed merges: - #140247 (Don't build `ParamEnv` and do trait solving in `ItemCtxt`s when lowering IATs) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-22Auto merge of #141397 - matthiaskrgr:rollup-l9uu6g6, r=matthiaskrgrbors-1/+1
Rollup of 8 pull requests Successful merges: - #141355 (ci: improve citool job db errors) - #141359 (Fix `FnOnce` impl for `AsyncFn`/`AsyncFnMut` self-borrowing closures in new solver) - #141362 (Normalize aliases to correct kind of error term) - #141377 (Remove unnecessary `is_empty` checks) - #141381 (try_cast_aligned: avoid bare int-to-ptr casts) - #141382 (ci: convert distcheck to free runner) - #141389 (ci: prepare aws access keys for migration) - #141390 (Don't allow `poly_select` in new solver) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-22Rollup merge of #141359 - compiler-errors:async-fn-once, r=lcnrMatthias Krüger-1/+1
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-22Rollup merge of #141286 - compiler-errors:querify-coroutine, r=oli-obkMatthias Krüger-2/+2
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-22Auto merge of #141135 - compiler-errors:fast-path-2, r=lcnrbors-4/+23
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-21Fix FnOnce impl for AsyncFn/AsyncFnMut closures in new solverMichael Goulet-1/+1
2025-05-21fix better_any breakage by making the solver more unsoundlcnr-2/+42
2025-05-20Querify coroutine_hidden_typesMichael Goulet-2/+2
2025-05-18Fast path for processing some obligations in the new solverMichael Goulet-4/+23
2025-05-15Rollup merge of #140712 - lcnr:normalization-gat-args, r=compiler-errorsMatthias Krüger-27/+61
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-12Fix typosomahs-1/+1
2025-05-08refactor `probe_and_consider_param_env_candidate`lcnr-15/+14
2025-05-08normalization: avoid incompletely constraining GAT argslcnr-19/+54
2025-05-08Rollup merge of #140711 - compiler-errors:combine-maybes, r=lcnrMatthias Krüger-14/+19
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-08Rollup merge of #140641 - lcnr:opaque-type-storage-entries, r=compiler-errorsMatthias Krüger-76/+44
detect additional uses of opaques after writeback Based on #140607. It's a lot harder to encounter in practice than I though :sweat_smile: :grin: 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-07detect additional uses of opaques after writebacklcnr-54/+44
2025-05-07opaque_type_storage to InferCtxtLikelcnr-22/+0
2025-05-07Use MaybeCause::or to allow constraints from overflows if they are combined ↵Michael Goulet-14/+19
with ambiguity
2025-05-07ReviewMichael Goulet-21/+27
2025-05-07Only prefer param-env candidates if they remain non-global after normMichael Goulet-125/+243