rust/crates
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
..
base-db Lower const params with a bad id 2023-06-11 00:39:28 +03:30
cfg Allow setting cfgs 2023-05-28 13:43:21 +02:00
flycheck Wrap platform-specific QoS in r-a-specific “thread intent” 2023-05-28 20:37:38 +10:00
hir Auto merge of #14932 - HKalbasi:dev, r=HKalbasi 2023-06-12 08:49:02 +00:00
hir-def Add a bunch of fixme comments 2023-06-12 00:37:11 +03:30
hir-expand Use ConstArg instead of Expr for AstId of InTypeConstId 2023-06-11 00:39:28 +03:30
hir-ty Add a bunch of fixme comments 2023-06-12 00:37:11 +03:30
ide Lower const params with a bad id 2023-06-11 00:39:28 +03:30
ide-assists Auto merge of #14932 - HKalbasi:dev, r=HKalbasi 2023-06-12 08:49:02 +00:00
ide-completion fix(completion): derive source scope from syntax node to be transformed 2023-06-11 15:25:43 +09:00
ide-db Lower const params with a bad id 2023-06-11 00:39:28 +03:30
ide-diagnostics Fix missing terminator for slice pattern 2023-06-04 20:59:27 +03:30
ide-ssr internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
intern Remove double lookups from Interned 2023-05-24 12:54:25 +02:00
limit Move Expander and LowerCtx into separate modules 2023-04-17 20:44:06 +02:00
mbe Implement ${count()} metavariable expression 2023-05-28 19:54:36 +09:00
parser Use ConstArg instead of Expr for AstId of InTypeConstId 2023-06-11 00:39:28 +03:30
paths Add AbsPath::absolutize 2023-05-13 11:51:28 +02:00
proc-macro-api Merge remote-tracking branch 'upstream/master' into sync-from-rust 2023-06-05 11:07:47 +03:00
proc-macro-srv Add span to group. 2023-06-07 08:48:19 -05:00
proc-macro-srv-cli Remove proc-macro server command from the rust-analyzer binary 2023-04-26 08:19:28 +02:00
proc-macro-test ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
profile internal: Add some additional status ouput 2023-04-22 09:34:47 +02:00
project-model Lower const params with a bad id 2023-06-11 00:39:28 +03:30
rust-analyzer Auto merge of #14932 - HKalbasi:dev, r=HKalbasi 2023-06-12 08:49:02 +00:00
sourcegen Use retain_mut in CommentBlock::extract 2023-03-31 17:41:40 -04:00
stdx Wrap platform-specific QoS in r-a-specific “thread intent” 2023-05-28 20:37:38 +10:00
syntax Use ConstArg instead of Expr for AstId of InTypeConstId 2023-06-11 00:39:28 +03:30
test-utils Lower const params with a bad id 2023-06-11 00:39:28 +03:30
text-edit Make text-size a workspace dep 2023-05-06 00:49:23 -07:00
toolchain ⬆️ rust-analyzer 2023-03-13 10:42:24 +02:00
tt Emit function bodies in expanding builtin derives 2023-05-03 14:14:47 +03:30
vfs Auto merge of #14755 - poliorcetics:clippy-fixes, r=Veykril 2023-05-24 11:13:52 +00:00
vfs-notify Wrap platform-specific QoS in r-a-specific “thread intent” 2023-05-28 20:37:38 +10:00