about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/variance
AgeCommit message (Collapse)AuthorLines
2023-11-14finish `RegionKind` renamelcnr-3/+3
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-11-13rename `ReLateBound` to `ReBound`lcnr-3/+5
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-10-03Optimize some `alloc_from_iter` call sites.Nicholas Nethercote-1/+1
There's no need to collect an iterator into a `Vec`, or to call `into_iter` at the call sites.
2023-09-26Don't store lazyness in DefKindMichael Goulet-14/+8
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-5/+1
2023-08-30Revert "Auto merge of #102417 - oli-obk:opaque_lifetimes2, r=jackh726"Oli Scherer-1/+9
This reverts commit cb9467515b5a9b15aaa905683c6b4dd9e851056c, reversing changes made to 57781b24c54f9548722927ba88c343ff28da94ce.
2023-08-28Test variances of opaque capturesMichael Goulet-0/+15
2023-08-07Store the laziness of type aliases in the DefKindLeón Orell Valerian Liehr-11/+8
2023-08-03Compute variances for lazy type aliasesLeón Orell Valerian Liehr-5/+41
2023-08-02Remove constness from `TraitPredicate`Deadbeef-1/+0
2023-07-25inline format!() args from rustc_codegen_llvm to the end (4)Matthias Krüger-2/+2
r? @WaffleLapkin
2023-07-17Rename arg_iter to iter_instantiatedMichael Goulet-1/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-34/+34
2023-07-08Replace RPITIT current impl with new strategy that lowers as a GATSantiago Pastorino-9/+1
2023-07-07Remove variances_of on RPITIT gats, remove its one use-caseMichael Goulet-9/+3
2023-06-29Properly implement variances_of for RPITIT GATSantiago Pastorino-9/+15
2023-06-22Migrate item_bounds to ty::ClauseMichael Goulet-8/+5
2023-06-19s/Clause/ClauseKindMichael Goulet-3/+3
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2023-04-25Rollup merge of #110556 - kylematsuda:earlybinder-explicit-item-bounds, ↵Matthias Krüger-2/+1
r=compiler-errors Switch to `EarlyBinder` for `explicit_item_bounds` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`. r? `@compiler-errors` (hope it's okay to request you, since you reviewed #110299 and #110498 :smiley:)
2023-04-21Allow `LocalDefId` as the argument to `def_path_str`Oli Scherer-1/+1
2023-04-20add subst_identity_iter and subst_identity_iter_copied methods on ↵Kyle Matsuda-2/+1
EarlyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls
2023-04-20add EarlyBinder to output of explicit_item_bounds; replace ↵Kyle Matsuda-1/+1
bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query
2023-04-16Remove `TypeSuper{Foldable,Visitable}` impls for `Region`.Nicholas Nethercote-1/+1
These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods.
2023-03-21IdentitySubsts::identity_for_item takes Into<DefId>Michael Goulet-1/+1
2023-03-21Use local key in providersMichael Goulet-4/+4
2023-03-15ImplTraitPlaceholder -> is_impl_trait_in_traitSantiago Pastorino-4/+8
2023-03-07Rollup merge of #108460 - obeis:hir-analysis-migrate-diagnostics-2, ↵Matthias Krüger-1/+6
r=compiler-errors migrate `rustc_hir_analysis` to session diagnostic [Part Two] migrate `rustc_hir_analysis` to session diagnostic (part two) files list: - rustc_hir_analysis/variance/* - rustc_hir_analysis/missing_cast_for_variadic_arg.rs - rustc_hir_analysis/sized_unsized_cast.rs Updates #100717
2023-03-05migrate `rustc_hir_analysis` to session diagnosticObei Sideg-1/+6
part two files list: rustc_hir_analysis/variance/* rustc_hir_analysis/missing_cast_for_variadic_arg.rs rustc_hir_analysis/sized_unsized_cast.rs
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-1/+1
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-02-22Remove type-traversal trait aliasesAlan Egerton-4/+2
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-3/+3
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-3/+3
2023-02-13Make visiting traits generic over the InternerAlan Egerton-1/+1
2023-02-13Workaround issue #107747Alan Egerton-1/+3
Only required until fix #107803 is merged into stage0 compiler, expected when beta 1.69.0 is released on 2023-03-09, then this commit can be reverted.
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-1/+1
2023-02-09Change to `ReError(ErrorGuaranteed)`Esteban Küber-1/+1
2023-02-09Introduce `ReError`Esteban Küber-0/+2
CC #69314
2023-01-28Rollup merge of #107339 - aliemjay:covariant, r=lcnrMatthias Krüger-5/+3
internally change regions to be covariant Surprisingly, we consider the reference type `&'a T` to be contravaraint in its lifetime parameter. This is confusing and conflicts with the documentation we have in the reference, rustnomicon, and rustc-dev-guide. This also arguably not the correct use of terminology since we can use `&'static u8` in a place where `&' a u8` is expected, this implies that `&'static u8 <: &' a u8` and consequently `'static <: ' a`, hence covariance. Because of this, when relating two types, we used to switch the argument positions in a confusing way: `Subtype(&'a u8 <: &'b u8) => Subtype('b <: 'a) => Outlives('a: 'b) => RegionSubRegion('b <= 'a)` The reason for the current behavior is probably that we wanted `Subtype('b <: 'a)` and `RegionSubRegion('b <= 'a)` to be equivalent, but I don' t think this is a good reason since these relations are sufficiently different in that the first is a relation in the subtyping lattice and is intrinsic to the type-systems, while the the second relation is an implementation detail of regionck. This PR changes this behavior to use covariance, so.. `Subtype(&'a u8 <: &'b u8) => Subtype('a <: 'b) => Outlives('a: 'b) => RegionSubRegion('b <= 'a) ` Resolves #103676 r? `@lcnr`
2023-01-27Introduce GeneratorWitnessMIR.Camille GILLOT-6/+6
2023-01-27update comment on trait objectsAli MJ Al-Nasrawy-1/+1
2023-01-26change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add ↵Kyle Matsuda-1/+1
EarlyBinder to fn_sig in metadata
2023-01-26replace usages of fn_sig query with bound_fn_sigKyle Matsuda-1/+5
2023-01-27internally change regions to be covariantAli MJ Al-Nasrawy-5/+3
2023-01-21Auto merge of #106977 - michaelwoerister:unord_id_collections, r=oli-obkbors-9/+6
Use UnordMap and UnordSet for id collections (DefIdMap, LocalDefIdMap, etc) This PR changes the `rustc_data_structures::define_id_collections!` macro to use `UnordMap` and `UnordSet` instead of `FxHashMap` and `FxHashSet`. This should account for a large portion of hash-maps being used in places where they can cause trouble. The changes required are moderate but non-zero: - In some places the collections are extracted into sorted vecs. - There are a few instances where for-loops have been changed to extends. ~~Let's see what the performance impact is. With a bit more refactoring, we might be able to get rid of some of the additional sorting -- but the change set is already big enough. Unless there's a performance impact, I'd like to do further changes in subsequent PRs.~~ Performance does not seem to be negatively affected ([perf-run here](https://github.com/rust-lang/rust/pull/106977#issuecomment-1396776699)). Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533). r? `@ghost`
2023-01-20Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstriebbors-2/+2
Remove some `ref` patterns from the compiler Previous PR: https://github.com/rust-lang/rust/pull/105368 r? `@Nilstrieb`
2023-01-19Rollup merge of #106931 - Ezrashaw:docs-e0208, r=compiler-errorsGuillaume Gomez-3/+2
document + UI test `E0208` and make its output more user-friendly Cleans up `E0208`'s output a lot. It could actually be useful for someone learning about variance now. I also added a UI test for it in `tests/ui/error-codes/` and wrote some docs for it. r? `@GuillaumeGomez` another error code, can't be bothered to find the issue :P. Obviously there's some compiler stuff, so you'll have to hand it off. Part of https://github.com/rust-lang/rust/issues/61137.
2023-01-19Use UnordMap instead of FxHashMap in define_id_collections!().Michael Woerister-9/+6
2023-01-18remove error code from `#[rustc_variance]` and document its remainsEzra Shaw-3/+2