Noah Lev
37ed7a4438
Add ConstArgKind::Path and make ConstArg its own HIR node
...
This is a very large commit since a lot needs to be changed in order to
make the tests pass. The salient changes are:
- `ConstArgKind` gets a new `Path` variant, and all const params are now
represented using it. Non-param paths still use `ConstArgKind::Anon`
to prevent this change from getting too large, but they will soon use
the `Path` variant too.
- `ConstArg` gets a distinct `hir_id` field and its own variant in
`hir::Node`. This affected many parts of the compiler that expected
the parent of an `AnonConst` to be the containing context (e.g., an
array repeat expression). They have been changed to check the
"grandparent" where necessary.
- Some `ast::AnonConst`s now have their `DefId`s created in
rustc_ast_lowering rather than `DefCollector`. This is because in some
cases they will end up becoming a `ConstArgKind::Path` instead, which
has no `DefId`. We have to solve this in a hacky way where we guess
whether the `AnonConst` could end up as a path const since we can't
know for sure until after name resolution (`N` could refer to a free
const or a nullary struct). If it has no chance as being a const
param, then we create a `DefId` in `DefCollector` -- otherwise we
decide during ast_lowering. This will have to be updated once all path
consts use `ConstArgKind::Path`.
- We explicitly use `ConstArgHasType` for array lengths, rather than
implicitly relying on anon const type feeding -- this is due to the
addition of `ConstArgKind::Path`.
- Some tests have their outputs changed, but the changes are for the
most part minor (including removing duplicate or almost-duplicate
errors). One test now ICEs, but it is for an incomplete, unstable
feature and is now tracked at #127009 .
2024-07-16 19:27:28 -07:00
..
2024-07-02 16:28:01 +01:00
2024-02-16 20:02:50 +00:00
2024-03-11 19:42:04 +00:00
2024-02-16 20:02:50 +00:00
2024-06-19 14:58:29 +00:00
2024-02-16 20:02:50 +00:00
2024-06-19 14:58:29 +00:00
2024-07-16 19:27:28 -07:00
2024-06-19 14:58:29 +00:00
2024-07-16 19:27:28 -07:00
2024-03-20 17:29:58 +00:00
2024-07-09 07:44:17 +00:00
2024-03-22 17:12:43 +01:00
2024-06-05 20:08:00 -04:00
2024-03-18 16:08:58 +00:00
2024-03-18 16:08:58 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-07-09 07:44:17 +00:00
2024-07-09 07:44:17 +00:00
2024-01-09 21:08:16 +00:00
2024-01-09 21:08:16 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-01-27 19:26:04 +01:00
2024-03-01 02:03:00 +00:00
2024-01-23 15:23:22 +00:00
2024-01-23 15:23:22 +00:00
2024-07-16 19:27:28 -07:00
2024-07-16 19:27:28 -07:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-06-28 10:57:35 +00:00
2024-07-09 07:44:17 +00:00
2024-07-09 07:44:17 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-21 00:03:59 +00:00
2024-02-14 11:00:30 +00:00
2024-02-16 20:02:50 +00:00
2023-11-30 20:59:51 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-04-10 20:36:14 +00:00
2024-04-10 20:36:14 +00:00
2024-04-10 20:36:14 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-03-18 16:08:58 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-05-05 21:42:54 +01:00
2024-03-18 16:08:58 +00:00
2024-02-16 20:02:50 +00:00
2023-02-16 15:14:45 +11:00
2023-11-24 19:15:52 +01:00
2024-06-05 22:25:42 +01:00
2024-06-05 22:25:42 +01:00
2024-06-05 22:25:42 +01:00
2023-06-01 18:21:42 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-06-18 16:00:57 +08:00
2023-12-24 01:58:13 +08:00
2023-12-24 01:58:13 +08:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-03-21 00:03:59 +00:00
2024-02-16 20:02:50 +00:00
2024-06-12 12:34:47 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-03-21 00:03:59 +00:00
2024-02-16 20:02:50 +00:00
2023-09-28 23:10:04 +00:00
2024-02-16 20:02:50 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-16 20:02:50 +00:00
2023-06-01 18:21:42 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-12-02 10:38:42 +01:00
2023-12-02 10:38:42 +01:00
2023-11-24 19:15:52 +01:00
2024-03-21 20:36:13 +01:00
2024-03-21 20:36:13 +01:00
2024-02-16 20:02:50 +00:00
2023-02-23 10:27:06 -07:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-03-18 16:08:58 +00:00
2024-02-16 20:02:50 +00:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-02-23 10:27:06 -07:00
2023-11-24 19:15:52 +01:00
2023-06-01 18:21:42 +00:00
2023-06-01 18:21:42 +00:00
2024-02-18 19:16:17 -03:00
2024-02-18 19:16:17 -03:00
2024-02-16 20:02:50 +00:00
2024-02-01 16:18:03 +01:00
2023-06-01 18:21:42 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-06-01 18:21:42 +00:00
2023-11-24 19:15:52 +01:00
2023-07-27 15:51:02 +00:00
2024-03-18 16:08:58 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-06-11 16:12:59 +08:00
2023-11-24 19:15:52 +01:00
2024-04-16 11:52:12 +00:00
2024-04-16 11:52:12 +00:00
2024-02-16 20:02:50 +00:00
2024-07-11 20:39:24 +00:00
2024-02-16 20:02:50 +00:00
2023-08-08 14:48:17 +08:00
2024-03-18 16:08:58 +00:00
2024-05-14 20:28:55 +08:00
2024-05-14 20:28:55 +08:00
2024-06-19 04:41:56 +00:00
2024-06-19 04:41:56 +00:00
2023-11-24 19:15:52 +01:00
2024-03-18 16:08:58 +00:00
2024-02-16 20:02:50 +00:00
2024-06-05 22:25:42 +01:00
2024-06-05 22:25:42 +01:00
2024-04-04 15:02:27 +00:00
2024-04-04 15:02:27 +00:00
2024-06-12 08:53:59 +00:00
2024-06-12 08:53:59 +00:00
2023-05-05 21:42:54 +01:00
2023-11-30 20:59:51 +01:00
2024-02-16 20:02:50 +00:00
2023-11-30 20:59:51 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-06-19 14:58:29 +00:00
2024-02-16 20:02:50 +00:00
2024-06-28 10:18:20 -04:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-09-28 23:10:04 +00:00
2024-02-16 20:02:50 +00:00
2024-02-14 11:00:30 +00:00
2024-02-14 11:00:30 +00:00
2024-02-16 20:02:50 +00:00
2024-07-16 19:27:28 -07:00
2024-07-16 19:27:28 -07:00
2024-03-18 16:08:58 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-05-04 11:22:40 +01:00
2023-05-04 11:22:40 +01:00
2023-11-24 19:15:52 +01:00
2024-07-09 07:44:17 +00:00
2024-07-09 07:44:17 +00:00
2024-02-16 20:02:50 +00:00
2023-04-07 11:18:07 -07:00
2023-04-07 11:18:07 -07:00
2024-03-18 16:08:58 +00:00
2024-02-16 20:02:50 +00:00
2024-07-16 19:27:28 -07:00
2024-07-16 19:27:28 -07:00
2024-03-21 10:45:30 +00:00
2024-06-05 23:20:09 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-07-16 19:27:28 -07:00
2024-07-16 19:27:28 -07:00
2024-06-05 22:25:42 +01:00
2024-06-05 22:25:42 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-30 20:12:19 +00:00
2023-01-30 20:12:19 +00:00
2024-02-16 20:02:50 +00:00
2024-06-19 14:58:29 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-01-14 15:49:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-01 16:18:03 +01:00
2024-02-01 16:18:03 +01:00
2023-05-05 21:42:54 +01:00
2023-05-05 21:42:54 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-14 21:04:51 +00:00
2024-02-14 21:04:51 +00:00