Uh oh!
There was an error while loading. Please reload this page.
Support const args in type dependent paths (Take 2) - #74113
Conversation
Uh oh!
There was an error while loading. Please reload this page.
0c5695a to
1e02449Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Jul 7, 2020
Queued e4220b3fb9c17c338cf69c14e8f91a7803b0d0b5 with parent 0c03aee, future comparison URL. |
Uh oh!
There was an error while loading. Please reload this page.
rust-timer
commented
Jul 7, 2020
Finished benchmarking try commit (e4220b3fb9c17c338cf69c14e8f91a7803b0d0b5): comparison url. |
6fa206c to
26ad65eComparelcnr
commented
Jul 7, 2020
@bors try @rust-timer queue |
rust-timer
commented
Jul 7, 2020
Awaiting bors try build completion |
bors
commented
Jul 7, 2020
⌛ Trying commit 26ad65e7ac660a24f37813cb754fcaa1db0d9940 with merge b68a4014ccd7f0a6a24bd4662f34b565ca658c28... |
lcnr
commented
Jul 7, 2020
@rust-timer build b68a4014ccd7f0a6a24bd4662f34b565ca658c28 |
rust-timer
commented
Jul 7, 2020
Queued b68a4014ccd7f0a6a24bd4662f34b565ca658c28 with parent 70f9d23, future comparison URL. |
rust-timer
commented
Jul 7, 2020
Finished benchmarking try commit (b68a4014ccd7f0a6a24bd4662f34b565ca658c28): comparison url. |
lcnr
commented
Jul 7, 2020
@bors try @rust-timer queue |
rust-timer
commented
Jul 7, 2020
Awaiting bors try build completion |
bors
commented
Jul 7, 2020
⌛ Trying commit 26f789f87b073a641d599e24c47d69d22b27c5a0 with merge 38457fb462ba475360cbcca5d21700c4e9b76596... |
bors
commented
Jul 8, 2020
☀️ Try build successful - checks-actions, checks-azure |
…=eddyb test caching opt_const_param_of on disc Followup to rust-lang#74113, implements parts of rust-lang#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
nnethercote
commented
Jul 21, 2020
This was a small perf loss, as expected. |
remove some const arg in ty dep path boilerplate followup to rust-lang#74113, together with rust-lang#74376, this closesrust-lang#74360. r? @eddyb
add `slice::array_chunks` to std Now that rust-lang#74113 has landed, these methods are suddenly usable. A rebirth of rust-lang#72334 Tests are directly copied from `chunks_exact` and some additional tests for type inference. r? @withoutboats as you are both part of t-libs and working on const generics. closesrust-lang#60735
once more, except it is sound this time 🥰 previously #71154
When calling
type_offor generic const arguments, we now use theTypeckTablesof 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)⚡ (see #68400 (comment))To prevent this we must not call
type_of(const_arg)duringtypeck_tables_of. This is achieved bycalling
type_of(param_def_id)instead.We have to somehow remember the
DefIdof the param through all of typeck, which is done using thestruct
ty::WithOptConstParam<DefId>, which replacesDefIdwhere needed and contains anOption<DefId>tobe 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) andquery_name_(of|for)_const_arg(not cached), withquery_name_of_const_argtaking a pair(did, param_did): (LocalDefId, DefId).For some queries a method
query_name_of_opt_const_argis added toTyCtxtwhich takes aty::WithOptConstParamand either callsquery_nameorquery_name_of_const_argdepending on the value ofconst_param_did.r? @eddyb@varkor