about summary refs log tree commit diff
path: root/src/librustc_ty
AgeCommit message (Collapse)AuthorLines
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
2020-02-16Make librustc_infer compile.Camille GILLOT-0/+1
2020-02-13Move resolve_instance to rustc_ty.Camille GILLOT-0/+138
2020-02-12Auto merge of #68679 - matthewjasper:needs-type-op, r=varkorbors-2/+214
Improve `ty.needs_drop` * Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty * Avoid query in simple cases reopens #65918
2020-02-09Apply suggestions from code reviewmatthewjasper-6/+7
Co-Authored-By: varkor <github@varkor.com>
2020-02-08Make `associated_items` query return a sliceJonas Schievink-6/+4
2020-02-06Rollup merge of #68837 - jonas-schievink:assoc-item-lookup-2, r=estebankDylan DPC-0/+9
Make associated item collection a query Before this change, every time associated items were iterated over (which rustc does *a lot* – this can probably be further optimized), there would be N+1 queries to fetch all assoc. items. Now there's just one after they've been computed once.
2020-02-05Make associated item lookup a queryJonas Schievink-0/+9
2020-02-04Auto merge of #68377 - estebank:fn-obligations-spans, r=oli-obkbors-1/+1
Tweak obligation error output - Point at arguments or output when fn obligations come from them, or ident when they don't - Point at `Sized` bound (fix #47990) - When object unsafe trait uses itself in associated item suggest using `Self` (fix #66424, fix #33375, partially address #38376, cc #61525) - Point at reason in object unsafe trait with `Self` in supertraits or `where`-clause (cc #40533, cc #68377) - On implicit type parameter `Sized` obligations, suggest `?Sized` (fix #57744, fix #46683)