about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/infer.rs
AgeCommit message (Collapse)AuthorLines
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