summary refs log tree commit diff
path: root/compiler/rustc_traits/src/chalk
AgeCommit message (Collapse)AuthorLines
2023-01-15Remove bound_{explicit,}_item_boundsMichael Goulet-8/+7
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-4/+3
bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14change usages of impl_trait_ref to bound_impl_trait_refKyle Matsuda-1/+2
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-14/+14
2022-12-13Remove chalk lowering for AliasTyMichael Goulet-11/+10
2022-12-13Combine projection and opaque into aliasMichael Goulet-22/+29
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-8/+8
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-5/+5
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-9/+13
2022-11-25Introduce PredicateKind::ClauseSantiago Pastorino-38/+50
2022-11-24Auto merge of #103693 - HKalbasi:master, r=oli-obkbors-15/+15
Make rustc_target usable outside of rustc I'm working on showing type size in rust-analyzer (https://github.com/rust-lang/rust-analyzer/pull/13490) and I currently copied rustc code inside rust-analyzer, which works, but is bad. With this change, I would become able to use `rustc_target` and `rustc_index` directly in r-a, reducing the amount of copy needed. This PR contains some feature flag to put nightly features behind them to make crates buildable on the stable compiler + makes layout related types generic over index type + removes interning of nested layouts.
2022-11-24move some layout logic to rustc_target::abi::layouthkalbasi-15/+15
2022-11-24Avoid `GenFuture` shim when compiling async constructsArpad Borsos-1/+5
Previously, async constructs would be lowered to "normal" generators, with an additional `from_generator` / `GenFuture` shim in between to convert from `Generator` to `Future`. The compiler will now special-case these generators internally so that async constructs will *directly* implement `Future` without the need to go through the `from_generator` / `GenFuture` shim. The primary motivation for this change was hiding this implementation detail in stack traces and debuginfo, but it can in theory also help the optimizer as there is less abstractions to see through.
2022-11-22Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnrManish Goregaokar-0/+4
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ````@lcnr```` fixes #99840
2022-11-21Allow iterators instead of requiring slices that will get turned into iteratorsOli Scherer-1/+1
2022-11-21Add an always-ambiguous predicate to make sure that we don't accidentlally ↵Oli Scherer-0/+4
allow trait resolution to prove false things during coherence
2022-11-19drive-by: PolyExistentialPredicateMichael Goulet-1/+1
2022-11-13Make rustc build with new chalkMichael Goulet-3/+3
2022-11-07Add an optional Span to BrAnon and use it to print better error for HRTB ↵Jack Huey-10/+12
error from generator interior
2022-11-04Refactor tcx mk_const parameters.Mateusz-5/+5
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+1
2022-09-13Address code review commentsEric Holk-1/+2
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-1/+1
2022-09-08Remove ReEmptyJack Huey-6/+2
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-02Add bound_predicates_of and bound_explicit_predicates_ofJack Huey-15/+16
2022-08-02Auto merge of #100032 - BoxyUwU:no_ty_in_placeholder_const, r=compiler-errorsbors-1/+1
make `PlaceholderConst` not store the type of the const Currently the `Placeholder` variant on `ConstKind` is 28 bytes when with this PR its 8 bytes, i am not sure this is really useful at all rn since `Unevaluated` and `Value` variants are huge still but eventually it should be possible to get both down to 16 bytes :thinking:. Mostly opening this to see if this change has any perf impact when done before it can make `ConstKind`/`ConstS` smaller
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-5/+3
2022-08-01make `PlaceholderConst` not store the type of the constEllen-1/+1
2022-07-06Update TypeVisitor pathsAlan Egerton-3/+3
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-2/+3
2022-06-28Make empty bounds lower to WellFormed and make WellFormed coinductiveJack Huey-2/+10
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-4/+4
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-06-08Folding revamp.Nicholas Nethercote-3/+4
This commit makes type folding more like the way chalk does it. Currently, `TypeFoldable` has `fold_with` and `super_fold_with` methods. - `fold_with` is the standard entry point, and defaults to calling `super_fold_with`. - `super_fold_with` does the actual work of traversing a type. - For a few types of interest (`Ty`, `Region`, etc.) `fold_with` instead calls into a `TypeFolder`, which can then call back into `super_fold_with`. With the new approach, `TypeFoldable` has `fold_with` and `TypeSuperFoldable` has `super_fold_with`. - `fold_with` is still the standard entry point, *and* it does the actual work of traversing a type, for all types except types of interest. - `super_fold_with` is only implemented for the types of interest. Benefits of the new model. - I find it easier to understand. The distinction between types of interest and other types is clearer, and `super_fold_with` doesn't exist for most types. - With the current model is easy to get confused and implement a `super_fold_with` method that should be left defaulted. (Some of the precursor commits fixed such cases.) - With the current model it's easy to call `super_fold_with` within `TypeFolder` impls where `fold_with` should be called. The new approach makes this mistake impossible, and this commit fixes a number of such cases. - It's potentially faster, because it avoids the `fold_with` -> `super_fold_with` call in all cases except types of interest. A lot of the time the compile would inline those away, but not necessarily always.
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-20/+20
2022-05-13Add bound_impl_trait_refJack Huey-5/+5
2022-05-13Add bound_type_ofJack Huey-1/+4
2022-05-10Introduce EarlyBinderJack Huey-13/+14
2022-03-28Remove opaque type obligation and just register opaque types as they are ↵Oli Scherer-4/+0
encountered. This also registers obligations for the hidden type immediately.
2022-03-28Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"Oli Scherer-0/+6
This reverts commit 6499c5e7fc173a3f55b7a3bd1e6a50e9edef782d, reversing changes made to 78450d2d602b06d9b94349aaf8cece1a4acaf3a8.
2022-03-23make rustc work againMichael Goulet-10/+37
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-9/+9
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
2022-02-22chalk/db: use correct debrujin index when replacing opaque type.Dario Nieuwenhuis-15/+40
2022-02-21chalk/lowering: lower generator types.Dario Nieuwenhuis-1/+4
2022-02-21use `List<Ty<'tcx>>` for tupleslcnr-3/+7
2022-02-19Adopt let else in more placesest31-3/+2
2022-02-15Overhaul `Const`.Nicholas Nethercote-7/+7
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-15Remove unnecessary `RegionKind::` quals.Nicholas Nethercote-22/+18
The variant names are exported, so we can use them directly (possibly with a `ty::` qualifier). Lots of places already do this, this commit just increases consistency.
2022-02-15Overhaul `RegionKind` and `Region`.Nicholas Nethercote-8/+8
Specifically, change `Region` from this: ``` pub type Region<'tcx> = &'tcx RegionKind; ``` to this: ``` pub struct Region<'tcx>(&'tcx Interned<RegionKind>); ``` This now matches `Ty` and `Predicate` more closely. Things to note - Regions have always been interned, but we haven't been using pointer-based `Eq` and `Hash`. This is now happening. - I chose to impl `Deref` for `Region` because it makes pattern matching a lot nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`. - Various methods are moved from `RegionKind` to `Region`. - There is a lot of tedious sigil changes. - A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`. - A couple of test outputs change slightly, I'm not sure why, but the new outputs are a little better.