about summary refs log tree commit diff
path: root/compiler/rustc_traits/src
AgeCommit message (Collapse)AuthorLines
2023-01-19even more unify Projection/Opaque in outlives codeAli MJ Al-Nasrawy-4/+2
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-1/+1
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2023-01-17Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorinoMatthias Krüger-3/+2
Unify `Opaque`/`Projection` handling in region outlives code They share basically identical paths in most places which are even easier to unify now that they're both `ty::Alias` r? types
2023-01-15Remove bound_{explicit,}_item_boundsMichael Goulet-8/+7
2023-01-15Make InstantiatedPredicates impl IntoIteratorMichael Goulet-4/+1
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
2023-01-13Unify Opaque/Projection handling in region outlives codeMichael Goulet-3/+2
2023-01-10Rollup merge of #106204 - compiler-errors:no-take-opaques-in-compare, r=oli-obkYuki Okushi-1/+1
No need to take opaques in `check_type_bounds` `InferCtxt` already has its defining use anchor set to err r? ``@oli-obk``
2023-01-09Assert defining anchor is set in take_opaque_typesMichael Goulet-1/+1
2023-01-07make ascribe_user_type a TypeOpAli MJ Al-Nasrawy-11/+42
Projection types in user annotations may contain inference variables. This makes the normalization depend on the unification with the actual type and thus requires a separate TypeOp to track the obligations. Otherwise simply calling `TypeChecker::normalize` would ICE with "unexpected ambiguity"
2023-01-07don't normalize in astconvAli MJ Al-Nasrawy-0/+1
We delay projection normalization to further stages in order to register user type annotations before normalization in HIR typeck. There are two consumers of astconv: ItemCtxt and FnCtxt. The former already expects unnormalized types from astconv, see its AstConv trait impl. The latter needs `RawTy` for a cleaner interface. Unfortunately astconv still needs the normalization machinery in order to resolve enum variants that have projections in the self type, e.g. `<<T as Trait>::Assoc>::StructVariant {}`. This is why `AstConv::normalize_ty_2` is necessary.
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-3/+3
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-2/+2
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 identical alias armsMichael Goulet-2/+2
2022-12-13Combine projection and opaque into aliasMichael Goulet-24/+31
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-12-08Move some suggestions from error_reporting to error_reporting::suggestMichael Goulet-1/+1
2022-12-08Move codegen_select_candidate to a rustc_traitsMichael Goulet-0/+90
2022-11-28Make ObligationCtxt::normalize take cause by borrowMichael Goulet-3/+3
2022-11-28partially_normalize_... -> At::normalizeMichael Goulet-3/+3
2022-11-28Rename At::normalize to At::query_normalizeMichael Goulet-3/+3
2022-11-26Rollup merge of #104906 - spastorino:remove-ascribeusertypecx, r=compiler-errorsMatthias Krüger-107/+50
Remove AscribeUserTypeCx r? ``@compiler-errors`` This basically inlines `AscribeUserTypeCx::relate_mir_and_user_ty` into `type_op_ascribe_user_type_with_span` which is the only place where it's used and makes direct use of `ObligationCtxt` API.
2022-11-25Define all clauses as dummy_with_span as the usages are all equivalentSantiago Pastorino-7/+5
2022-11-25Remove AscribeUserTypeCxSantiago Pastorino-107/+52
2022-11-25Introduce PredicateKind::ClauseSantiago Pastorino-49/+63
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-23Pass ObligationCtxt from enter_canonical_trait_query and use ObligationCtxt APISantiago Pastorino-16/+13
2022-11-22Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnrManish Goregaokar-0/+6
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/+6
allow trait resolution to prove false things during coherence
2022-11-21Rollup merge of #104595 - compiler-errors:poly-existential-predicate, r=lcnrMatthias Krüger-1/+1
Add `PolyExistentialPredicate` type alias Wrapping `ExistentialPredicate`s in a binder is very common, and this alias already exists for the `PolyExistential{TraitRef,Projection}` types.
2022-11-20Auto merge of #104522 - RalfJung:try_normalize_after_erasing_regions, r=oli-obkbors-1/+3
try_normalize_after_erasing_regions: promote an assertion to always run In https://github.com/rust-lang/miri/issues/2433 this assertion has been seen to trigger, so it might be worth actually checking this? Regressing debug assertions are very easy to miss until much later, and then they become quite hard to debug.
2022-11-19drive-by: PolyExistentialPredicateMichael Goulet-1/+1
2022-11-17try_normalize_after_erasing_regions: promote an assertion to always runRalf Jung-1/+3
2022-11-16Convert predicates into Predicate in the Obligation constructorOli Scherer-3/+8
2022-11-13Make rustc build with new chalkMichael Goulet-3/+3
2022-11-09make dropck_outlives into a proper canonicalized type queryMichael Goulet-110/+97
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-10-27remove _types from ocx method namesMichael Goulet-3/+3
2022-10-27Address some more nitsMichael Goulet-14/+3
2022-10-27(almost) Always use ObligationCtxt when dealing with canonical queriesMichael Goulet-80/+56