summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/context.rs
AgeCommit message (Collapse)AuthorLines
2023-01-19Transform async ResumeTy in generator transformArpad Borsos-0/+9
- Eliminates all the `get_context` calls that async lowering created. - Replace all `Local` `ResumeTy` types with `&mut Context<'_>`. The `Local`s that have their types replaced are: - The `resume` argument itself. - The argument to `get_context`. - The yielded value of a `yield`. The `ResumeTy` hides a `&mut Context<'_>` behind an unsafe raw pointer, and the `get_context` function is being used to convert that back to a `&mut Context<'_>`. Ideally the async lowering would not use the `ResumeTy`/`get_context` indirection, but rather directly use `&mut Context<'_>`, however that would currently lead to higher-kinded lifetime errors. See <https://github.com/rust-lang/rust/issues/105501>. The async lowering step and the type / lifetime inference / checking are still using the `ResumeTy` indirection for the time being, and that indirection is removed here. After this transform, the generator body only knows about `&mut Context<'_>`.
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-2/+2
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-2/+2
2023-01-12Feed the `features_query` instead of grabbing it from the session lazilyOli Scherer-1/+0
2023-01-12Remove `output_filenames` field from TyCtxt and feed the query insteadOli Scherer-7/+1
2023-01-12Remove `untracked_crate` field and instead pass it along with the resolver.Oli Scherer-6/+0
2023-01-12Feed `crate_name` queryOli Scherer-11/+4
2023-01-12Feed `resolutions` query instead of it being a thin wrapper around an ↵Oli Scherer-5/+1
untracked field
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-2/+2
2022-12-16Rename ConstS to ConstDataOli Scherer-5/+5
2022-12-15Move `TypeckResults` to seperate moduleNilstrieb-680/+11
2022-12-14Debug assertions hate this trickOli Scherer-3/+3
2022-12-14Fix some comments and only get the generics in debug modeOli Scherer-27/+23
2022-12-14Remove TraitRef::newOli Scherer-1/+1
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-3/+3
2022-12-14Remove many more cases of `mk_substs_trait` that can now use the iterator ↵Oli Scherer-1/+5
scheme`
2022-12-14Let `mk_fn_def` take an iterator instead to simplify some call sitesOli Scherer-4/+12
2022-12-14Guard `AliasTy` creation against passing the wrong number of substsOli Scherer-7/+19
2022-12-13Combine projection and opaque into aliasMichael Goulet-7/+5
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-9/+8
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-1/+1
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-2/+3
2022-12-09Fold `Definitions` into the untracked dataOli Scherer-31/+14
2022-12-09Move the untracked cstore and source_span into a structOli Scherer-42/+27
2022-12-08Rollup merge of #105423 - oli-obk:symbols, r=jackh726Matthias Krüger-2/+2
Use `Symbol` for the crate name instead of `String`/`str` It always got converted to a symbol anyway
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-2/+2
2022-12-07Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obkMatthias Krüger-0/+8
Don't ICE in ExprUseVisitor on FRU for non-existent struct Fixes #104613 Fixes #105202
2022-12-06Rollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiserMatthias Krüger-56/+27
Put all cached values into a central struct instead of just the stable hash cc `@nnethercote` this allows re-use of the type for Predicate without duplicating all the logic for the non-hash cached fields
2022-12-05feed resolver_for_lowering instead of storing it in a fieldOli Scherer-10/+9
2022-12-05Allow arbitrary keys in feeding APIOli Scherer-7/+14
2022-12-04drive-by: move field_index to typeck resultsMichael Goulet-0/+8
2022-12-01Fill in `def_span` when creating def ids.Oli Scherer-1/+7
This makes sure that ICEing because of def ids created outside of ast lowering will be able to produce a query backtrace and not cause a double panic because of trying to call the `def_span` query
2022-11-30Auto merge of #104940 - cjgillot:query-feed-simple, r=oli-obkbors-10/+44
Allow to feed a value in another query's cache Restricted version of https://github.com/rust-lang/rust/pull/96840 A query can create new definitions. If those definitions are created after HIR lowering, they do not appear in the initial HIR map, and information for them cannot be provided in the normal pull-based way. In order to make those definitions useful, we allow to feed values as query results for the newly created definition. The API is as follows: ```rust let feed = tcx.create_def(<parent def id>, <DefPathData>); // `feed` is a TyCtxtFeed<'tcx>. // Access the created definition. let def_id: LocalDefId = feed.def_id; // Assign `my_query(def_id) := my_value`. feed.my_query(my_value). ``` This PR keeps the consistency checks introduced by https://github.com/rust-lang/rust/pull/96840, even if they are not reachable. This allows to extend the behaviour later without forgetting them. cc `@oli-obk` `@spastorino`
2022-11-30Generalize some InternedInSet implsOli Scherer-36/+6
2022-11-30Remove PredicateS typeOli Scherer-20/+21
2022-11-30Remove TySOli Scherer-18/+17
2022-11-30move WithCachedTypeInfo to rustc_type_irOli Scherer-1/+2
2022-11-30s/WithStableHash/WithCachedTypeInfo/Oli Scherer-15/+15
2022-11-29Auto merge of #94487 - oli-obk:stable_hash_ty, r=fee1-deadbors-23/+54
Also cache the stable hash of interned Predicates continuation of https://github.com/rust-lang/rust/pull/94299 This is a small perf improvement and shares more code between `Ty` and `Predicate`
2022-11-29Make TyCtxtFeed::def_id private.Camille GILLOT-4/+11
2022-11-29Only allow feeding a value to newly created definitions.Camille GILLOT-10/+37
2022-11-29Auto merge of #105012 - WaffleLapkin:into, r=oli-obkbors-22/+10
Make `tcx.mk_const` more permissive wrt `kind` argument (`impl Into`) r? `@oli-obk` you've asked for this >:)
2022-11-29Rollup merge of #104951 - Swatinem:async-kind, r=compiler-errorsMatthias Krüger-0/+5
Simplify checking for `GeneratorKind::Async` Adds a helper method around `generator_kind` that makes matching async constructs simpler.
2022-11-28Simplify checking for `GeneratorKind::Async`Arpad Borsos-0/+5
Adds a helper method around `generator_kind` that makes matching async constructs simpler.
2022-11-28Remove `tcx.mk_const_var`Maybe Waffle-20/+8
... `tcx.mk_const` can now be used instead
2022-11-28Make `tcx.mk_const` more permissive wrt `kind` argumentMaybe Waffle-2/+2
- Accept `impl Into` - Implement `From<>` for `ConstKind` Note: this adds a dependency on `derive_more` (MIT license). It allows to derive a lot of traits (like `From` here) that would be otherwise tedious to implement.
2022-11-28Rename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.Nicholas Nethercote-1/+1
We already use a mix of `Literal` and `Lit`. The latter is better because it is shorter without causing any ambiguity.
2022-11-28Rename `ast::Lit` as `ast::MetaItemLit`.Nicholas Nethercote-2/+3
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-18/+20
2022-11-25Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwUbors-0/+14
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`