interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / vendor / syn-2.0.119 / tests / repo / mod.rs

1023 lines · 50798 bytes Raw Blame History
1#![allow(clippy::manual_assert)]
2
3mod progress;
4
5use self::progress::Progress;
6use anyhow::Result;
7use flate2::read::GzDecoder;
8use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
9use rayon::ThreadPoolBuilder;
10use std::collections::BTreeSet;
11use std::env;
12use std::ffi::OsStr;
13use std::fs;
14use std::path::{Path, PathBuf};
15use tar::Archive;
16use walkdir::{DirEntry, WalkDir};
17
18// nightly-2026-07-13
19const REVISION: &str = "77cf889bc178ddb44d6a1c78e5a820b5abb31d8d";
20
21#[rustfmt::skip]
22static EXCLUDE_FILES: &[&str] = &[
23 // TODO: const traits: `pub const trait Trait {}`
24 // https://github.com/dtolnay/syn/issues/1887
25 "library/core/src/alloc/mod.rs",
26 "library/core/src/borrow.rs",
27 "library/core/src/clone.rs",
28 "library/core/src/cmp.rs",
29 "library/core/src/cmp/bytewise.rs",
30 "library/core/src/convert/mod.rs",
31 "library/core/src/default.rs",
32 "library/core/src/intrinsics/fallback.rs",
33 "library/core/src/iter/range.rs",
34 "library/core/src/iter/traits/accum.rs",
35 "library/core/src/iter/traits/collect.rs",
36 "library/core/src/iter/traits/double_ended.rs",
37 "library/core/src/iter/traits/iterator.rs",
38 "library/core/src/iter/traits/marker.rs",
39 "library/core/src/ops/arith.rs",
40 "library/core/src/ops/bit.rs",
41 "library/core/src/ops/deref.rs",
42 "library/core/src/ops/drop.rs",
43 "library/core/src/ops/function.rs",
44 "library/core/src/ops/index.rs",
45 "library/core/src/ops/range.rs",
46 "library/core/src/ops/try_trait.rs",
47 "library/core/src/pat.rs",
48 "library/core/src/slice/mod.rs",
49 "library/stdarch/crates/core_arch/src/loongarch64/simd.rs",
50 "src/tools/clippy/tests/ui/assign_ops.rs",
51 "src/tools/clippy/tests/ui/missing_const_for_fn/const_trait.rs",
52 "src/tools/clippy/tests/ui/trait_duplication_in_bounds.rs",
53 "src/tools/rust-analyzer/crates/test-utils/src/minicore.rs",
54 "src/tools/rustfmt/tests/target/const_trait.rs",
55 "tests/rustdoc-html/constant/const-effect-param.rs",
56 "tests/rustdoc-html/constant/const-trait-and-impl-methods.rs",
57 "tests/rustdoc-html/constant/rfc-2632-const-trait-impl.rs",
58 "tests/rustdoc-html/inline_cross/auxiliary/const-effect-param.rs",
59 "tests/rustdoc-json/attrs/stability/const_traits.rs",
60 "tests/ui/const-generics/const_trait_fn-issue-88433.rs",
61 "tests/ui/const-generics/issues/issue-88119.rs",
62 "tests/ui/consts/const-closure-in-trait-impl.rs",
63 "tests/ui/consts/trait_alias_method_call.rs",
64 "tests/ui/generic-const-items/const-trait-impl.rs",
65 "tests/ui/parser/impls-nested-within-fns-semantic-1.rs",
66 "tests/ui/traits/const-traits/assoc-type-const-bound-usage-0.rs",
67 "tests/ui/traits/const-traits/assoc-type-const-bound-usage-1.rs",
68 "tests/ui/traits/const-traits/auxiliary/associated-const-stability.rs",
69 "tests/ui/traits/const-traits/auxiliary/cross-crate.rs",
70 "tests/ui/traits/const-traits/auxiliary/minicore.rs",
71 "tests/ui/traits/const-traits/auxiliary/staged-api.rs",
72 "tests/ui/traits/const-traits/call-generic-in-impl.rs",
73 "tests/ui/traits/const-traits/conditionally-const-assoc-fn-in-trait-impl.rs",
74 "tests/ui/traits/const-traits/conditionally-const-inherent-assoc-const-fn.rs",
75 "tests/ui/traits/const-traits/conditionally-const-trait-bound-assoc-tys.rs",
76 "tests/ui/traits/const-traits/const-assoc-bound-in-trait-wc.rs",
77 "tests/ui/traits/const-traits/const-bound-in-host.rs",
78 "tests/ui/traits/const-traits/const-closure-inherited-const-condition.rs",
79 "tests/ui/traits/const-traits/const-closure-trait-method.rs",
80 "tests/ui/traits/const-traits/const-cond-for-rpitit.rs",
81 "tests/ui/traits/const-traits/const-impl-inherent-bounds.rs",
82 "tests/ui/traits/const-traits/const-impl-recovery.rs",
83 "tests/ui/traits/const-traits/const-impl-trait-not-impl-const-trait.rs",
84 "tests/ui/traits/const-traits/const-impl-trait.rs",
85 "tests/ui/traits/const-traits/const-in-closure.rs",
86 "tests/ui/traits/const-traits/const-via-item-bound.rs",
87 "tests/ui/traits/const-traits/default-method-body-is-const-with-staged-api.rs",
88 "tests/ui/traits/const-traits/do-not-const-check-override.rs",
89 "tests/ui/traits/const-traits/do-not-const-check.rs",
90 "tests/ui/traits/const-traits/dont-ice-on-const-pred-for-bounds.rs",
91 "tests/ui/traits/const-traits/dont-observe-host.rs",
92 "tests/ui/traits/const-traits/dont-prefer-param-env-for-infer-self-ty.rs",
93 "tests/ui/traits/const-traits/effect-param-infer.rs",
94 "tests/ui/traits/const-traits/function-pointer-does-not-require-const.rs",
95 "tests/ui/traits/const-traits/hir-const-check.rs",
96 "tests/ui/traits/const-traits/impl-with-default-fn-pass.rs",
97 "tests/ui/traits/const-traits/imply-always-const.rs",
98 "tests/ui/traits/const-traits/inherent-impl-const-bounds.rs",
99 "tests/ui/traits/const-traits/issue-100222.rs",
100 "tests/ui/traits/const-traits/issue-92230-wf-super-trait-env.rs",
101 "tests/ui/traits/const-traits/item-bound-entailment.rs",
102 "tests/ui/traits/const-traits/non-const-op-in-closure-in-const.rs",
103 "tests/ui/traits/const-traits/parse-const-unsafe-trait.rs",
104 "tests/ui/traits/const-traits/predicate-entailment-passes.rs",
105 "tests/ui/traits/const-traits/project.rs",
106 "tests/ui/traits/const-traits/specialization/const-default-const-specialized.rs",
107 "tests/ui/traits/const-traits/specialization/default-keyword.rs",
108 "tests/ui/traits/const-traits/specialization/issue-95187-same-trait-bound-different-constness.rs",
109 "tests/ui/traits/const-traits/specialization/non-const-default-const-specialized.rs",
110 "tests/ui/traits/const-traits/specialization/pass.rs",
111 "tests/ui/traits/const-traits/specialization/specialize-on-conditionally-const.rs",
112 "tests/ui/traits/const-traits/super-traits.rs",
113 "tests/ui/traits/const-traits/trait-where-clause-run.rs",
114 "tests/ui/traits/const-traits/trait-where-clause-self-referential.rs",
115 "tests/ui/traits/const-traits/unconstrained-var-specialization.rs",
116 "tests/ui/traits/next-solver/canonical/effect-var.rs",
117
118 // TODO: const impls: `const impl Trait for T {}`
119 // https://github.com/dtolnay/syn/issues/1980
120 "compiler/rustc_data_structures/src/unord.rs",
121 "compiler/rustc_middle/src/middle/codegen_fn_attrs.rs",
122 "library/alloc/src/alloc.rs",
123 "library/alloc/src/collections/btree/map.rs",
124 "library/alloc/src/collections/mod.rs",
125 "library/alloc/src/raw_vec/mod.rs",
126 "library/alloc/src/string.rs",
127 "library/alloc/src/vec/mod.rs",
128 "library/core/src/any.rs",
129 "library/core/src/array/drain.rs",
130 "library/core/src/array/equality.rs",
131 "library/core/src/array/mod.rs",
132 "library/core/src/bstr/mod.rs",
133 "library/core/src/cell.rs",
134 "library/core/src/cell/lazy.rs",
135 "library/core/src/cell/once.rs",
136 "library/core/src/char/convert.rs",
137 "library/core/src/ffi/c_str.rs",
138 "library/core/src/ffi/va_list.rs",
139 "library/core/src/hash/mod.rs",
140 "library/core/src/hash/sip.rs",
141 "library/core/src/iter/adapters/cycle.rs",
142 "library/core/src/iter/adapters/flatten.rs",
143 "library/core/src/iter/sources/empty.rs",
144 "library/core/src/marker.rs",
145 "library/core/src/mem/alignment.rs",
146 "library/core/src/mem/drop_guard.rs",
147 "library/core/src/mem/manually_drop.rs",
148 "library/core/src/net/ip_addr.rs",
149 "library/core/src/net/socket_addr.rs",
150 "library/core/src/num/error.rs",
151 "library/core/src/num/niche_types.rs",
152 "library/core/src/ops/control_flow.rs",
153 "library/core/src/option.rs",
154 "library/core/src/panic/unwind_safe.rs",
155 "library/core/src/pin.rs",
156 "library/core/src/pin/unsafe_pinned.rs",
157 "library/core/src/ptr/non_null.rs",
158 "library/core/src/ptr/unique.rs",
159 "library/core/src/range.rs",
160 "library/core/src/result.rs",
161 "library/core/src/slice/cmp.rs",
162 "library/core/src/slice/index.rs",
163 "library/core/src/str/mod.rs",
164 "library/core/src/str/traits.rs",
165 "library/core/src/sync/sync_view.rs",
166 "library/core/src/task/poll.rs",
167 "library/core/src/task/wake.rs",
168 "library/core/src/time.rs",
169 "library/coretests/tests/array.rs",
170 "library/coretests/tests/cmp.rs",
171 "library/coretests/tests/hint.rs",
172 "library/coretests/tests/manually_drop.rs",
173 "library/std/src/collections/hash/map.rs",
174 "library/std/src/collections/hash/set.rs",
175 "library/std/src/ffi/os_str.rs",
176 "library/std/src/hash/random.rs",
177 "library/std/src/path.rs",
178 "library/std/src/sync/lazy_lock.rs",
179 "library/std/src/sync/once_lock.rs",
180 "library/stdarch/crates/core_arch/src/simd.rs",
181 "src/tools/clippy/tests/ui/derivable_impls.rs",
182 "src/tools/clippy/tests/ui/derivable_impls_derive_const.rs",
183 "src/tools/clippy/tests/ui/equatable_if_let_const_cmp.rs",
184 "src/tools/rustfmt/tests/source/impls.rs",
185 "src/tools/rustfmt/tests/target/impls.rs",
186 "tests/ui/consts/const-try.rs",
187 "tests/ui/traits/const-traits/call-const-trait-method-pass.rs",
188 "tests/ui/traits/const-traits/call-generic-method-chain.rs",
189 "tests/ui/traits/const-traits/call-generic-method-dup-bound.rs",
190 "tests/ui/traits/const-traits/call-generic-method-pass.rs",
191 "tests/ui/traits/const-traits/const-drop.rs",
192 "tests/ui/traits/const-traits/const-impl-inherent.rs",
193 "tests/ui/traits/const-traits/const-unsafe-impl.rs",
194 "tests/ui/traits/const-traits/const_derives/derive-const-use.rs",
195 "tests/ui/traits/const-traits/drop-manually-drop.rs",
196 "tests/ui/traits/const-traits/enforce-deref-on-adjust.rs",
197 "tests/ui/traits/const-traits/generic-bound.rs",
198 "tests/ui/traits/const-traits/inherent-impl.rs",
199 "tests/ui/traits/const-traits/minicore-works.rs",
200 "tests/ui/traits/const-traits/rustc-impl-const-stability.rs",
201 "tests/ui/traits/const-traits/trait-default-body-stability.rs",
202
203 // TODO: unsafe binders: `unsafe<'a> &'a T`
204 // https://github.com/dtolnay/syn/issues/1791
205 "src/tools/rustfmt/tests/source/unsafe-binders.rs",
206 "src/tools/rustfmt/tests/target/unsafe-binders.rs",
207 "tests/debuginfo/unsafe-binders.rs",
208 "tests/mir-opt/gvn_on_unsafe_binder.rs",
209 "tests/rustdoc-html/auxiliary/unsafe-binder-dep.rs",
210 "tests/rustdoc-html/unsafe-binder.rs",
211 "tests/ui/unsafe-binders/binder-sized-crit.rs",
212 "tests/ui/unsafe-binders/cat-projection.rs",
213 "tests/ui/unsafe-binders/expr.rs",
214 "tests/ui/unsafe-binders/simple.rs",
215 "tests/ui/unsafe-binders/unsafe-binders-debuginfo.rs",
216
217 // TODO: unsafe fields: `struct S { unsafe field: T }`
218 // https://github.com/dtolnay/syn/issues/1792
219 "src/tools/clippy/tests/ui/derive.rs",
220 "src/tools/clippy/tests/ui/doc_unsafe.rs",
221 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/record_field_list.rs",
222 "src/tools/rustfmt/tests/source/unsafe-field.rs",
223 "src/tools/rustfmt/tests/target/unsafe-field.rs",
224 "tests/ui/unsafe-fields/auxiliary/unsafe-fields-crate-dep.rs",
225
226 // TODO: guard patterns: `match expr { (A if f()) | (B if g()) => {} }`
227 // https://github.com/dtolnay/syn/issues/1793
228 "src/tools/rustfmt/tests/target/guard_patterns.rs",
229 "tests/ui/lint/unused/unused_parens/parens-around-guard-patterns-not-unused.rs",
230 "tests/ui/pattern/rfc-3637-guard-patterns/liveness-ice-issue-146445.rs",
231 "tests/ui/pattern/rfc-3637-guard-patterns/only-gather-locals-once.rs",
232 "tests/ui/reachable/guard_read_for_never.rs",
233
234 // TODO: struct field default: `struct S { field: i32 = 1 }`
235 // https://github.com/dtolnay/syn/issues/1774
236 "compiler/rustc_ast_lowering/src/delegation/generics.rs",
237 "compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs",
238 "compiler/rustc_errors/src/markdown/parse.rs",
239 "compiler/rustc_hir/src/attrs/diagnostic.rs",
240 "compiler/rustc_hir_analysis/src/hir_wf_check.rs",
241 "compiler/rustc_middle/src/hir/map.rs",
242 "compiler/rustc_middle/src/ty/mod.rs",
243 "compiler/rustc_parse/src/parser/mod.rs",
244 "compiler/rustc_parse/src/parser/stmt.rs",
245 "compiler/rustc_privacy/src/lib.rs",
246 "compiler/rustc_resolve/src/imports.rs",
247 "compiler/rustc_resolve/src/lib.rs",
248 "compiler/rustc_session/src/config.rs",
249 "compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs",
250 "src/tools/clippy/tests/ui/exhaustive_items.rs",
251 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/record_field_default_values.rs",
252 "src/tools/rustfmt/tests/source/default-field-values.rs",
253 "src/tools/rustfmt/tests/target/default-field-values.rs",
254 "tests/ui/structs/default-field-values/auxiliary/struct_field_default.rs",
255 "tests/ui/structs/default-field-values/const-trait-default-field-value.rs",
256 "tests/ui/structs/default-field-values/field-references-param.rs",
257 "tests/ui/structs/default-field-values/support.rs",
258 "tests/ui/structs/default-field-values/use-normalized-ty-for-default-struct-value.rs",
259
260 // TODO: final associated functions: `final fn`
261 // https://github.com/dtolnay/syn/issues/1981
262 "library/core/src/io/size_hint.rs",
263 "src/tools/rustfmt/tests/target/final-kw.rs",
264 "tests/rustdoc-html/final-trait-method.rs",
265 "tests/ui/traits/final/dyn-compat.rs",
266 "tests/ui/traits/final/works.rs",
267
268 // TODO: impl restrictions: `pub impl(self) trait Trait`
269 // https://github.com/dtolnay/syn/issues/1982
270 "library/core/src/convert/num.rs",
271 "library/core/src/num/nonzero.rs",
272 "library/core/src/num/traits.rs",
273 "library/core/src/sync/atomic.rs",
274 "library/std/src/io/stdio.rs",
275 "library/std/src/os/darwin/fs.rs",
276 "library/std/src/os/freebsd/net.rs",
277 "library/std/src/os/illumos/net.rs",
278 "library/std/src/os/linux/process.rs",
279 "library/std/src/os/motor/ffi.rs",
280 "library/std/src/os/motor/process.rs",
281 "library/std/src/os/net/linux_ext/addr.rs",
282 "library/std/src/os/net/linux_ext/socket.rs",
283 "library/std/src/os/net/linux_ext/tcp.rs",
284 "library/std/src/os/netbsd/net.rs",
285 "library/std/src/os/solaris/net.rs",
286 "library/std/src/os/unix/ffi/os_str.rs",
287 "library/std/src/os/unix/fs.rs",
288 "library/std/src/os/unix/io/mod.rs",
289 "library/std/src/os/unix/process.rs",
290 "library/std/src/os/windows/ffi.rs",
291 "library/std/src/os/windows/fs.rs",
292 "library/std/src/os/windows/process.rs",
293 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/impl_restrictions.rs",
294 "src/tools/rustfmt/tests/source/impl-restriction.rs",
295 "src/tools/rustfmt/tests/target/impl-restriction.rs",
296 "tests/pretty/hir-impl-restriction.rs",
297 "tests/rustdoc-html/impl/impl-restriction-document-private.rs",
298 "tests/rustdoc-html/impl/impl-restriction.rs",
299 "tests/ui/impl-restriction/auxiliary/external-impl-restriction.rs",
300
301 // TODO: return type notation: `where T: Trait<method(): Send>` and `where T::method(..): Send`
302 // https://github.com/dtolnay/syn/issues/1434
303 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/return_type_syntax_in_path.rs",
304 "src/tools/rustfmt/tests/target/return-type-notation.rs",
305 "tests/rustdoc-html/jump-to-def/assoc-items-extra.rs",
306 "tests/rustdoc-html/return-type-notation.rs",
307 "tests/rustdoc-json/return-type-notation.rs",
308 "tests/ui/associated-type-bounds/all-generics-lookup.rs",
309 "tests/ui/associated-type-bounds/implied-from-self-where-clause.rs",
310 "tests/ui/associated-type-bounds/return-type-notation/basic.rs",
311 "tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.rs",
312 "tests/ui/associated-type-bounds/return-type-notation/namespace-conflict.rs",
313 "tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.rs",
314 "tests/ui/associated-type-bounds/return-type-notation/path-self-qself.rs",
315 "tests/ui/associated-type-bounds/return-type-notation/path-works.rs",
316 "tests/ui/associated-type-bounds/return-type-notation/trait-alias.rs",
317 "tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs",
318 "tests/ui/async-await/return-type-notation/issue-110963-late.rs",
319 "tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.rs",
320 "tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs",
321 "tests/ui/async-await/return-type-notation/super-method-bound.rs",
322 "tests/ui/async-await/return-type-notation/supertrait-bound.rs",
323 "tests/ui/borrowck/alias-liveness/rtn-static.rs",
324 "tests/ui/feature-gates/feature-gate-return_type_notation.rs",
325
326 // TODO: lazy type alias syntax with where-clause in trailing position
327 // https://github.com/dtolnay/syn/issues/1525
328 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/type_item_where_clause.rs",
329 "src/tools/rustfmt/tests/source/type-alias-where-clauses-with-comments.rs",
330 "src/tools/rustfmt/tests/source/type-alias-where-clauses.rs",
331 "src/tools/rustfmt/tests/target/type-alias-where-clauses-with-comments.rs",
332 "src/tools/rustfmt/tests/target/type-alias-where-clauses.rs",
333 "tests/rustdoc-html/typedef-inner-variants-lazy_type_alias.rs",
334 "tests/ui/traits/next-solver/normalize/normalize-self-type-constrains-trait-args.rs",
335
336 // TODO: gen blocks and functions
337 // https://github.com/dtolnay/syn/issues/1526
338 "compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs",
339 "compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs",
340 "compiler/rustc_metadata/src/rmeta/decoder.rs",
341 "compiler/rustc_middle/src/ty/closure.rs",
342 "compiler/rustc_middle/src/ty/context.rs",
343 "src/tools/clippy/tests/ui/infinite_loops.rs",
344 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/gen_blocks.rs",
345 "tests/ui/async-await/async-drop/assign-incompatible-types.rs",
346 "tests/ui/coroutine/async-gen-deduce-yield.rs",
347 "tests/ui/coroutine/async-gen-yield-ty-is-unit.rs",
348 "tests/ui/coroutine/async_gen_fn_iter.rs",
349 "tests/ui/coroutine/gen_block_is_fused_iter.rs",
350 "tests/ui/coroutine/gen_block_is_iter.rs",
351 "tests/ui/coroutine/gen_block_iterate.rs",
352 "tests/ui/coroutine/gen_fn_iter.rs",
353 "tests/ui/coroutine/gen_fn_lifetime_capture.rs",
354 "tests/ui/coroutine/other-attribute-on-gen.rs",
355 "tests/ui/coroutine/return-types-diverge.rs",
356 "tests/ui/higher-ranked/builtin-closure-like-bounds.rs",
357 "tests/ui/sanitizer/cfi/coroutine.rs",
358
359 // TODO: postfix yield
360 // https://github.com/dtolnay/syn/issues/1890
361 "tests/pretty/postfix-yield.rs",
362 "tests/ui/coroutine/postfix-yield.rs",
363
364 // TODO: `!` as a pattern
365 // https://github.com/dtolnay/syn/issues/1546
366 "tests/mir-opt/building/match/never_patterns.rs",
367 "tests/pretty/never-pattern.rs",
368 "tests/ui/reachable/never-pattern-closure-param-array.rs",
369 "tests/ui/rfcs/rfc-0000-never_patterns/always-read-in-closure-capture.rs",
370 "tests/ui/rfcs/rfc-0000-never_patterns/diverges.rs",
371 "tests/ui/rfcs/rfc-0000-never_patterns/use-bindings.rs",
372
373 // TODO: async trait bounds: `impl async Fn()`
374 // https://github.com/dtolnay/syn/issues/1628
375 "src/tools/miri/tests/pass/async-closure-captures.rs",
376 "src/tools/miri/tests/pass/async-closure-drop.rs",
377 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/async_trait_bound.rs",
378 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/for_binder_bound.rs",
379 "src/tools/rustfmt/tests/target/asyncness.rs",
380 "tests/coverage/async_closure.rs",
381 "tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs",
382 "tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs",
383 "tests/ui/async-await/async-closures/auxiliary/foreign.rs",
384 "tests/ui/async-await/async-closures/body-check-on-non-fnmut.rs",
385 "tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs",
386 "tests/ui/async-await/async-closures/brand.rs",
387 "tests/ui/async-await/async-closures/captures.rs",
388 "tests/ui/async-await/async-closures/clone-closure.rs",
389 "tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs",
390 "tests/ui/async-await/async-closures/debuginfo-by-move-body.rs",
391 "tests/ui/async-await/async-closures/drop.rs",
392 "tests/ui/async-await/async-closures/force-move-due-to-inferred-kind.rs",
393 "tests/ui/async-await/async-closures/foreign.rs",
394 "tests/ui/async-await/async-closures/inline-body.rs",
395 "tests/ui/async-await/async-closures/mangle.rs",
396 "tests/ui/async-await/async-closures/moro-example.rs",
397 "tests/ui/async-await/async-closures/move-is-async-fn.rs",
398 "tests/ui/async-await/async-closures/mut-ref-reborrow.rs",
399 "tests/ui/async-await/async-closures/no-borrow-from-env.rs",
400 "tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs",
401 "tests/ui/async-await/async-closures/overlapping-projs.rs",
402 "tests/ui/async-await/async-closures/precise-captures.rs",
403 "tests/ui/async-await/async-closures/refd.rs",
404 "tests/ui/async-await/async-closures/signature-deduction.rs",
405 "tests/ui/async-await/async-fn/edition-2015-not-async-bound.rs",
406 "tests/ui/async-await/async-fn/higher-ranked-async-fn.rs",
407 "tests/ui/async-await/async-fn/impl-trait.rs",
408 "tests/ui/async-await/async-fn/project.rs",
409 "tests/ui/async-await/async-fn/sugar.rs",
410
411 // TODO: mutable by-reference bindings (mut ref)
412 // https://github.com/dtolnay/syn/issues/1629
413 "src/tools/rustfmt/tests/source/mut_ref.rs",
414 "src/tools/rustfmt/tests/target/mut_ref.rs",
415 "tests/ui/mut/mut-ref.rs",
416
417 // TODO: postfix match
418 // https://github.com/dtolnay/syn/issues/1630
419 "src/tools/clippy/tests/ui/unnecessary_semicolon.rs",
420 "src/tools/rustfmt/tests/source/postfix-match/pf-match.rs",
421 "src/tools/rustfmt/tests/target/postfix-match/pf-match.rs",
422 "tests/pretty/postfix-match/simple-matches.rs",
423 "tests/ui/match/postfix-match/no-unused-parens.rs",
424 "tests/ui/match/postfix-match/pf-match-chain.rs",
425 "tests/ui/match/postfix-match/postfix-match.rs",
426
427 // TODO: delegation: `reuse Trait::bar { Box::new(self.0) }`
428 // https://github.com/dtolnay/syn/issues/1580
429 "src/tools/rustfmt/tests/target/issue_6513.rs",
430 "tests/incremental/delegation-ice-155729.rs",
431 "tests/pretty/delegation/delegation.rs",
432 "tests/pretty/delegation/generics.rs",
433 "tests/pretty/delegation/impl-reuse.rs",
434 "tests/pretty/delegation/inherit-attributes.rs",
435 "tests/pretty/delegation/inline-attribute.rs",
436 "tests/pretty/delegation/self-mapping-output.rs",
437 "tests/pretty/delegation/self-rename.rs",
438 "tests/pretty/hir-delegation.rs",
439 "tests/rustdoc-html/async/async-fn-delegation.rs",
440 "tests/ui/delegation/auxiliary/recursive-delegation-aux.rs",
441 "tests/ui/delegation/body-identity-glob.rs",
442 "tests/ui/delegation/body-identity-list.rs",
443 "tests/ui/delegation/explicit-paths-in-traits-pass.rs",
444 "tests/ui/delegation/explicit-paths-pass.rs",
445 "tests/ui/delegation/explicit-paths-signature-pass.rs",
446 "tests/ui/delegation/fn-header.rs",
447 "tests/ui/delegation/generics/const-type-ice-154334.rs",
448 "tests/ui/delegation/generics/free-fn-to-free-fn-pass.rs",
449 "tests/ui/delegation/generics/free-fn-to-trait-method-pass.rs",
450 "tests/ui/delegation/generics/generics-aux-pass.rs",
451 "tests/ui/delegation/generics/impl-to-free-fn-pass.rs",
452 "tests/ui/delegation/generics/impl-trait-to-trait-method-pass.rs",
453 "tests/ui/delegation/generics/inherent-impl-to-trait-method-pass.rs",
454 "tests/ui/delegation/generics/mapping/free-to-free-pass.rs",
455 "tests/ui/delegation/generics/mapping/free-to-trait-pass.rs",
456 "tests/ui/delegation/generics/mapping/impl-trait-to-free-pass.rs",
457 "tests/ui/delegation/generics/mapping/impl-trait-to-trait-pass.rs",
458 "tests/ui/delegation/generics/mapping/inherent-impl-to-free-pass.rs",
459 "tests/ui/delegation/generics/mapping/inherent-impl-to-trait-pass.rs",
460 "tests/ui/delegation/generics/mapping/trait-to-free-pass.rs",
461 "tests/ui/delegation/generics/mapping/trait-to-trait-pass.rs",
462 "tests/ui/delegation/generics/self-rename.rs",
463 "tests/ui/delegation/generics/stability-implications-non-local-defid.rs",
464 "tests/ui/delegation/generics/synth-params-ice-154780.rs",
465 "tests/ui/delegation/generics/trait-method-to-other-pass.rs",
466 "tests/ui/delegation/generics/unelided-lifetime-in-sig-ice-156848.rs",
467 "tests/ui/delegation/glob-glob.rs",
468 "tests/ui/delegation/glob-override.rs",
469 "tests/ui/delegation/glob.rs",
470 "tests/ui/delegation/impl-reuse-pass.rs",
471 "tests/ui/delegation/impl-trait.rs",
472 "tests/ui/delegation/list.rs",
473 "tests/ui/delegation/macro-inside-glob.rs",
474 "tests/ui/delegation/macro-inside-list.rs",
475 "tests/ui/delegation/method-call-priority.rs",
476 "tests/ui/delegation/parse.rs",
477 "tests/ui/delegation/recursive-delegation-pass.rs",
478 "tests/ui/delegation/rename.rs",
479 "tests/ui/delegation/self-coercion.rs",
480 "tests/ui/delegation/self-mapping-arguments.rs",
481 "tests/ui/delegation/target-expression-removal-pass.rs",
482
483 // TODO: for await
484 // https://github.com/dtolnay/syn/issues/1631
485 "tests/ui/async-await/for-await-2015.rs",
486 "tests/ui/async-await/for-await-passthrough.rs",
487 "tests/ui/async-await/for-await.rs",
488
489 // TODO: unparenthesized half-open range pattern inside slice pattern: `[1..]`
490 // https://github.com/dtolnay/syn/issues/1769
491 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/range_pat.rs",
492 "tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs",
493
494 // TODO: pinned type sugar: `&pin const Self`
495 // https://github.com/dtolnay/syn/issues/1770
496 "src/tools/rustfmt/tests/source/pin_sugar.rs",
497 "src/tools/rustfmt/tests/target/pin_sugar.rs",
498 "tests/pretty/pin-ergonomics-hir.rs",
499 "tests/pretty/pin-ergonomics.rs",
500 "tests/ui/pin-ergonomics/borrow.rs",
501 "tests/ui/pin-ergonomics/pin-coercion.rs",
502 "tests/ui/pin-ergonomics/pinned-drop-sugar-no-core.rs",
503 "tests/ui/pin-ergonomics/pinned-drop-sugar.rs",
504 "tests/ui/pin-ergonomics/pinned-drop.rs",
505 "tests/ui/pin-ergonomics/sugar-self.rs",
506 "tests/ui/pin-ergonomics/sugar.rs",
507 "tests/ui/pin-ergonomics/user-type-projection.rs",
508
509 // TODO: attributes on where-predicates
510 // https://github.com/dtolnay/syn/issues/1705
511 "src/tools/rustfmt/tests/target/cfg_attribute_in_where.rs",
512 "tests/ui/where-clauses/cfg-attr-issue-138010-1.rs",
513
514 // TODO: super let
515 // https://github.com/dtolnay/syn/issues/1889
516 "library/std/src/macros/tests.rs",
517 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/let_stmt.rs",
518 "tests/ui/drop/if-let-super-let.rs",
519 "tests/ui/drop/super-let-tail-expr-drop-order.rs",
520
521 // TODO: "ergonomic clones": `f(obj.use)`, `thread::spawn(use || f(obj))`, `async use`
522 // https://github.com/dtolnay/syn/issues/1802
523 "src/tools/clippy/tests/ui/redundant_closure_call_early.rs",
524 "src/tools/clippy/tests/ui/redundant_closure_call_fixable.rs",
525 "src/tools/rustfmt/tests/source/ergonomic_clones.rs",
526 "src/tools/rustfmt/tests/target/ergonomic_clones.rs",
527 "tests/codegen-llvm/ergonomic-clones/closure.rs",
528 "tests/mir-opt/ergonomic-clones/closure.rs",
529 "tests/ui/ergonomic-clones/async/basic.rs",
530 "tests/ui/ergonomic-clones/closure/basic.rs",
531 "tests/ui/ergonomic-clones/closure/const-closure.rs",
532 "tests/ui/ergonomic-clones/closure/mutation.rs",
533 "tests/ui/ergonomic-clones/closure/nested.rs",
534 "tests/ui/ergonomic-clones/closure/once-move-out-on-heap.rs",
535 "tests/ui/ergonomic-clones/closure/with-binders.rs",
536 "tests/ui/ergonomic-clones/dotuse/basic.rs",
537 "tests/ui/ergonomic-clones/dotuse/block.rs",
538
539 // TODO: move expression
540 // https://github.com/dtolnay/syn/issues/1983
541 "tests/ui/move-expr/borrow-only.rs",
542 "tests/ui/move-expr/copy-type.rs",
543 "tests/ui/move-expr/name-resolution.rs",
544 "tests/ui/move-expr/nested-closures.rs",
545 "tests/ui/move-expr/nested-move-expr.rs",
546 "tests/ui/move-expr/parse-ambiguity.rs",
547 "tests/ui/move-expr/plain-closure.rs",
548
549 // TODO: contracts
550 // https://github.com/dtolnay/syn/issues/1892
551 "tests/ui/contracts/internal_machinery/contract-ast-extensions-nest.rs",
552 "tests/ui/contracts/internal_machinery/contract-ast-extensions-tail.rs",
553 "tests/ui/contracts/internal_machinery/contracts-lowering-ensures-is-not-inherited-when-nesting.rs",
554 "tests/ui/contracts/internal_machinery/contracts-lowering-requires-is-not-inherited-when-nesting.rs",
555
556 // TODO: frontmatter
557 // https://github.com/dtolnay/syn/issues/1893
558 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/frontmatter.rs",
559 "src/tools/rustfmt/tests/source/frontmatter_compact.rs",
560 "src/tools/rustfmt/tests/source/frontmatter_escaped.rs",
561 "src/tools/rustfmt/tests/source/frontmatter_spaced.rs",
562 "src/tools/rustfmt/tests/target/frontmatter_compact.rs",
563 "src/tools/rustfmt/tests/target/frontmatter_escaped.rs",
564 "src/tools/rustfmt/tests/target/frontmatter_spaced.rs",
565 "tests/rustdoc-html/source-code-pages/frontmatter.rs",
566 "tests/ui/frontmatter/auxiliary/expr.rs",
567 "tests/ui/frontmatter/auxiliary/lib.rs",
568 "tests/ui/frontmatter/content-contains-whitespace.rs",
569 "tests/ui/frontmatter/content-non-lexible-tokens.rs",
570 "tests/ui/frontmatter/escape-hyphens-leading.rs",
571 "tests/ui/frontmatter/escape-hyphens-nonleading-1.rs",
572 "tests/ui/frontmatter/escape-hyphens-nonleading-2.rs",
573 "tests/ui/frontmatter/escape-hyphens-nonleading-3.rs",
574 "tests/ui/frontmatter/fence-whitespace-trailing-1.rs",
575 "tests/ui/frontmatter/fence-whitespace-trailing-2.rs",
576 "tests/ui/frontmatter/frontmatter-crlf.rs",
577 "tests/ui/frontmatter/infostring-dot-nonleading.rs",
578 "tests/ui/frontmatter/infostring-hyphen-nonleading.rs",
579 "tests/ui/frontmatter/location-after-shebang.rs",
580 "tests/ui/include-macros/auxiliary/shebang-expr.rs",
581 "tests/ui/unpretty/frontmatter.rs",
582
583 // TODO: `type const` associated items
584 // https://github.com/dtolnay/syn/issues/1984
585 "src/tools/clippy/tests/ui/crashes/mgca-16691.rs",
586 "src/tools/clippy/tests/ui/trait_duplication_in_bounds_assoc_const_eq.rs",
587 "src/tools/rustfmt/tests/source/direct_const_arg.rs",
588 "src/tools/rustfmt/tests/target/direct_const_arg.rs",
589 "tests/debuginfo/associated-const-bindings.rs",
590 "tests/rustdoc-html/constant/ice-associated-const-equality-105952.rs",
591 "tests/rustdoc-html/inline_cross/auxiliary/assoc-const-equality.rs",
592 "tests/rustdoc-html/type-const-associated-const-no-body.rs",
593 "tests/rustdoc-html/type-const-free-in-array.rs",
594 "tests/rustdoc-html/type-const-inherent-with-body.rs",
595 "tests/ui/associated-consts/issue-110933.rs",
596 "tests/ui/associated-consts/type-const-in-array-len.rs",
597 "tests/ui/associated-type-bounds/duplicate-bound.rs",
598 "tests/ui/const-generics/associated-const-bindings/assoc-const.rs",
599 "tests/ui/const-generics/associated-const-bindings/bound-var-in-ty.rs",
600 "tests/ui/const-generics/associated-const-bindings/coexisting-with-type-binding.rs",
601 "tests/ui/const-generics/associated-const-bindings/const_evaluatable_unchecked.rs",
602 "tests/ui/const-generics/associated-const-bindings/dyn-compat-basic.rs",
603 "tests/ui/const-generics/associated-const-bindings/dyn-compat-self-const-projections-in-methods.rs",
604 "tests/ui/const-generics/associated-const-bindings/dyn-const-projection-escaping-bound-vars.rs",
605 "tests/ui/const-generics/associated-const-bindings/equality-unused-issue-126729.rs",
606 "tests/ui/const-generics/associated-const-bindings/equality_bound_with_infer.rs",
607 "tests/ui/const-generics/associated-const-bindings/normalization-via-param-env.rs",
608 "tests/ui/const-generics/associated-const-bindings/supertraits.rs",
609 "tests/ui/const-generics/gca/basic-different-definitions.rs",
610 "tests/ui/const-generics/gca/basic.rs",
611 "tests/ui/const-generics/generic_const_exprs/auxiliary/non_local_type_const.rs",
612 "tests/ui/const-generics/mgca/adt_expr_infers_from_value.rs",
613 "tests/ui/const-generics/mgca/array-expr-with-assoc-const.rs",
614 "tests/ui/const-generics/mgca/assoc-const-projection-in-bound.rs",
615 "tests/ui/const-generics/mgca/assoc-const.rs",
616 "tests/ui/const-generics/mgca/concrete-expr-with-generics-in-env.rs",
617 "tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs",
618 "tests/ui/const-generics/mgca/generic-args-on-enum-variant-segments.rs",
619 "tests/ui/const-generics/mgca/multi_braced_direct_const_args.rs",
620 "tests/ui/const-generics/mgca/tuple_ctor_arg_simple.rs",
621 "tests/ui/const-generics/mgca/tuple_expr_arg_simple.rs",
622 "tests/ui/const-generics/mgca/type-const-ctor-148953.rs",
623 "tests/ui/const-generics/mgca/type-const-used-in-trait.rs",
624 "tests/ui/const-generics/mgca/type_const-array-return.rs",
625 "tests/ui/const-generics/mgca/type_const-incemental-compile.rs",
626 "tests/ui/const-generics/mgca/type_const-pub.rs",
627 "tests/ui/const-generics/mgca/type_const-use.rs",
628 "tests/ui/const-generics/mgca/type_const_in_pattern.rs",
629 "tests/ui/generic-const-items/assoc-const-bindings.rs",
630 "tests/ui/generic-const-items/type-const-nested-assoc-const.rs",
631 "tests/ui/sanitizer/cfi/assoc-const-projection-issue-151878.rs",
632 "tests/ui/supertrait-shadowing/assoc-const.rs",
633 "tests/ui/supertrait-shadowing/out-of-scope.rs",
634 "tests/ui/supertrait-shadowing/type-dependent.rs",
635
636 // TODO: const block in path argument: `T: Trait<const { ... }>`
637 // https://github.com/dtolnay/syn/issues/1985
638 "tests/ui/const-generics/mgca/higher-ranked-lts-good.rs",
639 "tests/ui/traits/associated_type_bound/generic-const-args-default.rs",
640
641 // TODO: item-level const blocks
642 // https://github.com/dtolnay/syn/issues/1986
643 "src/tools/rustfmt/tests/source/const-block-items.rs",
644 "src/tools/rustfmt/tests/target/const-block-items.rs",
645 "tests/ui/consts/const-block-items/assert-pass.rs",
646 "tests/ui/consts/const-block-items/hir.rs",
647 "tests/ui/parser/const-block-items/attrs.rs",
648 "tests/ui/parser/const-block-items/mod-in-fn.rs",
649 "tests/ui/parser/const-block-items/pub.rs",
650
651 // TODO: mut-restricted fields
652 // https://github.com/dtolnay/syn/issues/1987
653 "src/tools/rustfmt/tests/source/mut-restriction.rs",
654 "src/tools/rustfmt/tests/target/mut-restriction.rs",
655 "tests/pretty/hir-mut-restriction.rs",
656 "tests/ui/mut-restriction/auxiliary/external-mut-restriction.rs",
657
658 // TODO: heterogeneous try-blocks: `try bikeshed Option<_>`
659 // https://github.com/dtolnay/syn/issues/1988
660 "src/tools/rustfmt/tests/source/try_blocks_heterogeneous.rs",
661 "src/tools/rustfmt/tests/target/try_blocks_heterogeneous.rs",
662 "tests/pretty/try-blocks.rs",
663 "tests/ui/try-block/try-block-heterogeneous.rs",
664
665 // TODO: `|| .. .method()`
666 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/closure_range_method_call.rs",
667 "src/tools/rustfmt/tests/source/issue-4808.rs",
668
669 // Negative inherent impl: `impl !Box<JoinHandle> {}`
670 "src/tools/rustfmt/tests/source/negative-impl.rs",
671 "src/tools/rustfmt/tests/target/negative-impl.rs",
672
673 // Compile-fail expr parameter in const generic position: `f::<1 + 2>()`
674 "tests/ui/const-generics/early/closing-args-token.rs",
675 "tests/ui/const-generics/early/const-expression-parameter.rs",
676
677 // Compile-fail variadics in not the last position of a function parameter list
678 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/fn_def_param.rs",
679 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/param_list_vararg.rs",
680 "tests/ui/parser/variadic-ffi-syntactic-pass.rs",
681
682 // Need at least one trait in impl Trait, no such type as impl 'static
683 "tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs",
684
685 // Negative polarity trait bound: `where T: !Copy`
686 "src/tools/rustfmt/tests/target/negative-bounds.rs",
687 "tests/ui/traits/negative-bounds/supertrait.rs",
688
689 // Const impl that is not a trait impl: `impl ~const T {}`
690 "tests/ui/traits/const-traits/syntax.rs",
691
692 // Lifetimes and types out of order in angle bracketed path arguments
693 "tests/ui/parser/constraints-before-generic-args-syntactic-pass.rs",
694
695 // Deprecated anonymous parameter syntax in traits
696 "src/tools/rustfmt/tests/source/trait.rs",
697 "src/tools/rustfmt/tests/target/trait.rs",
698 "tests/pretty/hir-fn-params.rs",
699 "tests/rustdoc-html/anon-fn-params.rs",
700 "tests/rustdoc-html/auxiliary/ext-anon-fn-params.rs",
701 "tests/ui/anon-params/anon-params-trait-method-multiple.rs",
702 "tests/ui/fn/anonymous-parameters-trait-13105.rs",
703 "tests/ui/proc-macro/trait-fn-args-2015.rs",
704 "tests/ui/trait-bounds/anonymous-parameters-13775.rs",
705
706 // Deprecated where-clause location
707 "src/tools/rustfmt/tests/source/issue_4257.rs",
708 "src/tools/rustfmt/tests/source/issue_4911.rs",
709 "src/tools/rustfmt/tests/target/issue_4257.rs",
710 "src/tools/rustfmt/tests/target/issue_4911.rs",
711 "tests/pretty/gat-bounds.rs",
712
713 // Deprecated trait object syntax with parenthesized generic arguments and no dyn keyword
714 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/path_fn_trait_args.rs",
715 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/typepathfn_with_coloncolon.rs",
716 "src/tools/rustfmt/tests/source/attrib.rs",
717 "src/tools/rustfmt/tests/source/closure.rs",
718 "src/tools/rustfmt/tests/source/existential_type.rs",
719 "src/tools/rustfmt/tests/source/fn-simple.rs",
720 "src/tools/rustfmt/tests/source/fn_args_layout-vertical.rs",
721 "src/tools/rustfmt/tests/source/issue-4689/one.rs",
722 "src/tools/rustfmt/tests/source/issue-4689/two.rs",
723 "src/tools/rustfmt/tests/source/paths.rs",
724 "src/tools/rustfmt/tests/source/structs.rs",
725 "src/tools/rustfmt/tests/target/attrib.rs",
726 "src/tools/rustfmt/tests/target/closure.rs",
727 "src/tools/rustfmt/tests/target/existential_type.rs",
728 "src/tools/rustfmt/tests/target/fn-simple.rs",
729 "src/tools/rustfmt/tests/target/fn.rs",
730 "src/tools/rustfmt/tests/target/fn_args_layout-vertical.rs",
731 "src/tools/rustfmt/tests/target/issue-4689/one.rs",
732 "src/tools/rustfmt/tests/target/issue-4689/two.rs",
733 "src/tools/rustfmt/tests/target/paths.rs",
734 "src/tools/rustfmt/tests/target/structs.rs",
735 "tests/codegen-units/item-collection/non-generic-closures.rs",
736 "tests/debuginfo/recursive-enum.rs",
737 "tests/pretty/closure-reform-pretty.rs",
738 "tests/run-make/reproducible-build-2/reproducible-build.rs",
739 "tests/run-make/reproducible-build/reproducible-build.rs",
740 "tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs",
741 "tests/ui/lifetimes/auxiliary/lifetime_bound_will_change_warning_lib.rs",
742 "tests/ui/lifetimes/bare-trait-object-borrowck.rs",
743 "tests/ui/lifetimes/bare-trait-object.rs",
744 "tests/ui/parser/bounds-obj-parens.rs",
745
746 // Various extensions to Rust syntax made up by rust-analyzer
747 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/asm_piece_attr.rs",
748 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/assoc_type_bound.rs",
749 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/const_param_default_path.rs",
750 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/deref_pat.rs",
751 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/field_expr.rs",
752 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/generic_arg_bounds.rs",
753 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/global_asm.rs",
754 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/include_bytes.rs",
755 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/not_null_pat.rs",
756 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/pattern_type.rs",
757 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/question_for_type_trait_bound.rs",
758 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/record_mut_restrictions_after.rs",
759 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/record_mut_restrictions_before.rs",
760 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/ref_expr.rs",
761 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/try_block_expr.rs",
762 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/tuple_mut_restrictions.rs",
763 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/type_const.rs",
764 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/use_tree_abs_star.rs",
765 "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0015_use_tree.rs",
766 "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0019_enums.rs",
767 "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0029_range_forms.rs",
768 "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0051_parameter_attrs.rs",
769 "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0055_dot_dot_dot.rs",
770 "src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0068_item_modifiers.rs",
771 "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0031_block_inner_attrs.rs",
772 "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0038_endless_inclusive_range.rs",
773 "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0045_ambiguous_trait_object.rs",
774 "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0046_mutable_const_item.rs",
775 "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0224_dangling_dyn.rs",
776 "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/0261_dangling_impl_undeclared_lifetime.rs",
777 "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/dangling_impl.rs",
778 "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/dangling_impl_reference.rs",
779 "src/tools/rust-analyzer/crates/syntax/test_data/parser/validation/impl_trait_lifetime_only.rs",
780
781 // Placeholder syntax for "throw expressions"
782 "compiler/rustc_expand/src/module.rs",
783 "compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs",
784 "src/tools/clippy/tests/ui/needless_return.rs",
785 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/yeet_expr.rs",
786 "tests/pretty/yeet-expr.rs",
787 "tests/ui/contracts/contracts-ensures-early-fn-exit.rs",
788 "tests/ui/try-trait/yeet-for-option.rs",
789 "tests/ui/try-trait/yeet-for-result.rs",
790
791 // Edition 2015 code using identifiers that are now keywords
792 // TODO: some of these we should probably parse
793 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/dyn_trait_type_weak.rs",
794 "src/tools/rustfmt/tests/source/configs/indent_style/block_call.rs",
795 "src/tools/rustfmt/tests/source/configs/use_try_shorthand/false.rs",
796 "src/tools/rustfmt/tests/source/configs/use_try_shorthand/true.rs",
797 "src/tools/rustfmt/tests/source/issue_1306.rs",
798 "src/tools/rustfmt/tests/source/try-conversion.rs",
799 "src/tools/rustfmt/tests/target/configs/indent_style/block_call.rs",
800 "src/tools/rustfmt/tests/target/configs/use_try_shorthand/false.rs",
801 "src/tools/rustfmt/tests/target/issue-1681.rs",
802 "src/tools/rustfmt/tests/target/issue_1306.rs",
803 "tests/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs",
804 "tests/ui/editions/edition-keywords-2015-2015.rs",
805 "tests/ui/editions/edition-keywords-2015-2018.rs",
806 "tests/ui/lint/keyword-idents/auxiliary/multi_file_submod.rs",
807 "tests/ui/lint/lint_pre_expansion_extern_module_aux.rs",
808 "tests/ui/macros/macro-comma-support-rpass.rs",
809 "tests/ui/macros/try-macro.rs",
810 "tests/ui/parser/extern-crate-async.rs",
811 "tests/ui/try-block/try-is-identifier-edition2015.rs",
812
813 // Excessive nesting
814 "tests/ui/expr/if/expr-stack-overflow.rs",
815
816 // Testing tools on invalid syntax
817 "src/tools/clippy/tests/ui/non_expressive_names_error_recovery.rs",
818 "src/tools/rustfmt/tests/coverage/target/comments.rs",
819 "src/tools/rustfmt/tests/parser/issue-4126/invalid.rs",
820 "src/tools/rustfmt/tests/parser/issue_4418.rs",
821 "src/tools/rustfmt/tests/parser/stashed-diag.rs",
822 "src/tools/rustfmt/tests/parser/stashed-diag2.rs",
823 "src/tools/rustfmt/tests/parser/unclosed-delims/issue_4466.rs",
824 "src/tools/rustfmt/tests/source/configs/disable_all_formatting/true.rs",
825 "src/tools/rustfmt/tests/source/configs/spaces_around_ranges/false.rs",
826 "src/tools/rustfmt/tests/source/configs/spaces_around_ranges/true.rs",
827 "src/tools/rustfmt/tests/source/type.rs",
828 "src/tools/rustfmt/tests/target/configs/spaces_around_ranges/false.rs",
829 "src/tools/rustfmt/tests/target/configs/spaces_around_ranges/true.rs",
830 "src/tools/rustfmt/tests/target/type.rs",
831 "src/tools/rustfmt/tests/target/unsafe_extern_blocks.rs",
832 "tests/ui/generics/issue-94432-garbage-ice.rs",
833
834 // Not actually test cases
835 "tests/ui/lint/expansion-time-include.rs",
836 "tests/ui/macros/auxiliary/macro-comma-support.rs",
837 "tests/ui/macros/auxiliary/macro-include-items-expr.rs",
838 "tests/ui/macros/include-single-expr-helper.rs",
839 "tests/ui/macros/include-single-expr-helper-1.rs",
840 "tests/ui/parser/issues/auxiliary/issue-21146-inc.rs",
841];
842
843#[rustfmt::skip]
844static EXCLUDE_DIRS: &[&str] = &[
845 // Inputs that intentionally do not parse
846 "src/tools/rust-analyzer/crates/parser/test_data/parser/err",
847 "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/err",
848
849 // Inputs that lex but do not necessarily parse
850 "src/tools/rust-analyzer/crates/parser/test_data/lexer",
851
852 // Inputs that used to crash rust-analyzer, but aren't necessarily supposed to parse
853 "src/tools/rust-analyzer/crates/syntax/test_data/parser/fuzz-failures",
854 "src/tools/rust-analyzer/crates/syntax/test_data/reparse/fuzz-failures",
855
856 // Inputs that crash rustc, making no claim about whether they are valid Rust
857 "tests/crashes",
858];
859
860// Directories in which a .stderr implies the corresponding .rs is not expected
861// to work.
862static UI_TEST_DIRS: &[&str] = &["tests/ui", "tests/rustdoc-ui"];
863
864pub fn for_each_rust_file(for_each: impl Fn(&Path) + Sync + Send) {
865 let mut rs_files = BTreeSet::new();
866
867 let repo_dir = Path::new("tests/rust");
868 for entry in WalkDir::new(repo_dir)
869 .into_iter()
870 .filter_entry(base_dir_filter)
871 {
872 let entry = entry.unwrap();
873 if !entry.file_type().is_dir() {
874 rs_files.insert(entry.into_path());
875 }
876 }
877
878 for ui_test_dir in UI_TEST_DIRS {
879 for entry in WalkDir::new(repo_dir.join(ui_test_dir)) {
880 let mut path = entry.unwrap().into_path();
881 if path.extension() == Some(OsStr::new("stderr")) {
882 loop {
883 rs_files.remove(&path.with_extension("rs"));
884 path = path.with_extension("");
885 if path.extension().is_none() {
886 break;
887 }
888 }
889 }
890 }
891 }
892
893 rs_files.par_iter().map(PathBuf::as_path).for_each(for_each);
894}
895
896pub fn base_dir_filter(entry: &DirEntry) -> bool {
897 let path = entry.path();
898
899 let mut path_string = path.to_string_lossy();
900 if cfg!(windows) {
901 path_string = path_string.replace('\\', "/").into();
902 }
903 let path_string = if path_string == "tests/rust" {
904 return true;
905 } else if let Some(path) = path_string.strip_prefix("tests/rust/") {
906 path
907 } else {
908 panic!("unexpected path in Rust dist: {}", path_string);
909 };
910
911 if path.is_dir() {
912 return !EXCLUDE_DIRS.contains(&path_string);
913 }
914
915 if path.extension() != Some(OsStr::new("rs")) {
916 return false;
917 }
918
919 !EXCLUDE_FILES.contains(&path_string)
920}
921
922#[allow(dead_code)]
923pub fn edition(path: &Path) -> &'static str {
924 if path.ends_with("dyn-2015-no-warnings-without-lints.rs") {
925 "2015"
926 } else {
927 "2021"
928 }
929}
930
931#[allow(dead_code)]
932pub fn abort_after() -> usize {
933 match env::var("ABORT_AFTER_FAILURE") {
934 Ok(s) => s.parse().expect("failed to parse ABORT_AFTER_FAILURE"),
935 Err(_) => usize::MAX,
936 }
937}
938
939pub fn rayon_init() {
940 let stack_size = match env::var("RUST_MIN_STACK") {
941 Ok(s) => s.parse().expect("failed to parse RUST_MIN_STACK"),
942 Err(_) => 1024 * 1024 * if cfg!(debug_assertions) { 40 } else { 20 },
943 };
944 ThreadPoolBuilder::new()
945 .stack_size(stack_size)
946 .build_global()
947 .unwrap();
948}
949
950pub fn clone_rust() {
951 let needs_clone = match fs::read_to_string("tests/rust/COMMIT") {
952 Err(_) => true,
953 Ok(contents) => contents.trim() != REVISION,
954 };
955 if needs_clone {
956 download_and_unpack().unwrap();
957 }
958
959 let mut missing = String::new();
960 let test_src = Path::new("tests/rust");
961
962 let mut exclude_files_set = BTreeSet::new();
963 for exclude in EXCLUDE_FILES {
964 if !exclude_files_set.insert(exclude) {
965 panic!("duplicate path in EXCLUDE_FILES: {}", exclude);
966 }
967 for dir in EXCLUDE_DIRS {
968 if Path::new(exclude).starts_with(dir) {
969 panic!("excluded file {} is inside an excluded dir", exclude);
970 }
971 }
972 if !test_src.join(exclude).is_file() {
973 missing += "\ntests/rust/";
974 missing += exclude;
975 }
976 }
977
978 let mut exclude_dirs_set = BTreeSet::new();
979 for exclude in EXCLUDE_DIRS {
980 if !exclude_dirs_set.insert(exclude) {
981 panic!("duplicate path in EXCLUDE_DIRS: {}", exclude);
982 }
983 if !test_src.join(exclude).is_dir() {
984 missing += "\ntests/rust/";
985 missing += exclude;
986 missing += "/";
987 }
988 }
989
990 if !missing.is_empty() {
991 panic!("excluded test file does not exist:{}\n", missing);
992 }
993}
994
995fn download_and_unpack() -> Result<()> {
996 let url = format!("https://github.com/rust-lang/rust/archive/{REVISION}.tar.gz");
997 errorf!("downloading {url}\n");
998
999 let response = reqwest::blocking::get(url)?.error_for_status()?;
1000 let progress = Progress::new(response);
1001 let decoder = GzDecoder::new(progress);
1002 let mut archive = Archive::new(decoder);
1003 let prefix = format!("rust-{}", REVISION);
1004
1005 let tests_rust = Path::new("tests/rust");
1006 if tests_rust.exists() {
1007 fs::remove_dir_all(tests_rust)?;
1008 }
1009
1010 for entry in archive.entries()? {
1011 let mut entry = entry?;
1012 let path = entry.path()?;
1013 if path == Path::new("pax_global_header") {
1014 continue;
1015 }
1016 let relative = path.strip_prefix(&prefix)?;
1017 let out = tests_rust.join(relative);
1018 entry.unpack(&out)?;
1019 }
1020
1021 fs::write("tests/rust/COMMIT", REVISION)?;
1022 Ok(())
1023}