about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/flags.rs
AgeCommit message (Collapse)AuthorLines
2023-03-23Rename AliasEq -> AliasRelateMichael Goulet-1/+1
2023-03-23Include relation direction in AliasEq predicateMichael Goulet-1/+1
2023-02-17Add `Clause::ConstArgHasType` variantBoxy-0/+4
2023-02-15simplify some refsMatthias Krüger-1/+1
2023-02-10add `AliasEq` to `PredicateKind`Boxy-4/+12
2023-01-27Introduce GeneratorWitnessMIR.Camille GILLOT-0/+10
2023-01-08Add type flags support for Ty and Const late-bound regionsMichael Goulet-2/+14
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-12-18don't restuct references just to reborrowMatthias Krüger-2/+2
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-1/+1
2022-12-13Combine projection and opaque into aliasMichael Goulet-2/+2
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-2/+2
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-1/+1
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-1/+1
2022-11-25Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwUbors-0/+20
Add `ConstKind::Expr` Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready. r? `@lcnr`
2022-11-25Add empty ConstKind::Abstractkadmin-0/+20
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-25Introduce PredicateKind::ClauseSantiago Pastorino-4/+10
2022-11-21Add an always-ambiguous predicate to make sure that we don't accidentlally ↵Oli Scherer-0/+1
allow trait resolution to prove false things during coherence
2022-10-19stop folding `UnevaluatedConst`lcnr-12/+4
2022-10-18change `ConstEvaluatable` to use `ty::Const`lcnr-1/+1
2022-09-23rename Unevaluated to UnevaluatedConstb-naber-2/+2
2022-09-22introduce mir::Unevaluatedb-naber-1/+1
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-1/+1
2022-09-05Pack `Term` in the same way as `GenericArg`.Nicholas Nethercote-7/+7
This shrinks the `PredicateS` type, which is instanted frequently.
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-1/+1
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-02-21use `List<Ty<'tcx>>` for tupleslcnr-2/+2
2022-02-15Overhaul `Const`.Nicholas Nethercote-4/+4
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as this: ``` pub struct Const<'tcx>(&'tcx Interned<ConstS>); ``` This now matches `Ty` and `Predicate` more closely, including using pointer-based `eq` and `hash`. Notable changes: - `mk_const` now takes a `ConstS`. - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a we need separate arena for it, because we can't use the `Dropless` one any more. - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes. - Lots of tedious sigil fiddling.
2022-02-15Overhaul `TyS` and `Ty`.Nicholas Nethercote-2/+2
Specifically, change `Ty` from this: ``` pub type Ty<'tcx> = &'tcx TyS<'tcx>; ``` to this ``` pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>); ``` There are two benefits to this. - It's now a first class type, so we can define methods on it. This means we can move a lot of methods away from `TyS`, leaving `TyS` as a barely-used type, which is appropriate given that it's not meant to be used directly. - The uniqueness requirement is now explicit, via the `Interned` type. E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather than via `TyS`, which wasn't obvious at all. Much of this commit is boring churn. The interesting changes are in these files: - compiler/rustc_middle/src/arena.rs - compiler/rustc_middle/src/mir/visit.rs - compiler/rustc_middle/src/ty/context.rs - compiler/rustc_middle/src/ty/mod.rs Specifically: - Most mentions of `TyS` are removed. It's very much a dumb struct now; `Ty` has all the smarts. - `TyS` now has `crate` visibility instead of `pub`. - `TyS::make_for_test` is removed in favour of the static `BOOL_TY`, which just works better with the new structure. - The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned` (pointer-based, for the `Equal` case) and partly on `TyS` (contents-based, for the other cases). - There are many tedious sigil adjustments, i.e. adding or removing `*` or `&`. They seem to be unavoidable.
2022-02-11Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"Oli Scherer-4/+0
This reverts commit e7cc3bddbe0d0e374d05e7003e662bba1742dbae, reversing changes made to 734368a200904ef9c21db86c595dc04263c87be0.
2022-02-02Lazily resolve type-alias-impl-trait defining usesOli Scherer-0/+4
by using an opaque type obligation to bubble up comparisons between opaque types and other types Also uses proper obligation causes so that the body id works, because out of some reason nll uses body ids for logic instead of just diagnostics.
2022-01-17Add term to ExistentialProjectionkadmin-1/+4
Also prevent ICE when adding a const in associated const equality.
2022-01-17Update term for use in more placeskadmin-1/+1
Replace use of `ty()` on term and use it in more places. This will allow more flexibility in the future, but slightly worried it allows items which are consts which only accept types.
2022-01-17Use Term in ProjectionPredicatekadmin-3/+6
ProjectionPredicate should be able to handle both associated types and consts so this adds the first step of that. It mainly just pipes types all the way down, not entirely sure how to handle consts, but hopefully that'll come with time.
2022-01-15attempt to re-add `ty::Unevaluated` visitor and friendsEllen-3/+9
2022-01-15initial revertEllen-28/+6
2021-12-15Remove `in_band_lifetimes` from `rustc_middle`Aaron Hill-3/+3
See #91867 This was mostly straightforward. In several places, I take advantage of the fact that lifetimes are non-hygenic: a macro declares the 'tcx' lifetime, which is then used in types passed in as macro arguments.
2021-08-26reviewlcnr-0/+11
2021-08-26shrink `ty::PredicateKind` againlcnr-1/+1
2021-08-26use `ty::Unevaluated` instead of def substs pairlcnr-2/+2
2021-08-26update `TypeFlags` to deal with missing ct substslcnr-4/+14
2021-08-26make unevaluated const substs optionallcnr-1/+2
2021-08-19introduce a Coerce predicateNiko Matsakis-0/+4
2021-08-13move Constness into TraitPredicateDeadbeef-1/+1
2021-05-01Make `TypeFoldable::is_global()` false when fresh tys/consts are presentAaron Hill-2/+4
This ensures that `ParamEnv::and` preserves the original `caller_bounds` when we have a value containing fresh tys/consts. This ensures that when we cache a `SelectionCandidate`, the cache key (a `ParamEnvAnd`) contains all of the information that influenced the computation of our result (e.g. we may end up choosing a `ParamCandidate`)
2021-04-28Add HAS_RE_LATE_BOUND if there are bound varsJack Huey-0/+4
2021-03-31Add tcx lifetime to BinderJack Huey-3/+3
2021-03-20extract `ConstKind::Unevaluated` into a structlcnr-4/+6
2021-01-16Review changesJack Huey-14/+14
2021-01-16CleanupJack Huey-3/+3
2021-01-16Remove PredicateKindJack Huey-3/+2