summary refs log tree commit diff
path: root/compiler/rustc_next_trait_solver/src
AgeCommit message (Collapse)AuthorLines
2025-03-26Implement lint against using Interner and InferCtxtLike in random compiler ↵Michael Goulet-0/+1
crates
2025-03-24Allow WellFormed goals to be returned from relating in new solverMichael Goulet-7/+9
2025-03-20Do not rely on type_var_origin in OrphanCheckErr::NonLocalInputTypeMichael Goulet-1/+4
2025-03-15Use {Decodable,Encodable}_NoContext in type_irMichael Goulet-2/+5
2025-03-15Fold visit into tyMichael Goulet-11/+12
2025-03-15Squash fold into tyMichael Goulet-16/+18
2025-03-12Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, ↵Matthias Krüger-1/+0
r=onur-ozkan,jieyouxu Use `RUSTC_LINT_FLAGS` more An alternative to the failed #138084. Fixes #138106. r? ````@jieyouxu````
2025-03-12Rollup merge of #137314 - lcnr:cycles-with-unknown-kind, r=compiler-errorsMatthias Krüger-20/+70
change definitely unproductive cycles to error builds on top of #136824 by adding a third variant to `PathKind` for paths which may change to be coinductive in the future but must not be so right now. Most notably, impl where-clauses of not yet coinductive traits. With this, we can change cycles which are definitely unproductive to a proper error. This fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/114. This does not affect stable as we keep these cycles as ambiguous during coherence. r? ````````@compiler-errors```````` ````````@nikomatsakis````````
2025-03-11Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-0/+1
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). This breakage was reported in <https://github.com/rust-lang/rust/issues/138304>. This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-08Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
(Except for `rustc_codegen_cranelift`.) It's no longer necessary now that `unreachable_pub` is in the workspace lints.
2025-03-05Rollup merge of #137728 - Darksonn:no-tuple-unsize, r=oli-obk许杰友 Jieyou Xu (Joe)-49/+0
Remove unsizing coercions for tuples See https://github.com/rust-lang/rust/issues/42877#issuecomment-2686010847 and below comments for justification. Tracking issue: #42877 Fixes: #135217
2025-03-05keep inductive cycles as ambig in coherencelcnr-2/+18
2025-03-05change definitely non-productive cycles to errorlcnr-19/+53
2025-03-01Rollup merge of #137776 - nnethercote:rustc_transmute-cleanups, r=jswrennMatthias Krüger-4/+1
Some `rustc_transmute` cleanups A number of small things that can be removed. r? ``@jswrenn``
2025-03-01Rollup merge of #137689 - compiler-errors:coroutine, r=lcnrMatthias Krüger-50/+40
Use `Binder<Vec<Ty>>` instead of `Vec<Binder<Ty>>` in both solvers for sized/auto traits/etc. It's more conceptually justified IMO, especially when binders get implications. r? lcnr
2025-02-28reviewlcnr-0/+15
2025-02-28normalizing where-clauses is also coinductive, add testslcnr-8/+25
2025-02-28fix typolcnr-1/+1
2025-02-28rework cycle handlinglcnr-47/+90
A cycle was previously coinductive if all steps were coinductive. Change this to instead considerm cycles to be coinductive if they step through at least one where-bound of an impl of a coinductive trait goal.
2025-02-28Remove `allow(unused_variables)` for `rustc_transmute`.Nicholas Nethercote-4/+1
This was hiding some genuine sins, including unused arguments in numerous functions/methods (incl. trait methods), and some unnecessary computation.
2025-02-27Delete tuple unsizingAlice Ryhl-49/+0
2025-02-26Use bound_coroutine_witnesses in old solverMichael Goulet-2/+2
2025-02-26Use Binder<Vec<T>> instead of Vec<Binder<T>> in new solverMichael Goulet-48/+38
2025-02-21Make sure we don't overrun the stack in canonicalizerMichael Goulet-2/+2
2025-02-19Make fewer crates depend on rustc_ast_irMichael Goulet-4/+4
2025-02-18Auto merge of #137235 - matthiaskrgr:rollup-2kjua2t, r=matthiaskrgrbors-8/+29
Rollup of 10 pull requests Successful merges: - #135711 (Do not ICE on default_field_value const with lifetimes) - #136599 (librustdoc: more usages of `Joined::joined`) - #136876 (Locking documentation updates) - #137000 (Deeply normalize item bounds in new solver) - #137126 (fix docs for inherent str constructors) - #137161 (Pattern Migration 2024: fix incorrect messages/suggestions when errors arise in macro expansions) - #137191 (Update mdbook and move error_index_generator) - #137203 (Improve MIR modification) - #137206 (Make E0599 a structured error) - #137218 (misc `layout_of` cleanup) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-18don't ICE for alias-relate goals with error termlcnr-1/+11
2025-02-17Prefer param-env candidates even when alias's trait bound isn't proven via ↵Michael Goulet-8/+29
param-env
2025-02-13adjust derive_errorlcnr-20/+0
2025-02-13rework pointee handling for the new rigid alias approachlcnr-67/+79
2025-02-13normalizes-to rework rigid alias handlinglcnr-93/+76
2025-02-13Use BikeshedGuaranteedNotDrop in unsafe binder type WF tooMichael Goulet-1/+1
2025-02-13Implement and use BikeshedGuaranteedNoDrop for union/unsafe field validityMichael Goulet-0/+117
2025-02-08Rustfmtbjorn3-61/+89
2025-02-07Rollup merge of #136664 - WaffleLapkin:un-map_or-true, r=compiler-errorsMatthias Krüger-1/+1
replace one `.map_or(true, ...)` with `.is_none_or(...)` Randomly found while going through some of my old branches.
2025-02-06replace one `.map_or(true, ...)` with `.is_none_or(...)`Waffle Lapkin-1/+1
2025-02-06Rollup merge of #136069 - yotamofek:next-solver-slice, r=compiler-errorsMatthias Krüger-7/+5
Simplify slice indexing in next trait solver Unless I'm missing something: - no need to explicitly specify the end of the slice as the end of the index range - the `assert` is redundant since the indexing will panic for the same condition I think this change simplifies it a bit. Also replaced the `for` loop of `push`es with a call to `extend` with an iterator. Might improve performance since it knows how many elements will be added beforehand and can pre-reserve room? r? `@compiler-errors` , I think
2025-02-05Pass spans around new solverMichael Goulet-22/+56
2025-02-05Remove span from delegateMichael Goulet-4/+2
2025-01-30introduce `ty::Value`Lukas Markeffsky-5/+3
Co-authored-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
2025-01-28Do not assume child bound assumptions for rigid aliasMichael Goulet-14/+49
2025-01-25Simplify slice indexing in next trait solverYotam Ofek-7/+5
2025-01-23Rollup merge of #135766 - lcnr:candidate-assembly-3, r=compiler-errorsMatthias Krüger-20/+28
handle global trait bounds defining assoc types This also fixes the compare-mode for - tests/ui/coherence/coherent-due-to-fulfill.rs - tests/ui/codegen/mono-impossible-2.rs - tests/ui/trivial-bounds/trivial-bounds-inconsistent-projection.rs - tests/ui/nll/issue-61320-normalize.rs I first considered the alternative to always prefer where-bounds during normalization, regardless of how the trait goal has been proven by changing `fn merge_candidates` instead. https://github.com/rust-lang/rust/blob/ecda83b30f0f68cf5692855dddc0bc38ee8863fc/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs#L785 This approach is more restrictive than behavior of the old solver to avoid mismatches between trait and normalization goals. This may be breaking in case the where-bound adds unnecessary region constraints and we currently don't ever try to normalize an associated type. I would like to detect these cases and change the approach to exactly match the old solver if required. I want to minimize cases where attempting to normalize in more places causes code to break. r? `@compiler-errors`
2025-01-22Use `structurally_normalize` instead of manual `normalizes-to` goalsBoxy-23/+19
2025-01-20handle global trait bounds defining assoc typelcnr-2/+22
2025-01-20remove unnecessary collectionlcnr-18/+6
2025-01-19Run `clippy --fix` for `unnecessary_map_or` lintYotam Ofek-1/+1
2025-01-17new solver: prefer trivial builtin impls over where-clausesRémy Rakic-2/+26
for now, only builtin `Sized` impls are tracked as being `Trivial`
2025-01-14Prefer lower TraitUpcasting candidatesMichael Goulet-3/+5