about summary refs log tree commit diff
path: root/src/librustc_middle/query
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1551/+0
2020-08-27add projection_ty_from_predicates querycsmoe-0/+4
2020-08-20Auto merge of #75747 - cuviper:rollup-icke90l, r=cuviperbors-2/+2
Rollup of 8 pull requests Successful merges: - #75672 (Move to intra-doc links for task.rs and vec.rs) - #75702 (Clean up E0759 explanation) - #75703 (Enable stack-overflow detection on musl for non-main threads) - #75710 (Fix bad printing of const-eval queries) - #75716 (Upgrade Emscripten on CI to 1.39.20 ) - #75731 (Suppress ty::Float in MIR comments of ty::Const) - #75733 (Remove duplicated alloc vec bench push_all_move) - #75743 (Rename rustc_lexer::TokenKind::Not to Bang) Failed merges: r? @ghost
2020-08-19Fix bad printing of const-eval queriesThibsG-2/+2
2020-08-18TypoOliver Scherer-1/+1
2020-08-18Elaborate docs on the `promoted_mir` queryOliver Scherer-1/+4
2020-08-18Validate the MIR of all optimizations in the mir-opt directoryOliver Scherer-1/+3
2020-08-16Use LocalDefId instead of HirId for reachable_set elements.Eduard-Mihai Burtescu-1/+2
2020-08-13merge `as_local_hir_id` with `local_def_id_to_hir_id`Bastian Kauschke-1/+1
2020-08-06Auto merge of #75008 - eddyb:rmeta-indexed-trait-impls, r=nikomatsakisbors-2/+2
rustc_metadata: track the simplified Self type for every trait impl. For the `traits_impls_of` query, we index the impls by `fast_reject::SimplifiedType` (a "shallow type"), which allows some simple cases like `impl Trait<..> for Foo<..>` to be efficiently iterated over, by e.g. `for_each_relevant_impl`. This PR encodes the `fast_reject::SimplifiedType` cross-crate to avoid needing to deserialize the `Self` type of every `impl` in order to simplify it - the simplification itself should be cheap, but the deserialization is less so. We could go further from here and make loading the list of impls lazy, for a given simplified `Self` type, but that would have more complicated implications for performance, and this PR doesn't do anything in that regard. r? @nikomatsakis cc @Mark-Simulacrum
2020-08-04mir: use `FiniteBitSet<u32>` in polymorphizationDavid Wood-1/+1
This commit changes polymorphization to return a `FiniteBitSet<u32>` rather than a `FiniteBitSet<u64>` because most functions do not use anywhere near sixty-four generic parameters so keeping a `u64` around is unnecessary in most cases. Signed-off-by: David Wood <david@davidtw.co>
2020-08-03Rollup merge of #75054 - cjgillot:rename-depkind, r=petrochenkovYuki Okushi-1/+1
Rename rustc_middle::cstore::DepKind to CrateDepKind It is ambiguous with DepGraph's own DepKind.
2020-08-02Rename rustc_middle::cstore::DepKind to DependencyKind.Camille GILLOT-1/+1
2020-08-01rustc_metadata: track the simplified Self type for every trait impl.Eduard-Mihai Burtescu-2/+2
2020-07-22Normalize opaque types when converting `ParamEnv` to `Reveal::All`Aaron Hill-1/+11
Fixes #65918
2020-07-21Auto merge of #69749 - davidtwco:issue-46477-polymorphization, r=eddybbors-2/+9
Polymorphization This PR implements an analysis to detect when functions could remain polymorphic during code generation. Fixes #46477 r? @eddyb cc @rust-lang/wg-mir-opt @nikomatsakis @pnkfelix
2020-07-20Rollup merge of #74376 - lcnr:type-dependent-path-cleanup, r=eddybManish Goregaokar-1/+5
test caching opt_const_param_of on disc Followup to #74113, implements parts of #74360 Tried caching `opt_const_param_of` on disk and adding an early exit if `tcx.dep_kind(def_id) != DefKind::AnonConst`. Ended up causing a perf regression instead, so we just remove the FIXME and a short note to `opt_const_param_of`. r? @eddyb
2020-07-20index: introduce and use `FiniteBitSet`David Wood-1/+1
This commit introduces a `FiniteBitSet` type which replaces the manual bit manipulation which was being performed in polymorphization. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20mir: `unused_generic_params` queryDavid Wood-0/+7
This commit implements the `unused_generic_params` query, an initial version of polymorphization which detects when an item does not use generic parameters and is being needlessly monomorphized as a result. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20trait_sel: only test predicates w/ no substsDavid Wood-2/+2
This commit modifies the `substitute_normalize_and_test_predicates` query, renaming it to `impossible_predicates` and only checking predicates which do not require substs. By making this change, polymorphization doesn't have to explicitly support vtables. Signed-off-by: David Wood <david@davidtw.co>
2020-07-18add note to `opt_const_param_of`Bastian Kauschke-1/+5
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-7/+7
2020-07-15Auto merge of #74113 - lcnr:type-dependent-consts-2, r=eddybbors-23/+95
Support const args in type dependent paths (Take 2) once more, except it is sound this time :smiling_face_with_three_hearts: previously #71154 ----- ```rust #![feature(const_generics)] struct A; impl A { fn foo<const N: usize>(&self) -> usize { N } } struct B; impl B { fn foo<const N: usize>(&self) -> usize { 42 } } fn main() { let a = A; a.foo::<7>(); } ``` When calling `type_of` for generic const arguments, we now use the `TypeckTables` of the surrounding body to get the expected type. This alone causes cycle errors though, as we now have `typeck_tables_of(main)` -> `...` -> `type_of(main_ANON0 := 7)` -> `typeck_tables_of(main)` :zap: (see https://github.com/rust-lang/rust/issues/68400#issuecomment-611760290) To prevent this we must not call `type_of(const_arg)` during `typeck_tables_of`. This is achieved by calling `type_of(param_def_id)` instead. We have to somehow remember the `DefId` of the param through all of typeck, which is done using the struct `ty::WithOptConstParam<DefId>`, which replaces `DefId` where needed and contains an `Option<DefId>` to be able to store the const parameter in case it exists. Queries which are currently cached on disk are split into two variants: `query_name`(cached) and `query_name_(of|for)_const_arg`(not cached), with `query_name_of_const_arg` taking a pair `(did, param_did): (LocalDefId, DefId)`. For some queries a method `query_name_of_opt_const_arg` is added to `TyCtxt` which takes a `ty::WithOptConstParam` and either calls `query_name` or `query_name_of_const_arg` depending on the value of `const_param_did`. r? @eddyb @varkor
2020-07-15unsafety_check_result_for_const_argBastian Kauschke-1/+1
2020-07-15improve namingBastian Kauschke-7/+7
2020-07-15cleanupBastian Kauschke-4/+12
2020-07-15update promoted_mirBastian Kauschke-2/+2
2020-07-15update const arg queriesBastian Kauschke-18/+18
2020-07-15only call `typeck_tables_of_const_arg` for const argsBastian Kauschke-2/+2
2020-07-15const generics work!Bastian Kauschke-12/+37
2020-07-15continue mir pipelineBastian Kauschke-13/+14
2020-07-15optimized_mirBastian Kauschke-2/+4
2020-07-15typeck all the tablesBastian Kauschke-0/+8
2020-07-15const_eval_resolveBastian Kauschke-0/+9
2020-07-15introduce the query `opt_const_param_of`Bastian Kauschke-0/+19
2020-07-15Change `SymbolName::name` to a `&str`.Nicholas Nethercote-1/+1
This eliminates a bunch of `Symbol::intern()` and `Symbol::as_str()` calls, which is good, because they require locking the interner. Note that the unsafety in `from_cycle_error()` is identical to the unsafety on other adjacent impls.
2020-07-10Avoid "whitelist"Tamir Duberstein-2/+2
Other terms are more inclusive and precise.
2020-07-02Auto merge of #73954 - Manishearth:rollup-8qvh170, r=Manishearthbors-2/+4
Rollup of 10 pull requests Successful merges: - #73414 (Implement `slice_strip` feature) - #73564 (linker: Create GNU_EH_FRAME header by default when producing ELFs) - #73622 (Deny unsafe ops in unsafe fns in libcore) - #73684 (add spans to injected coverage counters, extract with CoverageData query) - #73812 (ast_pretty: Pass some token streams and trees by reference) - #73853 (Add newline to rustc MultiSpan docs) - #73883 (Compile rustdoc less often.) - #73885 (Fix wasm32 being broken due to a NodeJS version bump) - #73903 (Changes required for rustc/cargo to build for iOS targets) - #73938 (Optimise fast path of checked_ops with `unlikely`) Failed merges: r? @ghost
2020-06-30Switch crate_extern_paths to a query, and tweak wording.Eric Huss-0/+4
2020-06-29add spans to injected coverage countersRich Kadel-2/+4
added regions with counter expressions and counters. Added codegen_llvm/coverageinfo mod for upcoming coverage map Move coverage region collection to CodegenCx finalization Moved from `query coverageinfo` (renamed from `query coverage_data`), as discussed in the PR at: https://github.com/rust-lang/rust/pull/73684#issuecomment-649882503 Address merge conflict in MIR instrument_coverage test The MIR test output format changed for int types. moved debug messages out of block.rs This makes the block.rs calls to add coverage mapping data to the CodegenCx much more concise and readable. move coverage intrinsic handling into llvm impl I realized that having half of the coverage intrinsic handling in `rustc_codegen_ssa` and half in `rustc_codegen_llvm` meant that any non-llvm backend would be bound to the same decisions about how the coverage-related MIR terminators should be handled. To fix this, I moved the non-codegen portion of coverage intrinsic handling into its own trait, and implemented it in `rustc_codegen_llvm` alongside `codegen_intrinsic_call`. I also added the (required?) stubs for the new intrinsics to `IntrepretCx::emulate_intrinsic()`, to ensure calls to this function do not fail if called with these new but known intrinsics. address PR Feedback on 28 June 2020 2:48pm PDT
2020-06-27Rollup merge of #73796 - lcnr:LocalDefId, r=matthewjasperManish Goregaokar-13/+13
replace more `DefId`s with `LocalDefId` part of https://github.com/rust-lang/rust/issues/70853
2020-06-27use LocalDefId in module checkingBastian Kauschke-13/+13
2020-06-26Make `fn_arg_names` return `Ident` instead of symbolAaron Hill-1/+1
Also, implement this query for the local crate, not just foreign crates.
2020-06-23Rollup merge of #73488 - richkadel:llvm-coverage-map-gen, r=tmandryManish Goregaokar-0/+6
code coverage foundation for hash and num_counters This PR is the next iteration after PR #73011 (which is still waiting on bors to merge). @wesleywiser - PTAL r? @tmandry (FYI, I'm also working on injecting the coverage maps, in another branch, while waiting for these to merge.) Thanks!
2020-06-22moves coverage data computation from pass to queryRich Kadel-1/+1
2020-06-22Address remaining feedback itemsRich Kadel-1/+1
2020-06-22implemented query for coverage dataRich Kadel-0/+6
This commit adds a query that allows the CoverageData to be pulled from a call on tcx, avoiding the need to change the `codegen_intrinsic_call()` signature (no need to pass in the FunctionCx or any additional arguments. The commit does not change where/when the CoverageData is computed. It's still done in the `pass`, and saved in the MIR `Body`. See discussion (in progress) here: https://github.com/rust-lang/rust/pull/73488#discussion_r443825646
2020-06-22Revert "Rollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, ↵Aaron Hill-1/+1
r=nikomatsakis" This reverts commit 372cb9b69c76a042d0b9d4b48ff6084f64c84a2c, reversing changes made to 5c61a8dc34c3e2fc6d7f02cb288c350f0233f944.
2020-06-20Move bounds on associated types to the typeMatthew Jasper-0/+10
Given `trait X { type U; }` the bound `<Self as X>::U` now lives on the type, rather than the trait. This is feature gated on `feature(generic_associated_types)` for now until more testing can be done. The also enabled type-generic associated types since we no longer need "implies bounds".
2020-06-20Consider fewer predicates for projection candidatesMatthew Jasper-0/+7
We now require that projection candidates are applicable with the idenitity substs of the trait, rather than allowing predicates that are only applicable for certain substs.