summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/context.rs
AgeCommit message (Collapse)AuthorLines
2023-09-26Don't store lazyness in DefKindMichael Goulet-1/+1
2023-09-24Remove span from BrAnon.Camille GILLOT-2/+2
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-1/+0
2023-09-22Add a way to decouple the implementation and the declaration of a TyCtxt method.Oli Scherer-0/+6
2023-09-18make more prettyBoxy-0/+1
2023-09-18Rollup merge of #115907 - RalfJung:interner-check, r=compiler-errorsMatthias Krüger-0/+24
nop_lift macros: ensure that we are using the right interner Right now someone could put down the wrong list name when using these macros, and everything would still build. Nothing does a type-check to ensure that the `$set` contains element of type `Self::Lifted`. Let's fix that. For lists this is fairly easy; for the other interners we need to unwrap some newtypes which makes this more complicated.
2023-09-18Remove more unused `Lift` impls.Nicholas Nethercote-7/+1
2023-09-18Rename `CloneLiftImpls` as `TrivialLiftImpls`.Nicholas Nethercote-1/+1
To match `TrivialTypeTraversalImpls` and `TrivialTypeTraversalAndLiftImpls`, and because the `Clone` doesn't mean anything.
2023-09-17nop_lift macros: ensure that we are using the right internerRalf Jung-0/+24
2023-09-14make it more clear which functions create fresh AllocIdRalf Jung-1/+1
2023-09-09Use `FreezeLock` for `CStore`John Kåre Alsaker-5/+3
2023-09-02Add `Freeze` type and use it to store `Definitions`John Kåre Alsaker-10/+10
2023-08-24Optimize `lock_shards`John Kåre Alsaker-19/+20
2023-08-09rustc: Move `stable_crate_id` from `Session` to `GlobalCtxt`Vadim Petrochenkov-4/+12
Removes a piece of mutable state. Follow up to #114578.
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-3/+42
Removes a piece of mutable state. Follow up to #114578.
2023-08-08Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obkbors-2/+2
correctly lower `impl const` to bind to host effect param r? `@oli-obk`
2023-08-08Auto merge of #114602 - compiler-errors:rpit-outlives-sadness, r=oli-obkbors-0/+78
Map RPIT duplicated lifetimes back to fn captured lifetimes Use the [`lifetime_mapping`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.OpaqueTy.html#structfield.lifetime_mapping) to map an RPIT's captured lifetimes back to the early- or late-bound lifetimes from its parent function. We may be going thru several layers of mapping, since opaques can be nested, so we introduce `TyCtxt::map_rpit_lifetime_to_fn_lifetime` to loop through several opaques worth of mapping, and handle turning it into a `ty::Region` as well. We can then use this instead of the identity substs for RPITs in `check_opaque_meets_bounds` to address #114285. We can then also use `map_rpit_lifetime_to_fn_lifetime` to properly install bidirectional-outlives predicates for both RPITs and RPITITs. This addresses #114601. I based this on #114574, but I don't actually know how much of that PR we still need, so some code may be redundant now... :shrug: --- Fixes #114597 Fixes #114579 Fixes #114285 Also fixes #114601, since it turns out we had other bugs with RPITITs and their duplicated lifetime params :sweat_smile:. Supersedes #114574 r? `@oli-obk`
2023-08-08Simplify via map_rpit_lifetime_to_fn_lifetimeMichael Goulet-1/+10
2023-08-08Install bidirectional outlives predicates for RPITITs (and RPITs) correctlyMichael Goulet-0/+69
2023-08-07Store the laziness of type aliases in the DefKindLeón Orell Valerian Liehr-1/+1
2023-08-06lower impl const to bind to host effect paramDeadbeef-2/+2
2023-07-31Don't check unnecessarily that impl trait is RPITMichael Goulet-28/+1
2023-07-21new solver: add a separate cache for coherencelcnr-4/+8
2023-07-18Add `#[track_caller]` to lint related diagnostic functionsMaybe Waffle-0/+4
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-27/+27
2023-07-08Replace RPITIT current impl with new strategy that lowers as a GATSantiago Pastorino-10/+4
2023-07-05Change comment on `TyCtxt::mk_ty_from_kind`Michael Goulet-1/+1
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-375/+21
2023-07-05Auto merge of #113370 - compiler-errors:rollup-8gvyy8e, r=compiler-errorsbors-0/+8
Rollup of 8 pull requests Successful merges: - #113010 (rust-installer & rls: remove exclusion from rustfmt & tidy ) - #113317 ( -Ztrait-solver=next: stop depending on old solver) - #113319 (`TypeParameterDefinition` always require a `DefId`) - #113320 (Add some extra information to opaque type cycle errors) - #113321 (Move `ty::ConstKind` to `rustc_type_ir`) - #113337 (Winnow specialized impls during selection in new solver) - #113355 (Move most coverage code out of `rustc_codegen_ssa`) - #113356 (Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-05Auto merge of #113210 - fee1-dead-contrib:effects-mvp, r=oli-obkbors-0/+10
Effects/keyword generics MVP This adds `feature(effects)`, which adds `const host: bool` to the generics of const functions, const traits and const impls. This will be used to replace the current logic around const traits. r? `@oli-obk`
2023-07-05move `ConstKind` to typeir and move inherent impls to `Const`Boxy-0/+8
2023-07-04Replace `const_error` methods with `Const::new_error`Boxy-28/+0
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-12/+12
2023-07-04enforce context effects in typeckDeadbeef-0/+10
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-25/+5
2023-06-23Auto merge of #112891 - oli-obk:impl_trait_in_assoc_tys_cleanup, ↵bors-0/+6
r=compiler-errors Various impl trait in assoc tys cleanups r? `@compiler-errors` All commits except for the last are pure refactorings. 274dab5bd658c97886a8987340bf50ae57900c39 allows struct fields to participate in deciding whether a function has an opaque in its signature. best reviewed commit by commit
2023-06-22Migrate item_bounds to ty::ClauseMichael Goulet-5/+24
2023-06-22Move `opaque_type_origin_unchecked` onto `TyCtxt` and re-use it where it was ↵Oli Scherer-0/+6
open coded
2023-06-19s/Clause/ClauseKindMichael Goulet-2/+2
2023-06-16Add `AliasKind::Weak` for type aliases.Oli Scherer-0/+1
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
2023-06-06Add -Ztrait-solver=next-coherenceMichael Goulet-0/+8
2023-06-06New trait solver is a property of inference contextMichael Goulet-1/+1
2023-06-02No more TyCtxt::lazy_normalizationMichael Goulet-9/+0
2023-06-02Rollup merge of #112189 - compiler-errors:bad-gen, r=cjgillotMatthias Krüger-4/+14
Debug-assert that closures and generators are made with the right number of substitutions Just in case.
2023-06-02Improve comments on `TyCtxt` and `GlobalCtxt`.Nicholas Nethercote-0/+12
2023-06-01Assert that closures and generators are made with the right number of ↵Michael Goulet-4/+14
substitutions
2023-05-31Remove const eval limit and implement an exponential backoff lint insteadOli Scherer-10/+0
2023-05-30Auto merge of #112075 - WaffleLapkin:unmkII, r=lcnrbors-90/+3
Replace `tcx.mk_re_*` with `Region::new_*` Second step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
2023-05-29Rollup merge of #111988 - BoxyUwU:make_tykind_debug_good, r=compiler-errorsMatthias Krüger-0/+10
Make `TyKind: Debug` have less verbose output Current `TyKind: Debug` impl is basically unusable for debugging, its too verbose even for verbose debugging :rofl: This PR replaces the debug logic for `TyKind` with a more manual debug impl instead of a hand expanded derived impl. This should help make #107084 more reasonable to land since the output of `Ty: Debug` will be better. This isn't a fully completed change to the `Debug` impl of `TyKind` as there's still logic from the derive macro for some variants. Some of the variants are also not consisten with the `-Zverbose` printing of `Ty`, ideally `-Zverbose` printing of `Ty` would also just defer to the debug impl instead of having lots of checks in pretty printing. I plan on fixing this in follow up PRs since it seems tricky to do in this one and its already a large PR :sweat_smile:
2023-05-29Rename `tcx.mk_re_*` => `Region::new_*`Maybe Waffle-90/+3