Commit 37ed7a4
committed
Add
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 rust-lang#127009.ConstArgKind::Path and make ConstArg its own HIR node1 parent 1c49d40 commit 37ed7a4
File tree
61 files changed
+541
-414
lines changed- compiler
- rustc_ast_lowering/src
- rustc_hir_analysis/src
- collect
- hir_ty_lowering
- rustc_hir_pretty/src
- rustc_hir_typeck/src/fn_ctxt
- rustc_hir/src
- rustc_middle/src
- hir/map
- ty
- rustc_resolve/src
- rustc_trait_selection/src/traits
- src
- librustdoc/clean
- tools/clippy
- clippy_lints/src/utils
- clippy_utils/src
- tests/ui
- author
- tests
- crashes
- ui-fulldeps/stable-mir
- ui
- coherence/negative-coherence
- const-generics
- generic_const_exprs
- issues
- consts
- lifetimes
- rfcs/rfc-2632-const-trait-impl
- specialization
- min_specialization
- stats
- traits/non_lifetime_binders
- transmutability
- typeck/issue-114918
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
61 files changed
+541
-414
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
234 | 237 | | |
235 | 238 | | |
236 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
| |||
380 | 385 | | |
381 | 386 | | |
382 | 387 | | |
383 | | - | |
384 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
385 | 393 | | |
386 | 394 | | |
387 | 395 | | |
| |||
616 | 624 | | |
617 | 625 | | |
618 | 626 | | |
| 627 | + | |
619 | 628 | | |
620 | 629 | | |
621 | 630 | | |
| |||
666 | 675 | | |
667 | 676 | | |
668 | 677 | | |
669 | | - | |
670 | | - | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
671 | 681 | | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
678 | 688 | | |
679 | | - | |
| 689 | + | |
| 690 | + | |
680 | 691 | | |
681 | 692 | | |
682 | 693 | | |
683 | 694 | | |
684 | | - | |
| 695 | + | |
685 | 696 | | |
686 | 697 | | |
687 | 698 | | |
| |||
960 | 971 | | |
961 | 972 | | |
962 | 973 | | |
| 974 | + | |
963 | 975 | | |
964 | 976 | | |
965 | 977 | | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
984 | 998 | | |
985 | 999 | | |
986 | 1000 | | |
987 | 1001 | | |
988 | 1002 | | |
989 | 1003 | | |
990 | 1004 | | |
991 | | - | |
| 1005 | + | |
992 | 1006 | | |
993 | 1007 | | |
994 | 1008 | | |
| |||
1060 | 1074 | | |
1061 | 1075 | | |
1062 | 1076 | | |
| 1077 | + | |
1063 | 1078 | | |
1064 | 1079 | | |
1065 | 1080 | | |
| |||
1069 | 1084 | | |
1070 | 1085 | | |
1071 | 1086 | | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
1086 | 1102 | | |
1087 | | - | |
1088 | | - | |
| 1103 | + | |
| 1104 | + | |
1089 | 1105 | | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1093 | 1110 | | |
1094 | 1111 | | |
1095 | 1112 | | |
| |||
1100 | 1117 | | |
1101 | 1118 | | |
1102 | 1119 | | |
1103 | | - | |
| 1120 | + | |
1104 | 1121 | | |
1105 | 1122 | | |
1106 | 1123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| |||
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
247 | 257 | | |
248 | 258 | | |
249 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
1631 | 1634 | | |
1632 | 1635 | | |
1633 | 1636 | | |
| 1637 | + | |
1634 | 1638 | | |
1635 | | - | |
| 1639 | + | |
1636 | 1640 | | |
1637 | 1641 | | |
1638 | 1642 | | |
| |||
1657 | 1661 | | |
1658 | 1662 | | |
1659 | 1663 | | |
| 1664 | + | |
1660 | 1665 | | |
1661 | 1666 | | |
1662 | 1667 | | |
| |||
0 commit comments