about summary refs log tree commit diff
path: root/src/librustc_trait_selection/traits/mod.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-563/+0
2020-08-20Don't immediately error for cycles during normalizationMatthew Jasper-3/+1
2020-07-27introduce PredicateAtomBastian Kauschke-2/+2
2020-07-27this might be unqualified, but at least it's now quantifiedBastian Kauschke-1/+1
2020-07-27split ignore_qualifiersBastian Kauschke-2/+2
2020-07-27`PredicateKint` -> `PredicateKind`, the beginning of the endBastian Kauschke-2/+2
2020-07-20trait_sel: only test predicates w/ no substsDavid Wood-15/+15
This commit modifies the `substitute_normalize_and_test_predicates` query, renaming it to `impossible_predicates` and only checking predicates which do not require substs. By making this change, polymorphization doesn't have to explicitly support vtables. Signed-off-by: David Wood <david@davidtw.co>
2020-07-09Rollup merge of #74070 - eddyb:forall-tcx-providers, r=nikomatsakisManish Goregaokar-1/+1
Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>. In order to work around normalization-under-HRTB (for `provide!` in `rustc_metadata`), we ended up with this: ```rust struct Providers<'tcx> { type_of: fn(TyCtxt<'tcx>, DefId) -> Ty<'tcx>, // ... } ``` But what I initially wanted to do, IIRC, was this: ```rust struct Providers { type_of: for<'tcx> fn(TyCtxt<'tcx>, DefId) -> Ty<'tcx>, // ... } ``` This PR moves to the latter, for the simple reason that only the latter allows keeping a `Providers` value, or a subset of its `fn` pointer fields, around in a `static` or `thread_local!`, which can be really useful for custom drivers that override queries. (@jyn514 and I came across a concrete usecase of that in `rustdoc`) The `provide!` macro in `rustc_metadata` is fixed by making the query key/value types available as type aliases under `ty::query::query_{keys,values}`, not just associated types (this is the first commit). r? @nikomatsakis
2020-07-05Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>.Eduard-Mihai Burtescu-1/+1
2020-07-05Shrink ParamEnv to 16 bytesMark Rousskov-4/+4
2020-06-12Make `type_marked_structural` privateDylan MacKenzie-1/+0
2020-06-12Helper method for whether type has structural equalityDylan MacKenzie-0/+1
This helper method works for all types, falling back to a query for `TyKind::Adt`s to determine whether the implement the `{Partial,}StructuralEq` traits.
2020-06-05Rename traits::Vtable to ImplSource.Ana-Maria Mihalache-1/+1
2020-05-30Return early to avoid ICEYuki Okushi-7/+0
2020-05-28Auto merge of #72494 - lcnr:predicate-cleanup, r=nikomatsakisbors-1/+1
Pass more `Copy` types by value. There are a lot of locations where we pass `&T where T: Copy` by reference, which should both be slightly less performant and less readable IMO. This PR currently consists of three fairly self contained commits: - passes `ty::Predicate` by value and stops depending on `AsRef<ty::Predicate>`. - changes `<&List<_>>::into_iter` to iterate over the elements by value. This would break `List`s of non copy types. But as the only list constructor requires `T` to be copy anyways, I think the improved readability is worth this potential future restriction. - passes `mir::PlaceElem` by value. Mir currently has quite a few copy types which are passed by reference, e.g. `Local`. As I don't have a lot of experience working with MIR, I mostly did this to get some feedback from people who use MIR more frequently - tries to reuse `ty::Predicate` in case it did not change in some places, which should hopefully fix the regression caused by #72055 r? @nikomatsakis for the first commit, which continues the work of #72055 and makes adding `PredicateKind::ForAll` slightly more pleasant. Feel free to reassign though
2020-05-23iterate List by valueBastian Kauschke-1/+1
2020-05-22Remove dead ScopeTree codeMatthew Jasper-4/+0
2020-05-20introduce newtype'd `Predicate<'tcx>`Bastian Kauschke-1/+1
2020-05-20make `to_predicate` take a `tcx` argumentNiko Matsakis-2/+2
2020-05-20rename `Predicate` to `PredicateKind`, introduce aliasBastian Kauschke-1/+1
2020-05-15implement type_implments_trait querycsmoe-1/+41
2020-05-07Reintegrate chalk using chalk-solveJack Huey-0/+3
2020-04-20Use more `Iterator`s instead of `Vec`sEsteban Küber-2/+2
2020-04-20Remove some `Vec` allocations in an effort to improve perfEsteban Küber-1/+1
2020-04-14Rename AssocKind::Method to AssocKind::FnRustin-Liu-1/+1
Rename fn_has_self_argument to fn_has_self_parameter Rename AssocItemKind::Method to AssocItemKind::Fn Refine has_no_input_arg Refine has_no_input_arg Revert has_no_input_arg Refine suggestion_descr Move as_def_kind into AssocKind Signed-off-by: Rustin-Liu <rustin.liu@gmail.com> Fix tidy check issue Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
2020-04-12Remove usage of `DUMMY_HIR_ID` in calls to `ObligationClause::misc`marmeladema-3/+3
Use `ObligationClause::dummy()` when appropriate or replace `hir::DUMMY_HIR_ID` by `hir::CRATE_HIR_ID`, as used in `ObligationClause::dummy()`.
2020-04-10Rollup merge of #69745 - estebank:predicate-obligations-3, r=nikomatsakis,eddybMazdak Farrokhzad-1/+3
Use `PredicateObligation`s instead of `Predicate`s Keep more information about trait binding failures. Use more specific spans by pointing at bindings that introduce obligations. Subset of #69709. r? @eddyb
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-1/+3
Keep more information about trait binding failures.
2020-04-08do_normalize_predicates: add delay_span_bugBastian Kauschke-1/+1
2020-04-08replace `has_local_value` with `needs_infer`Bastian Kauschke-1/+1
2020-04-02use direct import for ErrorReportedMazdak Farrokhzad-1/+1
2020-03-30Sync `Instance::resolve` with the projection codeJonas Schievink-1/+0
2020-03-30spec. graph: track defining and finalizing implsJonas Schievink-2/+1
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-2/+2
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-5/+5
2020-03-17Erase regions in writebackMatthew Jasper-2/+2
Also skip duplicated region solving entirely with `-Zborrowck=mir`.
2020-03-14Split librustc_infer.Camille GILLOT-117/+4
2020-03-14Move rustc_infer::traits to new crate rustc_trait_selection.Camille GILLOT-0/+646