about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/infer.rs
AgeCommit message (Collapse)AuthorLines
2023-12-12more clippy::complexity fixesMatthias Krüger-2/+1
redundant_guards redundant_slicing filter_next needless_borrowed_reference useless_format
2023-12-06EvaluatedToUnknown -> EvaluatedToAmbigStackDependent, EvaluatedToRecur -> ↵Michael Goulet-1/+1
EvaluatedToErrStackDependent
2023-12-04Deduplicate some logicEsteban Küber-0/+72
2023-08-02Remove constness from `TraitPredicate`Deadbeef-1/+1
2023-07-14allow opaques to be defined by trait queriesAli MJ Al-Nasrawy-5/+6
2023-05-25Fallible<_> -> Result<_, NoSolution>Michael Goulet-5/+5
2023-05-04Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnrbors-1/+1
Replace `tcx.mk_trait_ref` with `TraitRef::new` First step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
2023-04-27rename `needs_infer` to `has_infer`Boxy-1/+1
2023-04-25Replace `tcx.mk_trait_ref` with `ty::TraitRef::new`Maybe Waffle-1/+1
2023-03-21remove some trait solver helperslcnr-27/+8
they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
2023-02-23Rollup merge of #108350 - compiler-errors:assoc-type-bound-dogfooding, r=oli-obkMatthias Krüger-2/+2
Use associated type bounds in some places in the compiler Use associated type bounds for some nested `impl Trait<Assoc = impl Trait2>` cases. I'm generally keen to introduce new lang features that are more mature into the compiler, but maybe let's see what others think? Side-note: I was surprised that the only use-cases of nested impl trait in the compiler are just iterator related?!
2023-02-22Remove type-traversal trait aliasesAlan Egerton-6/+6
2023-02-21Associated type bounds in some places in the compilerMichael Goulet-2/+2
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-1/+1
2023-01-03Simplify some canonical type alias namesMichael Goulet-3/+3
2022-11-28partially_normalize_... -> At::normalizeMichael Goulet-28/+0
2022-11-21Stop passing the self-type as a separate argument.Oli Scherer-10/+6
2022-11-21Remove a redundant assertOli Scherer-6/+0
2022-11-21Assert that various types have the right amount of generic args and fix the ↵Oli Scherer-4/+1
sites that used the wrong amount
2022-11-21Check that type_implements_trait actually is passed the right amount of ↵Oli Scherer-3/+11
generic params
2022-11-04Some tracing and comment cleanupsOli Scherer-10/+2
2022-11-01Auto merge of #103590 - compiler-errors:ocx-more, r=lcnrbors-7/+7
(almost) Always use `ObligationCtxt` when dealing with canonical queries Hope this is a step in the right direction. cc rust-lang/types-team#50. r? `@lcnr`
2022-10-27(almost) Always use ObligationCtxt when dealing with canonical queriesMichael Goulet-7/+7
2022-10-27Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functionsMaybe Waffle-1/+1
Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions`
2022-10-07Change InferCtxtBuilder from enter to buildCameron Steffen-13/+5
2022-10-07Remove TypeckResults from InferCtxtCameron Steffen-3/+3
2022-09-05Point out when a callable is not actually callable because its return is not ↵Michael Goulet-0/+17
sized
2022-07-06Update TypeVisitor pathsAlan Egerton-1/+1
2021-12-12Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"Deadbeef-1/+0
This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.
2021-12-03Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino"Santiago Pastorino-0/+1
This reverts commit 18bb8c61a975fff6424cda831ace5b0404277145, reversing changes made to d9baa361902b172be716f96619b909f340802dea.
2021-11-29Completely remove ConstnessAndOli Scherer-1/+0
2021-10-15Move some outlives bounds things from rustc_trait_selection to rustc_typeckjackh726-49/+0
2021-09-15Remove ToPredicate impls that use Binder::dummyjackh726-1/+1
2021-09-09Use FxHashSet instead of Vec for well formed tysjackh726-3/+4
2021-08-25trailing whitespaceNiko Matsakis-1/+1
2021-08-25update docs for `type_implements_trait`Niko Matsakis-0/+4
2021-08-25type_implements_trait consider obligation failure on overflowAman Arora-1/+1
2021-07-16Add initial implementation of HIR-based WF checking for diagnosticsAaron Hill-5/+2
During well-formed checking, we walk through all types 'nested' in generic arguments. For example, WF-checking `Option<MyStruct<u8>>` will cause us to check `MyStruct<u8>` and `u8`. However, this is done on a `rustc_middle::ty::Ty`, which has no span information. As a result, any errors that occur will have a very general span (e.g. the definintion of an associated item). This becomes a problem when macros are involved. In general, an associated type like `type MyType = Option<MyStruct<u8>>;` may have completely different spans for each nested type in the HIR. Using the span of the entire associated item might end up pointing to a macro invocation, even though a user-provided span is available in one of the nested types. This PR adds a framework for HIR-based well formed checking. This check is only run during error reporting, and is used to obtain a more precise span for an existing error. This is accomplished by individually checking each 'nested' type in the HIR for the type, allowing us to find the most-specific type (and span) that produces a given error. The majority of the changes are to the error-reporting code. However, some of the general trait code is modified to pass through more information. Since this has no soundness implications, I've implemented a minimal version to begin with, which can be extended over time. In particular, this only works for HIR items with a corresponding `DefId` (e.g. it will not work for WF-checking performed within function bodies).
2021-07-06Make type_implements_trait not a queryAman Arora-1/+44
2021-03-18Fix use of bare trait objects everywhereVadim Petrochenkov-1/+1
2020-12-29Remove `compile-fail` test suiteVadim Petrochenkov-1/+1
2020-11-16compiler: fold by valueBastian Kauschke-4/+4
2020-08-30mv compiler to compiler/mark-0/+182