summary refs log tree commit diff
path: root/src/librustc_ty
AgeCommit message (Collapse)AuthorLines
2020-05-28standardize limit comparisons with `Limit` typeDavid Wood-2/+3
This commit introduces a `Limit` type which is used to ensure that all comparisons against limits within the compiler are consistent (which can result in ICEs if they aren't). Signed-off-by: David Wood <david@davidtw.co>
2020-05-23iterate List by valueBastian Kauschke-1/+1
2020-05-22Use `OnceCell` instead of `Once`Dylan MacKenzie-2/+1
2020-05-21Rollup merge of #72055 - lcnr:predicate-kind, r=nikomatsakisRalf Jung-1/+1
Intern predicates Implements the first step of https://github.com/rust-lang/compiler-team/issues/285 Renames `ty::Predicate` to `ty::PredicateKind`, which is now interned. To ease the transition, `ty::Predicate` is now a struct containing a reference to `ty::PredicateKind`. r? @ghost
2020-05-20make `to_predicate` take a `tcx` argumentNiko Matsakis-1/+1
2020-05-19auto impl`DiscriminantKind` for every typeBastian Kauschke-1/+4
2020-05-12Remove ty::UnnormalizedProjectionJack Huey-2/+0
2020-05-07Reintegrate chalk using chalk-solveJack Huey-2/+5
2020-05-02fix rustdoc warningsTshepang Lekhonkhobe-1/+1
2020-04-28Move a few queries to using an arena.Camille GILLOT-1/+1
2020-04-28Use the query system to allocate.Camille GILLOT-2/+2
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-5/+5
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-10/+10
2020-04-23librustc_middle: return LocalDefId instead of DefId in local_def_idmarmeladema-9/+9
2020-04-22Rollup merge of #70970 - eddyb:trait-vs-impl-mismatch, r=oli-obkDylan DPC-15/+58
Detect mistyped associated consts in `Instance::resolve`. *Based on #71049 to prevent redundant/misleading downstream errors.* Fixes #70942 by refusing to resolve an associated `const` if it doesn't have the same type in the `impl` that it does in the `trait` (which we assume had errored, and `delay_span_bug` guards against bugs).
2020-04-18Detect mistyped associated consts in `Instance::resolve`.Eduard-Mihai Burtescu-13/+54
2020-04-18ty/instance: use `ParamEnvAnd` in the `resolve_instance` query.Eduard-Mihai Burtescu-2/+4
2020-04-17Adjust mir-opt test and make it drop somethingJonas Schievink-3/+3
2020-04-17Make `needs_drop` less pessimistic on generatorsJonas Schievink-0/+17
2020-04-14Auto merge of #70643 - Rustin-Liu:rustin-patch-rename, r=eddybbors-4/+4
Rename AssocKind::Method to AssocKind::Fn Part of https://github.com/rust-lang/rust/issues/60163. https://github.com/rust-lang/rust/issues/60163#issuecomment-607284413
2020-04-14Rename AssocKind::Method to AssocKind::FnRustin-Liu-4/+4
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-13Use `CRATE_HIR_ID` instead of `DUMMY_HIR_ID` when appropriate.marmeladema-1/+1
Those usage ends up forwarded to a `ObligationClause` which uses `CRATE_HIR_ID` for dummy value as seen in `ObligationClause::dummy`.
2020-04-05Query-ify Instance::resolveAaron Hill-3/+6
2020-04-03Minor follow-up after renaming librustc(_middle)Yuki Okushi-1/+1
2020-04-02Rollup merge of #70658 - davidtwco:issue-70285-still-further-specializable, ↵Mazdak Farrokhzad-1/+5
r=eddyb add `STILL_FURTHER_SPECIALIZABLE` flag Contributes to #70285. This PR adds a `STILL_FURTHER_SPECIALIZABLE` flag to `TypeFlags` which replaces `needs_infer` and `needs_subst` in `Instance::resolve` and `assemble_candidates_from_impls`. r? @eddyb
2020-04-02direct imports for langitem stuffMazdak Farrokhzad-1/+1
2020-04-02add `STILL_FURTHER_SPECIALIZABLE` flagDavid Wood-1/+5
This commit adds a STILL_FURTHER_SPECIALIZABLE flag to `TypeFlags` which replaces `needs_infer` and `needs_subst` in `Instance::resolve` and `assemble_candidates_from_impls.` Signed-off-by: David Wood <david@davidtw.co>
2020-03-30FormatJonas Schievink-2/+2
2020-03-30Assert that the trait ref does not need inferenceJonas Schievink-0/+1
2020-03-30Use query instead of `impl_is_default` fnJonas Schievink-0/+11
2020-03-30Sync `Instance::resolve` with the projection codeJonas Schievink-8/+38
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-6/+6
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-13/+13
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1/+1
2020-03-21rustc: keep upvars tupled in {Closure,Generator}Substs.Eduard-Mihai Burtescu-2/+2
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-1/+1
2020-03-19Rollup merge of #69036 - eddyb:monoshim, r=nikomatsakisMazdak Farrokhzad-20/+50
rustc: don't resolve Instances which would produce malformed shims. There are some `InstanceDef` variants (shims and drop "glue") which contain a `Ty`, and that `Ty` is used in generating the shim MIR. But if that `Ty` mentions any generic parameters, the generated shim would refer to them (but they won't match the `Substs` of the `Instance`), or worse, generating the shim would fail because not enough of the type is known. Ideally we would always produce a "skeleton" of the type, e.g. `(_, _)` for dropping any tuples with two elements, or `Vec<_>` for dropping any `Vec` value, but that's a lot of work, and they would still not match the `Substs` of the `Instance` as it exists today, so `Instance` would probably need to change. By making `Instance::resolve` return `None` in the still-generic cases, we get behavior similar to specialization, where a default can only be used if there are no more generic parameters which would allow a more specialized `impl` to match. <hr/> This was found while testing the MIR inliner with #68965, because it was trying to inline shims. cc @rust-lang/wg-mir-opt
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+2
2020-03-15rustc: don't resolve Instances which would produce malformed shims.Eduard-Mihai Burtescu-20/+50
2020-03-14Index HIR after creating TyCtxtJohn Kåre Alsaker-2/+1
2020-03-14Make downstream crates compile.Camille GILLOT-3/+3
2020-03-14Move rustc_infer::traits to new crate rustc_trait_selection.Camille GILLOT-0/+1
2020-03-12remove lifetimes that can be elided (clippy::needless_lifetimes)Matthias Krüger-1/+1
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-1/+1
2020-03-06Auto merge of #69614 - estebank:ice-age, r=davidtwcobors-1/+1
`delay_span_bug` when codegen cannot select obligation Fix #69602, introduced in #60126 by letting the compiler continue past type checking after encountering errors.
2020-03-02Remove chalk integrationCAD97-5/+2
2020-03-01`delay_span_bug` when codegen cannot select obligationEsteban Küber-1/+1
Fix #69602, introduced in #60126 by letting the compiler continue past type checking after encountering errors.
2020-02-19Construct `AssociatedItems` from an iterator instead of a `Vec`Dylan MacKenzie-2/+1
2020-02-19Make lookup of associated item by name O(log n)Dylan MacKenzie-4/+4
2020-02-16Other crates.Camille GILLOT-3/+4