summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
AgeCommit message (Collapse)AuthorLines
2023-01-21Rollup merge of #106578 - compiler-errors:recursive-opaque-closure, r=TaKO8KiMichael Goulet-6/+53
Label closure captures/generator locals that make opaque types recursive cc https://github.com/rust-lang/rust/issues/46415#issuecomment-1374665828
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-21Label closure captures/generator locals that make opaque types recursiveMichael Goulet-6/+53
2023-01-20Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnrbors-44/+66
Check ADT fields for copy implementations considering regions Fixes #88901 r? `@ghost`
2023-01-20Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstriebbors-328/+275
Remove some `ref` patterns from the compiler Previous PR: https://github.com/rust-lang/rust/pull/105368 r? `@Nilstrieb`
2023-01-19Auto merge of #107038 - compiler-errors:dont-wfcheck-non-local-rpit, r=oli-obkbors-1/+12
Don't wf-check non-local RPITs We were using `ty::is_impl_trait_defn(..).is_none()` to check if we need to add WF obligations for an opaque type. This is *supposed* to be checking if the type is a TAIT, since RPITs' wfness is implied by wf checking its parent item, but since `is_impl_trait_defn` returns `None` for non-local RPIT and async futures, we unnecessarily consider wf predicates for an RPIT if it is coming from a foreign crate. Fixes #107036 r? `@oli-obk` but feel free to reassign
2023-01-19Encode whether foreign opaques are TAITs or notMichael Goulet-1/+12
2023-01-19Auto merge of #106910 - aliemjay:alias-ty-in-regionck, r=oli-obkbors-3/+3
even more unify Projection/Opaque handling in region outlives code edit: This continues ate the same pace as #106829. New changes are described in https://github.com/rust-lang/rust/pull/106910#issuecomment-1383251254. ~This touches `OutlivesBound`, `Component`, `GenericKind` enums.~ r? `@oli-obk` (because of overlap with #95474)
2023-01-19even more unify Projection/Opaque in outlives codeAli MJ Al-Nasrawy-3/+3
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
2023-01-17Stop using `BREAK` & `CONTINUE` in compilerScott McMurray-10/+10
Switching them to `Break(())` and `Continue(())` instead. libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-17Rollup merge of #106970 - kylematsuda:earlybinder-item-bounds, r=lcnrMatthias Krüger-3/+7
Switch to `EarlyBinder` for `item_bounds` query Part of the work to finish #105779 (also see https://github.com/rust-lang/types-team/issues/78). Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `item_bounds` query and removes `bound_item_bounds`. r? `@lcnr`
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-47/+47
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17change item_bounds query to return EarlyBinder; remove bound_item_bounds queryKyle Matsuda-3/+7
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-47/+47
2023-01-17Self review suggestionsMaybe Waffle-3/+3
- add back accidentally removed new lines - try to deref in patterns, rather than in expressions (maybe this was the reason of perf regression?...)
2023-01-17Review suggestionsMaybe Waffle-16/+14
2023-01-17`rustc_hir_analysis`: remove `ref` patternsMaybe Waffle-168/+161
2023-01-17`rustc_hir_analysis`: some general code improvementsMaybe Waffle-114/+92
2023-01-17Don't call closures immediately, use `try{}` blocksMaybe Waffle-45/+23
2023-01-17Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorinoMatthias Krüger-14/+6
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-5/+4
2023-01-15Make InstantiatedPredicates impl IntoIteratorMichael Goulet-11/+9
2023-01-15instantiate_own doesn't need to return a pair of vectorsMichael Goulet-12/+13
2023-01-15Rollup merge of #106072 - eopb:dyn-derive, r=estebankMatthias Krüger-1/+7
fix: misleading "add dyn keyword before derive macro" suggestion Fixes #106071
2023-01-14fix: misleading add `dyn` to derive macro suggestionEthan Brierley-1/+7
2023-01-14fix various subst_identity vs skip_binderKyle Matsuda-4/+5
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-35/+34
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-22/+30
2023-01-14change const_param_default query to return EarlyBinder; remove ↵Kyle Matsuda-5/+3
bound_const_param_default query; add EarlyBinder to const_param_default in metadata
2023-01-14change usages of const_param_default query to bound_const_param_defaultKyle Matsuda-2/+2
2023-01-13Unify Opaque/Projection handling in region outlives codeMichael Goulet-14/+6
2023-01-13Suggest lifetime bound in illegal Copy implMichael Goulet-43/+63
2023-01-13Check ADT fields for copy implementations considering regionsMichael Goulet-2/+4
2023-01-13Rollup merge of #106585 - estebank:issue-46585, r=compiler-errorsMatthias Krüger-17/+157
When suggesting writing a fully qualified path probe for appropriate types Address the more common part of #46585.
2023-01-13Rollup merge of #106465 - compiler-errors:bump-IMPLIED_BOUNDS_ENTAILMENT, r=lcnrMatthias Krüger-12/+148
Bump `IMPLIED_BOUNDS_ENTAILMENT` to Deny + ReportNow https://github.com/rust-lang/rust/pull/105575#issuecomment-1357201969 > and then later in the same cycle increase the lint to `deny` and change it to `FutureCompatReportNow` in this nightly cycle. r? ```@lcnr``` when they're back from holiday :smile:
2023-01-13Rollup merge of #106785 - compiler-errors:better-impl-wf-spans, r=estebankYuki Okushi-19/+42
Make blame spans better for impl wfcheck r? types
2023-01-13Add logic to make IMPLIED_BOUNDS_ENTAILMENT easier to understandMichael Goulet-12/+148
2023-01-12Only point at impl self ty in WF if trait predicate shares self tyMichael Goulet-2/+9
2023-01-13Rollup merge of #106759 - compiler-errors:revert-105255, r=cjgillotYuki Okushi-1/+15
Revert "Make nested RPITIT inherit the parent opaque's generics." This reverts commit e2d41f4c974f0cc09e5aafb02883f222487610f9, and adjusts the `tests/ui/async-await/in-trait/nested-rpit.rs` test. r? `@cjgillot` fixes #106332, manually verified because it had no minimization :/ reopens #105197 cc #106729
2023-01-12Point at impl self type for impl wf obligationsMichael Goulet-1/+1
2023-01-12Point at HIR types when impl trait ref doesn't normalizeMichael Goulet-18/+34
2023-01-11Rollup merge of #106739 - WaffleLapkin:astconv, r=estebankMichael Goulet-636/+598
Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)` This removes the need for <>><><><<>> dances and makes the code a bit nicer. Not sure if `astconv` is the best name though, maybe someone has a better idea?
2023-01-12Revert "Make nested RPITIT inherit the parent opaque's generics." and adjust ↵Michael Goulet-1/+15
test This reverts commit e2d41f4c974f0cc09e5aafb02883f222487610f9.
2023-01-11review comments: account for genericsEsteban Küber-2/+6
2023-01-11review commentsEsteban Küber-11/+4
2023-01-11When suggesting writing a fully qualified path probe for appropriate typesEsteban Küber-17/+160
Fix #46585.
2023-01-11Move autoderef to rustc_hir_analysisMichael Goulet-1/+239