about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query
AgeCommit message (Collapse)AuthorLines
2021-01-31Indent the code correctly again after removing the query categories.Julian Wollersberger-1399/+1399
2021-01-31Remove the remains of the query categories.Julian Wollersberger-106/+13
2021-01-25Auto merge of #68828 - oli-obk:inline_cycle, r=wesleywiserbors-0/+21
Prevent query cycles in the MIR inliner r? `@eddyb` `@wesleywiser` cc `@rust-lang/wg-mir-opt` The general design is that we have a new query that is run on the `validated_mir` instead of on the `optimized_mir`. That query is forced before going into the optimization pipeline, so as to not try to read from a stolen MIR. The query should not be cached cross crate, as you should never call it for items from other crates. By its very design calls into other crates can never cause query cycles. This is a pessimistic approach to inlining, since we strictly have more calls in the `validated_mir` than we have in `optimized_mir`, but that's not a problem imo.
2021-01-23Prevent query cycles during inliningoli-0/+21
2021-01-23Iterate to encode def_kind.Camille GILLOT-1/+1
2021-01-17Rollup merge of #80983 - bjorn3:no_dup_is_dllimport_foreign_item, r=nagisaMara Bos-5/+0
Remove is_dllimport_foreign_item definition from cg_ssa It overwrites the definition from rustc_metadata. cc https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/query.20provided.20twice/near/218927806 Marked as draft to test if this breaks anything.
2021-01-16correctly deal with late-bound lifetimes in anon constsBastian Kauschke-1/+1
2021-01-15Auto merge of #80602 - tgnottingham:cratemetadata_you_aint_special, ↵bors-0/+2
r=michaelwoerister Remove DepKind::CrateMetadata and pre-allocation of DepNodes Remove much of the special-case handling around crate metadata dependency tracking by replacing `DepKind::CrateMetadata` and the pre-allocation of corresponding `DepNodes` with on-demand invocation of the `crate_hash` query.
2021-01-13Auto merge of #77524 - Patryk27:fixes/66228, r=estebankbors-0/+9
Rework diagnostics for wrong number of generic args (fixes #66228 and #71924) This PR reworks the `wrong number of {} arguments` message, so that it provides more details and contextual hints.
2021-01-13Remove is_dllimport_foreign_item def from cg_ssabjorn3-5/+0
It overwrites the definition from rustc_metadata
2021-01-12Auto merge of #79670 - Nadrieril:uninhabited-query, r=estebankbors-0/+9
Turn type inhabitedness into a query to fix `exhaustive_patterns` perf We measured in https://github.com/rust-lang/rust/pull/79394 that enabling the [`exhaustive_patterns` feature](https://github.com/rust-lang/rust/issues/51085) causes significant perf degradation. It was conjectured that the culprit is type inhabitedness checking, and [I hypothesized](https://github.com/rust-lang/rust/pull/79394#issuecomment-733861149) that turning this computation into a query would solve most of the problem. This PR turns `tcx.is_ty_uninhabited_from` into a query, and I measured a 25% perf gain on the benchmark that stress-tests `exhaustiveness_patterns`. This more than compensates for the 30% perf hit I measured [when creating it](https://github.com/rust-lang/rustc-perf/pull/801). We'll have to measure enabling the feature again, but I suspect this fixes the perf regression entirely. I'd like a perf run on this PR obviously. I made small atomic commits to help reviewing. The first one is just me discovering the "revisions" feature of the testing framework. I believe there's a push to move things out of `rustc_middle` because it's huge. I guess `inhabitedness/mod.rs` could be moved out, but it's quite small. `DefIdForest` might be movable somewhere too. I don't know what the policy is for that. Ping `@camelid` since you were interested in following along `@rustbot` modify labels: +A-exhaustiveness-checking
2021-01-12Make `DefIdForest` cheaper to cloneNadrieril-1/+1
Since `DefIdForest` contains 0 or 1 elements the large majority of the time, by allocating only in the >1 case we avoid almost all allocations, compared to `Arc<SmallVec<[DefId;1]>>`. This shaves off 0.2% on the benchmark that stresses uninhabitedness checking.
2021-01-12Turn type inhabitedness into a queryNadrieril-0/+9
2021-01-12Prevent potential bug resulting from changing crate_hash query nameTyson Nottingham-0/+2
2021-01-10Rework diagnostics for wrong number of generic argsPatryk Wychowaniec-0/+9
2021-01-04Fix wording of query descriptionoli-1/+1
2021-01-04Small comment adjustmentsoli-1/+0
2021-01-04Differentiate between the availability of ctfe MIR and runtime MIRoli-9/+4
2021-01-04Keep an unoptimized duplicate of `const fn` aroundoli-0/+17
This allows CTFE to reliably detect UB, as otherwise optimizations may hide UB.
2020-12-23Add more comments to trait queriesJoshua Nelson-13/+32
This also adds back a comment that was mistakenly removed in ac9dfc3e7785c9bba96ebac4fd51726189e1bf91.
2020-12-03Combination of commitsRich Kadel-0/+15
Fixes multiple issue with counters, with simplification Includes a change to the implicit else span in ast_lowering, so coverage of the implicit else no longer spans the `then` block. Adds coverage for unused closures and async function bodies. Fixes: #78542 Adding unreachable regions for known MIR missing from coverage map Cleaned up PR commits, and removed link-dead-code requirement and tests Coverage no longer depends on Issue #76038 (`-C link-dead-code` is no longer needed or enforced, so MSVC can use the same tests as Linux and MacOS now) Restrict adding unreachable regions to covered files Improved the code that adds coverage for uncalled functions (with MIR but not-codegenned) to avoid generating coverage in files not already included in the files with covered functions. Resolved last known issue requiring --emit llvm-ir workaround Fixed bugs in how unreachable code spans were added.
2020-12-02Revert "Auto merge of #79209 - spastorino:trait-inheritance-self, ↵Santiago Pastorino-13/+2
r=nikomatsakis" This reverts commit 349b3b324dade7ca638091db93ba08bbc443c63d, reversing changes made to b776d1c3e3db8befabb123ebb1e46c3531eaed46.
2020-11-27Remove super_traits_of query, just leave a helper functionSantiago Pastorino-6/+0
2020-11-27Make super_traits_of return Lrc for cheaper cloneSantiago Pastorino-1/+1
2020-11-27Fix super_predicates_that_define_assoc_type API docSantiago Pastorino-6/+4
2020-11-27adjust super_predicates_that_define_assoc_type query descriptionSantiago Pastorino-1/+4
2020-11-27super_traits_of is now a querySantiago Pastorino-1/+7
2020-11-27Allow to self reference associated types in where clausesSantiago Pastorino-0/+10
2020-11-27Allow to use super trait bounds in where clausesSantiago Pastorino-1/+1
2020-11-25Auto merge of #79411 - tmiasko:naked-params, r=Amanieubors-0/+4
Validate use of parameters in naked functions * Reject use of parameters inside naked function body. * Reject use of patterns inside function parameters, to emphasize role of parameters a signature declaration (mirroring existing behaviour for function declarations) and avoid generating code introducing specified bindings. Closes issues below by considering input to be ill-formed. Closes #75922. Closes #77848. Closes #79350.
2020-11-25Validate use of parameters in naked functionsTomasz Miąsko-0/+4
* Reject use of parameters inside naked function body. * Reject use of patterns inside function parameters, to emphasize role of parameters a signature declaration (mirroring existing behaviour for function declarations) and avoid generating code introducing specified bindings.
2020-11-19Only create `OnDiskCache` in incremental compilation modeAaron Hill-4/+4
This lets us skip doing useless work when we're not in incremental compilation mode.
2020-11-16compiler: fold by valueBastian Kauschke-1/+1
2020-10-27Cache foreign_modules queryRyan Levick-1/+1
2020-10-19Calculate visibilities once in resolveVadim Petrochenkov-0/+1
Then use them through a query based on resolver outputs
2020-10-10Fix query docsCamelid-5/+11
They were not formatted correctly, so rustdoc was interpreting some parts as code. Also cleaned up some other query docs that weren't causing issues, but were formatted incorrectly.
2020-10-06Handle multiple applicable projection candidatesMatthew Jasper-1/+1
2020-10-06Remove predicates on associated types from traitsMatthew Jasper-0/+18
These need to only be bounds to avoid cycle errors in trait checking.
2020-10-06Address review commentsMatthew Jasper-4/+20
2020-10-06Split bounds from predicatesMatthew Jasper-1/+6
2020-10-06Rename projection_predicates to item_boundsMatthew Jasper-2/+2
2020-10-05Record `expansion_that_defined` into crate metadataAaron Hill-0/+5
Fixes #77523 Now that hygiene serialization is implemented, we also need to record `expansion_that_defined` so that we properly handle a foreign `SyntaxContext`.
2020-09-27Remove `rustc_allow_const_fn_ptr`Dylan MacKenzie-4/+0
This was a hack to work around the lack of an escape hatch for the "min `const fn`" checks in const-stable functions. Now that we have co-opted `allow_internal_unstable` for this purpose, we no longer need the bespoke attribute.
2020-09-26Auto merge of #70743 - oli-obk:eager_const_to_pat_conversion, r=eddybbors-0/+8
Fully destructure constants into patterns r? `@varkor` as discussed in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/constants.20in.20patterns/near/192789924 we should probably crater it once reviewed
2020-09-24Auto merge of #77006 - oli-obk:🐌_const_queries, r=Mark-Simulacrumbors-4/+2
Cache `eval_to_allocation_raw` on disk https://github.com/rust-lang/rust/pull/74949#issuecomment-695833161 regressed the performance on these queries, this PR gets the perf back.
2020-09-24Always cache const eval queriesOliver Scherer-8/+2
2020-09-24Auto merge of #76820 - jyn514:query-comments, r=davidtwcobors-24/+24
Preserve doc-comments when generating queries Closes https://github.com/rust-lang/rust/issues/76812
2020-09-23Rollup merge of #76939 - lcnr:const-evaluatable-cont, r=oli-obkDylan DPC-2/+2
emit errors during AbstractConst building There changes are currently still untested, so I don't expect this to pass CI :laughing: It seems to me like this is the direction we want to go in, though we didn't have too much of a discussion about this. r? @oli-obk
2020-09-21Cache `eval_to_allocation_raw` on diskOliver Scherer-0/+4
2020-09-20Add a query for dereferencing constants of reference typeOliver Scherer-0/+8