rust/crates/rust-analyzer/src
bors dcd31550e2 Auto merge of #14932 - HKalbasi:dev, r=HKalbasi
Lower const params with a bad id

cc #7434

This PR adds an `InTypeConstId` which is a `DefWithBodyId` and lower const generic parameters into bodies using it, and evaluate them with the mir interpreter. I think this is the last unimplemented const generic feature relative to rustc stable.

But there is a problem: The id used in the `InTypeConstId` is the raw `FileAstId`, which changes frequently. So these ids and their bodies will be invalidated very frequently, which is bad for incremental analysis.

Due this problem, I disabled lowering for local crates (in library crate the id is stable since files won't be changed). This might be overreacting (const generic expressions are usually small, maybe it would be better enabled with bad performance than disabled) but it makes motivation for doing it in the correct way, and it splits the potential panic and breakages that usually comes with const generic PRs in two steps.

Other than the id, I think (at least I hope) other parts are in the right direction.
2023-06-12 08:49:02 +00:00
..
bin Wrap platform-specific QoS in r-a-specific “thread intent” 2023-05-28 20:37:38 +10:00
cli Lower const params with a bad id 2023-06-11 00:39:28 +03:30
config
diagnostics Refactor position 2023-05-06 00:52:32 -07:00
handlers internal: Give rustfmt jobs a separate thread 2023-06-11 19:56:24 +02:00
caps.rs Make WideEncoding non-exhaustive 2023-05-06 00:49:23 -07:00
cargo_target_spec.rs Don't add --all-targets to runnables for no-std crates 2023-05-28 14:18:44 +02:00
cli.rs Count query entries in memory usage command 2023-06-10 01:49:32 +02:00
config.rs Add render configs for memory layout hovers 2023-05-30 18:36:06 +02:00
diagnostics.rs Depend on nohash-hasher individually 2023-05-06 00:49:23 -07:00
diff.rs
dispatch.rs internal: Give rustfmt jobs a separate thread 2023-06-11 19:56:24 +02:00
from_proto.rs Return Option 2023-05-06 00:57:57 -07:00
global_state.rs internal: Give rustfmt jobs a separate thread 2023-06-11 19:56:24 +02:00
integrated_benchmarks.rs Use triomphe Arc 2023-05-02 20:02:43 +03:00
lib.rs internal: Inline handlers module 2023-05-15 11:59:09 +02:00
line_index.rs Use triomphe Arc 2023-05-02 20:02:43 +03:00
lsp_ext.rs Add a localDocs capability 2023-05-02 17:13:21 +02:00
lsp_utils.rs internal: Less file parsing for symbol index generation 2023-05-18 08:25:06 +02:00
main_loop.rs Formatting 2023-06-11 20:11:26 +02:00
markdown.rs
mem_docs.rs
op_queue.rs
reload.rs Fix typo in reload.rs 2023-06-07 20:57:27 +02:00
semantic_tokens.rs Add macro modifier for highlighting tokens in macro calls 2023-05-13 11:43:39 +02:00
task_pool.rs Revert "Add mandatory panic contexts to all threadpool tasks" 2023-06-04 09:30:21 +02:00
to_proto.rs format documentation for SignatureHelpRequests 2023-06-10 09:54:34 -04:00
version.rs