about summary refs log tree commit diff
path: root/src/librustc_ty
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1083/+0
2020-08-24hir: consistent use and naming of lang itemsDavid Wood-5/+5
This commit adjusts the naming of various lang items so that they are consistent and don't include prefixes containing the target or "LangItem". In addition, lang item variants are no longer exported from the `lang_items` module. Signed-off-by: David Wood <david@davidtw.co>
2020-08-15replaced log with tracingGurpreet Singh-3/+3
2020-08-13merge `as_local_hir_id` with `local_def_id_to_hir_id`Bastian Kauschke-5/+5
2020-08-08fix clippy::into_iter_on_ref: use .iter() instead of into_iter() on references.Matthias Krüger-1/+1
2020-07-31Move from `log` to `tracing`Oliver Scherer-1/+1
2020-07-31Auto merge of #65989 - Aaron1011:fix/normalize-param-env, r=nikomatsakisbors-1/+6
Normalize all opaque types when converting ParamEnv to Reveal::All When we normalize a type using a ParamEnv with a reveal mode of RevealMode::All, we will normalize opaque types to their underlying types (e.g. `type MyOpaque = impl Foo` -> `StructThatImplsFoo`). However, the ParamEnv may still have predicates referring to the un-normalized opaque type (e.g. `<T as MyTrait<MyOpaque>>`). This can cause trait projection to fail, since a type containing normalized opaque types will not match up with the un-normalized type in the `ParamEnv`. To fix this, we now explicitly normalize all opaque types in caller_bounds of a `ParamEnv` when changing its mode to `RevealMode::All`. This ensures that all predicatse will refer to the underlying types of any opaque types involved, allowing them to be matched up properly during projection. To reflect the fact that normalization is occuring, `ParamEnv::with_reveal_all` is renamed to `ParamEnv::with_reveal_all_normalized` Fixes #65918
2020-07-27introduce PredicateAtomBastian Kauschke-9/+9
2020-07-27this might be unqualified, but at least it's now quantifiedBastian Kauschke-2/+2
2020-07-27split ignore_qualifiersBastian Kauschke-9/+8
2020-07-22Normalize opaque types when converting `ParamEnv` to `Reveal::All`Aaron Hill-1/+6
Fixes #65918
2020-07-20shim: adjust valid shim assertsDavid Wood-18/+23
This commit makes valid shim asserts more specific - checking for the specific types that are valid for a given type of shim - and removes asserts for types which require substitutions. Signed-off-by: David Wood <david@davidtw.co>
2020-07-15WithOptConstParam::dummy -> WithOptConstParam::unknownBastian Kauschke-2/+2
2020-07-15ty_def_id -> def_id_for_type_ofBastian Kauschke-1/+1
2020-07-15improve namingBastian Kauschke-6/+10
2020-07-15update const arg queriesBastian Kauschke-21/+14
2020-07-15InstanceDef::ItemBastian Kauschke-2/+2
2020-07-15const_eval_resolveBastian Kauschke-9/+43
2020-07-09Rollup merge of #74070 - eddyb:forall-tcx-providers, r=nikomatsakisManish Goregaokar-5/+5
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-5/+5
2020-07-05Shrink ParamEnv to 16 bytesMark Rousskov-1/+1
2020-06-21Make is_freeze and is_copy_modulo_regions take TyCtxtAtRalf Jung-1/+1
2020-06-20Move bounds on associated types to the typeMatthew Jasper-15/+42
Given `trait X { type U; }` the bound `<Self as X>::U` now lives on the type, rather than the trait. This is feature gated on `feature(generic_associated_types)` for now until more testing can be done. The also enabled type-generic associated types since we no longer need "implies bounds".
2020-06-20Consider fewer predicates for projection candidatesMatthew Jasper-1/+104
We now require that projection candidates are applicable with the idenitity substs of the trait, rather than allowing predicates that are only applicable for certain substs.
2020-06-15make all uses of ty::Error or ConstKind::Error delay a span bugmark-1/+1
2020-06-11Remove associated opaque typesMatthew Jasper-2/+0
They're unused now.
2020-06-09Auto merge of #72114 - anyska:vtable-rename, r=nikomatsakisbors-11/+11
Rename traits::Vtable to ImplSource. Originally suggested by @eddyb. r? @nikomatsakis
2020-06-07Rollup merge of #72764 - jonas-schievink:mind-the-tyerr, r=estebankDylan DPC-2/+8
Be more careful around ty::Error in generators cc https://github.com/rust-lang/rust/issues/72685 (doesn't close it because it's missing a reproduction to use as a test case) r? @estebank
2020-06-05Rename traits::ImplSourceImpl to ImplSourceUserDefined.Ana-Maria Mihalache-2/+2
2020-06-05Rename traits::Vtable to ImplSource.Ana-Maria Mihalache-11/+11
2020-05-30Be more careful around ty::Error in generatorsJonas Schievink-2/+8
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