Commit 574830f
committed
Auto merge of rust-lang#96094 - Elliot-Roberts:fix_doctests, r=compiler-errors
Begin fixing all the broken doctests in `compiler/`
Begins to fix rust-lang#95994.
All of them pass now but 24 of them I've marked with `ignore HELP (<explanation>)` (asking for help) as I'm unsure how to get them to work / if we should leave them as they are.
There are also a few that I marked `ignore` that could maybe be made to work but seem less important.
Each `ignore` has a rough "reason" for ignoring after it parentheses, with
- `(pseudo-rust)` meaning "mostly rust-like but contains foreign syntax"
- `(illustrative)` a somewhat catchall for either a fragment of rust that doesn't stand on its own (like a lone type), or abbreviated rust with ellipses and undeclared types that would get too cluttered if made compile-worthy.
- `(not-rust)` stuff that isn't rust but benefits from the syntax highlighting, like MIR.
- `(internal)` uses `rustc_*` code which would be difficult to make work with the testing setup.
Those reason notes are a bit inconsistently applied and messy though. If that's important I can go through them again and try a more principled approach. When I run `rg '```ignore \(' .` on the repo, there look to be lots of different conventions other people have used for this sort of thing. I could try unifying them all if that would be helpful.
I'm not sure if there was a better existing way to do this but I wrote my own script to help me run all the doctests and wade through the output. If that would be useful to anyone else, I put it here: https://github.com/Elliot-Roberts/rust_doctest_fixing_toolFile tree
116 files changed
+668
-609
lines changed- compiler
- rustc_ast_lowering/src
- rustc_ast_pretty/src
- rustc_ast/src
- rustc_borrowck/src
- diagnostics
- region_infer
- type_check
- rustc_builtin_macros/src
- deriving
- generic
- rustc_codegen_llvm/src
- back
- debuginfo
- rustc_data_structures/src
- obligation_forest
- owning_ref
- rustc_errors/src
- rustc_expand/src/mbe
- rustc_hir/src
- rustc_incremental/src
- rustc_infer/src/infer
- canonical
- error_reporting
- nice_region_error
- outlives
- region_constraints
- rustc_lint_defs/src
- rustc_middle/src
- hir/map
- infer
- mir
- interpret
- traits
- ty
- inhabitedness
- rustc_mir_build/src
- build
- expr
- matches
- thir/pattern
- rustc_mir_dataflow/src/impls
- rustc_mir_transform/src
- rustc_monomorphize/src
- rustc_parse/src/parser
- rustc_query_system/src/dep_graph
- rustc_resolve/src
- late
- rustc_span/src
- rustc_trait_selection/src
- traits
- select
- specialize
- rustc_type_ir/src
- rustc_typeck/src
- astconv
- check
- fn_ctxt
- generator_interior/drop_ranges
- method
- collect
- impl_wf_check
- outlives
- variance
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
116 files changed
+668
-609
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
576 | | - | |
| 576 | + | |
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | | - | |
| 619 | + | |
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
| |||
1363 | 1363 | | |
1364 | 1364 | | |
1365 | 1365 | | |
1366 | | - | |
| 1366 | + | |
1367 | 1367 | | |
1368 | 1368 | | |
1369 | 1369 | | |
| |||
1474 | 1474 | | |
1475 | 1475 | | |
1476 | 1476 | | |
1477 | | - | |
| 1477 | + | |
1478 | 1478 | | |
1479 | 1479 | | |
1480 | 1480 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
923 | | - | |
| 923 | + | |
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
899 | | - | |
900 | | - | |
901 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
902 | 903 | | |
903 | 904 | | |
904 | | - | |
905 | | - | |
906 | | - | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
907 | 909 | | |
908 | 910 | | |
909 | 911 | | |
910 | | - | |
911 | | - | |
912 | | - | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
913 | 916 | | |
914 | 917 | | |
915 | 918 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
749 | | - | |
| 749 | + | |
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | | - | |
441 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
442 | 442 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| |||
1310 | 1310 | | |
1311 | 1311 | | |
1312 | 1312 | | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
1316 | 1316 | | |
1317 | 1317 | | |
1318 | 1318 | | |
| |||
1366 | 1366 | | |
1367 | 1367 | | |
1368 | 1368 | | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1372 | 1372 | | |
1373 | 1373 | | |
1374 | 1374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
971 | 971 | | |
972 | 972 | | |
973 | 973 | | |
974 | | - | |
| 974 | + | |
975 | 975 | | |
976 | 976 | | |
977 | 977 | | |
| |||
0 commit comments