about summary refs log tree commit diff
path: root/compiler/rustc_infer/src/traits
AgeCommit message (Collapse)AuthorLines
2025-09-15Add documentation for select_where_possible and select_all_or_errortiif-1/+16
2025-06-26Rollup merge of #142647 - compiler-errors:less-work-in-coherence, r=lcnrMichael Goulet-1/+2
[perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation First compute hard errors without diagnostics, then ambiguities with diagnostics since we need to know if any of them overflowed.
2025-06-25Remove some glob imports from the type systemMichael Goulet-2/+0
2025-06-25Compute hard errors without diagnostics in ↵Michael Goulet-1/+2
impl_intersection_has_impossible_obligation
2025-05-02Use less rustc_type_ir in the compiler codebaseRomain Perier-1/+1
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-04-22Properly drain pending obligations for coroutinesMichael Goulet-1/+1
2025-04-14Derive Obligation's fold implsMichael Goulet-32/+7
2025-03-23Obligation::as_goalMichael Goulet-6/+6
2025-03-15Fold visit into tyMichael Goulet-2/+3
2025-03-15Squash fold into tyMichael Goulet-2/+1
2025-02-19Make fewer crates depend on rustc_ast_irMichael Goulet-2/+1
2025-02-08Rustfmtbjorn3-10/+13
2025-01-18Get rid of `ToPolyTraitRef`Michael Goulet-3/+3
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-2/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-02Assert that obligations are empty before deeply normalizingMichael Goulet-0/+2
2024-10-12Swap PredicateObligation to ThinVecGnomedDev-1/+2
2024-10-12Swap Vec<PredicateObligation> to type aliasGnomedDev-8/+10
2024-10-08Improve formatting of some comments.Nicholas Nethercote-30/+23
I.e. fixing comments lines that are too long or too short.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-16/+13
2024-08-31Rollup merge of #129767 - nnethercote:rm-extern-crate-tracing-4, r=jieyouxuMatthias Krüger-0/+1
Remove `#[macro_use] extern crate tracing`, round 4 Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via #[macro_use]. Continuing the work from #124511, #124914, and #125434. After this PR no `rustc_*` crates use `#[macro_use] extern crate tracing` except for `rustc_codegen_gcc` which is a special case and I will do separately. r? ```@jieyouxu```
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_infer`.Nicholas Nethercote-0/+1
2024-08-29Stop using ty::GenericPredicates for non-predicates_of queriesMichael Goulet-1/+1
2024-08-27Add `warn(unreachable_pub)` to `rustc_infer`.Nicholas Nethercote-2/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-25/+20
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-21Move all error reporting into rustc_trait_selectionMichael Goulet-204/+0
2024-07-21Move some stuff to TypeErrCtxtMichael Goulet-4/+4
2024-07-18Revert "sort suggestions for object diagnostic"Michael Goulet-2/+1
This reverts commit 540be28f6c2571e7be3ab3936b62635fa0d3caf3.
2024-07-07Uplift elaborationMichael Goulet-345/+4
2024-07-06Rollup merge of #127386 - compiler-errors:uplift-outlives-components, r=lcnrMichael Goulet-1/+1
Uplift outlives components to `rustc_type_ir` We need this to uplift `push_outlives_components`, since the elaborator uses `push_outlives_components` to elaborate type outlives obligations and I want to uplift elaboration. This ends up reworking and inlining a fair portion of the `GenericArg::walk_shallow` function, whose only callsite was this one. I believe I got the logic correct, but may be worthwhile to look at it closely just in case. Unfortunately github was too dumb to understand that this is a rename + change -- I could also rework the git history to split the "copy the file over" part from the actual logical changes if that makes this easier to review. r? lcnr
2024-07-06Import via rustc_type_ir::outlivesMichael Goulet-1/+1
We could use rustc_middle::ty::outlives I guess?
2024-07-05Split out transitive_bounds_that_define_assoc_itemMichael Goulet-14/+25
2024-07-05Supertrait elaboration doesn't need to use PredicatesMichael Goulet-5/+5
2024-07-01Auto merge of #126996 - oli-obk:do_not_count_errors, r=nnethercotebors-4/+4
Automatically taint InferCtxt when errors are emitted r? `@nnethercote` Basically `InferCtxt::dcx` now returns a `DiagCtxt` that refers back to the `Cell<Option<ErrorGuaranteed>>` of the `InferCtxt` and thus when invoking `Diag::emit`, and the diagnostic is an error, we taint the `InferCtxt` directly. That change on its own has no effect at all, because `InferCtxt` already tracks whether errors have been emitted by recording the global error count when it gets opened, and checking at the end whether the count changed. So I removed that error count check, which had a bit of fallout that I immediately fixed by invoking `InferCtxt::dcx` instead of `TyCtxt::dcx` in a bunch of places. The remaining new errors are because an error was reported in another query, and never bubbled up. I think they are minor enough for this to be ok, and sometimes it actually improves diagnostics, by not silencing useful diagnostics anymore. fixes #126485 (cc `@olafes)` There are more improvements we can do (like tainting in hir ty lowering), but I would rather do that in follow up PRs, because it requires some refactorings.
2024-06-27Make queries more explicitMichael Goulet-4/+4
2024-06-26Automatically taint InferCtxt when errors are emittedOli Scherer-4/+4
2024-06-12Stop passing traitref/traitpredicate by refMichael Goulet-2/+1
2024-06-11Get rid of PredicateObligationsMichael Goulet-2/+0
2024-06-03Nits and formattingMichael Goulet-7/+28
2024-06-03Move FulfillmentErrorCode to rustc_trait_selection tooMichael Goulet-41/+1
2024-06-03Make TraitEngines generic over errorMichael Goulet-43/+16
2024-06-03Remove unnecessary extension traitMichael Goulet-21/+17
2024-05-18Uplift GenericArgKind, CanonicalVarValues, QueryInputMichael Goulet-2/+2
and make NestedGoals generic
2024-05-17to_opt_poly_X_pred -> as_X_clauseMichael Goulet-1/+1
2024-05-16Remove trivial Binder::dummy callsMichael Goulet-1/+1
2024-05-16Uplift Goal to rustc_type_irMichael Goulet-6/+10
2024-05-16Make P parameter explicitMichael Goulet-3/+1
2024-05-16Rename ToPredicate for UpcastMichael Goulet-17/+13
2024-05-13Apply nitsMichael Goulet-5/+8
2024-05-13split out AliasTy -> AliasTermMichael Goulet-12/+8
2024-05-10More rename falloutMichael Goulet-2/+2