Auto merge of #13112 - lowr:patch/auto-trait-bounds, r=Veykril

Setup infra for handling auto trait bounds disabled due to perf problems

This patch updates some of the partially-implemented functions of `ChalkContext as RustIrDatabase`, namely `adt_datum()` and `impl_provided_for()`. With those, we can now correctly work with auto trait bounds and distinguish methods based on them.

Resolves #7856 (the second code; the first one is resolved by #13074)

**IMPORTANT**: I don't think we want to merge this until #7637 is resolved. Currently this patch introduces A LOT of unknown types and type mismtaches as shown below. This is because we cannot resolve items like `hashbrown::HashMap` in `std` modules, leading to auto trait bounds on them and their dependents unprovable.

|crate (from `rustc-perf@c52ee6` except for r-a)|e3dc5a588f07d6f1d3a0f33051d4af26190abe9e|HEAD of this branch|
|---|---|---|
|rust-analyzer @ e3dc5a588f |exprs: 417528, ??ty: 907 (0%), ?ty: 114 (0%), !ty: 1|exprs: 417528, ??ty: 1704 (0%), ?ty: 403 (0%), !ty: 20|
|ripgrep|exprs: 62120, ??ty: 2 (0%), ?ty: 0 (0%), !ty: 0|exprs: 62120, ??ty: 132 (0%), ?ty: 58 (0%), !ty: 11|
|webrender/webrender|exprs: 94355, ??ty: 49 (0%), ?ty: 16 (0%), !ty: 2|exprs: 94355, ??ty: 429 (0%), ?ty: 130 (0%), !ty: 7|
|diesel|exprs: 132591, ??ty: 401 (0%), ?ty: 5129 (3%), !ty: 31|exprs: 132591, ??ty: 401 (0%), ?ty: 5129 (3%), !ty: 31|
This commit is contained in:
bors 2024-02-19 16:45:59 +00:00
commit 2223b4fa71
7 changed files with 262 additions and 102 deletions

View file

@ -124,7 +124,7 @@ impl RootDatabase {
hir::db::InternCoroutineQuery
hir::db::AssociatedTyDataQuery
hir::db::TraitDatumQuery
hir::db::StructDatumQuery
hir::db::AdtDatumQuery
hir::db::ImplDatumQuery
hir::db::FnDefDatumQuery
hir::db::FnDefVarianceQuery

View file

@ -280,7 +280,7 @@ impl RootDatabase {
// hir_db::InternCoroutineQuery
hir_db::AssociatedTyDataQuery
hir_db::TraitDatumQuery
hir_db::StructDatumQuery
hir_db::AdtDatumQuery
hir_db::ImplDatumQuery
hir_db::FnDefDatumQuery
hir_db::FnDefVarianceQuery