summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/context.rs
AgeCommit message (Collapse)AuthorLines
2021-07-20Support HIR wf checking for function signaturesAaron Hill-1/+1
During function type-checking, we normalize any associated types in the function signature (argument types + return type), and then create WF obligations for each of the normalized types. The HIR wf code does not currently support this case, so any errors that we get have imprecise spans. This commit extends `ObligationCauseCode::WellFormed` to support recording a function parameter, allowing us to get the corresponding HIR type if an error occurs. Function typechecking is modified to pass this information during signature normalization and WF checking. The resulting code is fairly verbose, due to the fact that we can no longer normalize the entire signature with a single function call. As part of the refactoring, we now perform HIR-based WF checking for several other 'typed items' (statics, consts, and inherent impls). As a result, WF and projection errors in a function signature now have a precise span, which points directly at the responsible type. If a function signature is constructed via a macro, this will allow the error message to point at the code 'most responsible' for the error (e.g. a user-supplied macro argument).
2021-07-18Remove deadlock virtual call.Camille GILLOT-1/+1
2021-07-18Move OnDiskCache to rustc_query_impl.Camille GILLOT-10/+50
2021-07-14Shrink the CrateStore dynamic interface.Camille GILLOT-7/+2
2021-07-06Correct comments about untracked accesses.Camille GILLOT-5/+5
2021-07-06Make resolutions a query.Camille GILLOT-58/+46
2021-07-06Make tcx.stable_crate_id() fasterbjorn3-2/+6
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-6/+6
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-07-04Combine individual limit queries into single `limits` queryAaron Hill-0/+17
2021-07-01Auto merge of #86749 - bjorn3:link_info_refactor_part1, r=petrochenkovbors-5/+1
Rename all_crate_nums query to crates and remove useless wrapper Split out of https://github.com/rust-lang/rust/pull/86105 r? `@petrochenkov`
2021-07-01Rename all_crate_nums query to crates and remove useless wrapperbjorn3-5/+1
2021-06-30Auto merge of #86695 - sexxi-goose:closure_size, r=nikomatsakisbors-5/+13
Introduce -Zprofile-closures to evaluate the impact of 2229 This creates a CSV with name "closure_profile_XXXXX.csv", where the variable part is the process id of the compiler. To profile a cargo project you can run one of the following depending on if you're compiling a library or a binary: ``` cargo +nightly rustc --lib -- -Zprofile-closures cargo +nightly rustc --bin {binary_name} -- -Zprofile-closures ``` r? `@nikomatsakis`
2021-06-29Auto merge of #86475 - crlf0710:miri_vtable_refactor, r=bjorn3bors-1/+5
Change vtable memory representation to use tcx allocated allocations. This fixes https://github.com/rust-lang/rust/issues/86324. However i suspect there's more to change before it can land. r? `@bjorn3` cc `@rust-lang/miri`
2021-06-28Introduce -Zprofile-closures to evaluate the impact of 2229Aman Arora-5/+13
This creates a CSV with name "closure_profile_XXXXX.csv", where the variable part is the process id of the compiler. To profile a cargo project you can run one of the following depending on if you're compiling a library or a binary: ``` cargo +stage1 rustc --lib -- -Zprofile-closures cargo +stage1 rustc --bin -- -Zprofile-closures ```
2021-06-28Update other codegens to use tcx managed vtable allocations.Charles Lew-1/+5
2021-06-28Auto merge of #85909 - cjgillot:alloc-kind-query, r=Aaron1011bors-5/+0
Make allocator_kind a query. Part of #85153 r? `@Aaron1011`
2021-06-24Prefer "allow list" structure to check a typeYuki Okushi-18/+8
2021-06-24Rename function name in commentsYuki Okushi-3/+3
2021-06-24Do not panic in `return_type_impl_trait`Yuki Okushi-0/+7
2021-06-20Implement the query in cstore_impl.Camille GILLOT-1/+0
2021-06-20Make allocator_kind a query.Camille GILLOT-5/+1
2021-06-18add various coments to explain how the code worksNiko Matsakis-0/+28
2021-06-17Auto merge of #85834 - cjgillot:save-sbi, r=michaelwoeristerbors-0/+6
Encode CrateNum using the StableCrateId for incr. comp.
2021-06-10Auto merge of #85910 - cjgillot:no-meta-version, r=Aaron1011bors-4/+0
Drop metadata_encoding_version. Part of #85153 r? `@Aaron1011`
2021-06-09Access stable_crate_id directly.Camille GILLOT-0/+6
2021-06-09Auto merge of #86118 - spastorino:tait-soundness-bug, r=nikomatsakisbors-12/+3
Create different inference variables for different defining uses of TAITs Fixes #73481 r? `@nikomatsakis` cc `@oli-obk`
2021-06-07Remove ResolvedOpaqueTy and just use Ty, SubstsRef is already thereSantiago Pastorino-12/+1
2021-06-07Make OpaqueTypeKey the key of opaque types mapSantiago Pastorino-1/+2
2021-06-07Change concrete opaque type to be a `VecMap`Santiago Pastorino-1/+2
2021-06-07Revert "Merge CrateDisambiguator into StableCrateId"bjorn3-6/+6
This reverts commit d0ec85d3fb6d322496cb8f4bc1c21e19f23284ad.
2021-06-03Rollup merge of #85911 - cjgillot:one-output, r=Aaron1011Yuki Okushi-2/+2
Avoid a clone of output_filenames. Part of #85153
2021-06-02Restrict access to crate_name.Camille GILLOT-1/+1
Also remove original_crate_name, which had the exact same implementation
2021-06-02Auto merge of #85908 - cjgillot:private-dep-query, r=Aaron1011bors-6/+0
Make is_private_dep a query. Part of #85153 r? `@Aaron1011`
2021-06-01Avoid a clone of output_filenames.Camille GILLOT-2/+2
2021-06-01Drop metadata_encoding_version.Camille GILLOT-4/+0
2021-06-01Make is_private_dep a query.Camille GILLOT-6/+0
2021-06-01Remove StableVec.Camille GILLOT-3/+5
2021-06-01Only compute the trait_map once.Camille GILLOT-12/+1
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-60/+90
2021-05-30Drop metadata_encoding_version.Camille GILLOT-4/+0
2021-05-30Correct comments about untracked accesses.Camille GILLOT-5/+5
2021-05-30Make is_private_dep a query.Camille GILLOT-10/+4
2021-05-30Make allocator_kind a query.Camille GILLOT-5/+1
2021-05-30Avoid a clone of output_filenames.Camille GILLOT-2/+2
2021-05-30Remove StableVec.Camille GILLOT-3/+5
2021-05-30Restrict access to crate_name.Camille GILLOT-1/+1
Also remove original_crate_name, which had the exact same implementation
2021-05-30Make resolutions a query.Camille GILLOT-59/+52
2021-05-30Only compute the trait_map once.Camille GILLOT-12/+1
2021-05-30Merge CrateDisambiguator into StableCrateIdbjorn3-6/+6
2021-05-25Auto merge of #85273 - LeSeulArtichaut:thir-query, r=nikomatsakisbors-0/+5
Make building THIR a stealable query This PR creates a stealable `thir_body` query so that we can build the THIR only once for THIR unsafeck and MIR build. Blocked on #83842. r? `@nikomatsakis`