Commit ba0e1cd
committed
Auto merge of #25609 - nikomatsakis:const-fn, r=pnkfelix
This is a port of @eddyb's `const-fn` branch. I rebased it, tweaked a few things, and added tests as well as a feature gate. The set of tests is still pretty rudimentary, I'd appreciate suggestions on new tests to write. Also, a double-check that the feature-gate covers all necessary cases.
One question: currently, the feature-gate allows the *use* of const functions from stable code, just not the definition. This seems to fit our usual strategy, and implies that we might (perhaps) allow some constant functions in libstd someday, even before stabilizing const-fn, if we were willing to commit to the existence of const fns but found some details of their impl unsatisfactory.
r? @pnkfelixFile tree
55 files changed
+848
-212
lines changed- src
- librustc_lint
- librustc_resolve
- librustc_trans
- save
- trans
- debuginfo
- librustc_typeck
- check
- librustc
- metadata
- middle
- infer
- librustdoc
- clean
- html
- libsyntax
- ast_map
- ext
- deriving/generic
- parse
- print
- test
- compile-fail
- run-pass
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
55 files changed
+848
-212
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
848 | | - | |
| 848 | + | |
| 849 | + | |
849 | 850 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
387 | 392 | | |
388 | 393 | | |
389 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
181 | 194 | | |
182 | 195 | | |
183 | 196 | | |
| |||
1525 | 1538 | | |
1526 | 1539 | | |
1527 | 1540 | | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
1528 | 1549 | | |
1529 | 1550 | | |
1530 | 1551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
584 | 594 | | |
585 | 595 | | |
586 | 596 | | |
| |||
867 | 877 | | |
868 | 878 | | |
869 | 879 | | |
870 | | - | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
871 | 883 | | |
872 | 884 | | |
873 | 885 | | |
| 886 | + | |
874 | 887 | | |
875 | 888 | | |
876 | 889 | | |
| |||
1049 | 1062 | | |
1050 | 1063 | | |
1051 | 1064 | | |
1052 | | - | |
| 1065 | + | |
1053 | 1066 | | |
1054 | 1067 | | |
1055 | 1068 | | |
| |||
1059 | 1072 | | |
1060 | 1073 | | |
1061 | 1074 | | |
1062 | | - | |
| 1075 | + | |
| 1076 | + | |
1063 | 1077 | | |
1064 | 1078 | | |
1065 | 1079 | | |
1066 | 1080 | | |
1067 | 1081 | | |
| 1082 | + | |
1068 | 1083 | | |
1069 | 1084 | | |
1070 | 1085 | | |
| |||
1967 | 1982 | | |
1968 | 1983 | | |
1969 | 1984 | | |
1970 | | - | |
| 1985 | + | |
1971 | 1986 | | |
1972 | 1987 | | |
1973 | 1988 | | |
| |||
0 commit comments