Commit 4a942cd
committed
Auto merge of #146348 - jdonszelmann:eiiv3, r=lcnr,oli-obk
Externally implementable items
Supersedes #140010
Tracking issue: #125418
Getting started:
```rust
#![feature(eii)]
#[eii(eii1)]
pub fn decl1(x: u64)
// body optional (it's the default)
{
println!("default {x}");
}
// in another crate, maybe
#[eii1]
pub fn decl2(x: u64) {
println!("explicit {x}");
}
fn main() {
decl1(4);
}
```
- tiny perf regression, underlying issue makes multiple things in the compiler slow, not just EII, planning to solve those separately.
- No codegen_gcc support, they don't have bindings for weak symbols yet but could
- No windows support yet for weak definitions
This PR merges the implementation of EII for just llvm + not windows, doesn't yet contain like a new panic handler implementation or alloc handler. With this implementation, it would support implementing the panic handler in terms of EII already since it requires no default implementation so no weak symbols
The PR has been open in various forms for about a year now, but I feel that having some implementation merged to build uponFile tree
140 files changed
+3428
-65
lines changed- compiler
- rustc_ast_lowering/src
- rustc_ast_passes/src
- rustc_ast_pretty/src/pprust
- state
- rustc_ast/src
- rustc_attr_parsing/src
- attributes
- rustc_builtin_macros
- src
- deriving/generic
- rustc_codegen_llvm/src
- llvm
- rustc_codegen_ssa/src
- back
- rustc_error_codes/src
- error_codes
- rustc_feature/src
- rustc_hir_analysis
- src
- check
- rustc_hir/src
- attrs
- rustc_interface/src
- rustc_metadata/src
- rmeta
- decoder
- rustc_middle/src
- hir
- middle
- mir
- query
- traits
- rustc_monomorphize/src
- rustc_parse/src/parser
- rustc_passes
- src
- rustc_resolve/src
- rustc_span/src
- rustc_trait_selection/src/error_reporting/traits
- library
- core/src
- macros
- prelude
- std/src/prelude
- src/tools/clippy/clippy_utils/src/ast_utils
- tests/ui
- eii
- auxiliary
- default
- auxiliary
- duplicate
- auxiliary
- error-codes
- feature-gates
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
140 files changed
+3428
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2109 | 2109 | | |
2110 | 2110 | | |
2111 | 2111 | | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
2112 | 2125 | | |
2113 | 2126 | | |
2114 | 2127 | | |
| |||
3748 | 3761 | | |
3749 | 3762 | | |
3750 | 3763 | | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
3751 | 3779 | | |
3752 | 3780 | | |
3753 | 3781 | | |
| |||
4114 | 4142 | | |
4115 | 4143 | | |
4116 | 4144 | | |
4117 | | - | |
| 4145 | + | |
4118 | 4146 | | |
4119 | 4147 | | |
4120 | 4148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
| |||
485 | 486 | | |
486 | 487 | | |
487 | 488 | | |
| 489 | + | |
| 490 | + | |
488 | 491 | | |
489 | 492 | | |
490 | 493 | | |
| |||
919 | 922 | | |
920 | 923 | | |
921 | 924 | | |
922 | | - | |
| 925 | + | |
923 | 926 | | |
924 | 927 | | |
925 | 928 | | |
926 | 929 | | |
927 | | - | |
928 | | - | |
| 930 | + | |
| 931 | + | |
929 | 932 | | |
930 | 933 | | |
931 | 934 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
136 | 210 | | |
137 | 211 | | |
138 | 212 | | |
139 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
140 | 223 | | |
141 | 224 | | |
142 | 225 | | |
143 | 226 | | |
144 | 227 | | |
145 | 228 | | |
146 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
147 | 234 | | |
148 | 235 | | |
149 | 236 | | |
| |||
435 | 522 | | |
436 | 523 | | |
437 | 524 | | |
438 | | - | |
| 525 | + | |
439 | 526 | | |
440 | 527 | | |
441 | 528 | | |
| |||
446 | 533 | | |
447 | 534 | | |
448 | 535 | | |
449 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
450 | 541 | | |
451 | 542 | | |
452 | 543 | | |
| |||
465 | 556 | | |
466 | 557 | | |
467 | 558 | | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
468 | 569 | | |
469 | 570 | | |
470 | 571 | | |
| |||
573 | 674 | | |
574 | 675 | | |
575 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
576 | 681 | | |
577 | 682 | | |
578 | 683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
971 | 971 | | |
972 | 972 | | |
973 | 973 | | |
974 | | - | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
975 | 986 | | |
976 | 987 | | |
977 | | - | |
| 988 | + | |
978 | 989 | | |
| 990 | + | |
979 | 991 | | |
980 | 992 | | |
981 | 993 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
| 1182 | + | |
1182 | 1183 | | |
1183 | 1184 | | |
1184 | 1185 | | |
1185 | 1186 | | |
1186 | 1187 | | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1187 | 1192 | | |
1188 | 1193 | | |
1189 | 1194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
868 | 879 | | |
869 | 880 | | |
870 | 881 | | |
| |||
2162 | 2173 | | |
2163 | 2174 | | |
2164 | 2175 | | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
2165 | 2185 | | |
2166 | 2186 | | |
2167 | 2187 | | |
| |||
2177 | 2197 | | |
2178 | 2198 | | |
2179 | 2199 | | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
2180 | 2206 | | |
2181 | 2207 | | |
2182 | 2208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
674 | | - | |
| 674 | + | |
| 675 | + | |
675 | 676 | | |
676 | 677 | | |
677 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
678 | 693 | | |
679 | 694 | | |
680 | 695 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
0 commit comments