about summary refs log tree commit diff
path: root/src/librustc_ty
AgeCommit message (Collapse)AuthorLines
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)
2020-02-02Address review commentsMatthew Jasper-21/+14
* Handle arrays with const-generic lengths * Use closure for repeated code.
2020-02-02Improve needs_drop queryMatthew Jasper-0/+215
* Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty
2020-02-02Remove unnecessary features in rustc_tyMatthew Jasper-3/+5
2020-02-02Use more accurate failed predicate spansEsteban Küber-1/+1
2020-01-31Drop cfg(bootstrap) codeMark Rousskov-1/+0
2020-01-27don't clone types that are copy, round two.Matthias Krüger-1/+1
2020-01-20Add `ConstnessAnd` that implements `ToPredicate`Dylan MacKenzie-1/+2
2020-01-18slice_patterns: remove internal uses of gateMazdak Farrokhzad-1/+1
2020-01-17Use named fields for `hir::ItemKind::Impl`Dylan MacKenzie-4/+4
2020-01-13Move to new crate rustc_ty.Camille GILLOT-0/+410