From 64f79c0da179930d0e80f3078c6fd58498229812 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 17 Apr 2024 22:24:22 -0700 Subject: [PATCH 1/4] Update test suite to nightly-2024-04-18 --- tests/repo/mod.rs | 88 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 87 insertions(+), 1 deletion(-) diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs index cff69c26b..c441c68e7 100644 --- a/tests/repo/mod.rs +++ b/tests/repo/mod.rs @@ -13,10 +13,96 @@ use std::path::{Path, PathBuf}; use tar::Archive; use walkdir::{DirEntry, WalkDir}; -const REVISION: &str = "b10cfcd65fd7f7b1ab9beb34798b2108de003452"; +const REVISION: &str = "becebb3158149a115cad8a402612e25436a7e37b"; #[rustfmt::skip] static EXCLUDE_FILES: &[&str] = &[ + // TODO + "compiler/rustc_expand/src/module.rs", + "compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs", + "src/tools/miri/tests/pass/async-closure-captures.rs", + "src/tools/miri/tests/pass/async-closure-drop.rs", + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0209_become_expr.rs", + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0211_async_trait_bound.rs", + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0212_const_trait_bound.rs", + "src/tools/rustfmt/tests/parser/stashed-diag.rs", + "src/tools/rustfmt/tests/parser/stashed-diag2.rs", + "src/tools/rustfmt/tests/source/mut_ref.rs", + "src/tools/rustfmt/tests/source/postfix-match/pf-match.rs", + "src/tools/rustfmt/tests/target/asyncness.rs", + "src/tools/rustfmt/tests/target/mut_ref.rs", + "src/tools/rustfmt/tests/target/postfix-match/pf-match.rs", + "tests/codegen/async-closure-debug.rs", + "tests/crashes/108814.rs", + "tests/crashes/110627.rs", + "tests/crashes/111742.rs", + "tests/crashes/116519.rs", + "tests/crashes/116554.rs", + "tests/crashes/118038.rs", + "tests/crashes/119701.rs", + "tests/crashes/119716-2.rs", + "tests/crashes/119716.rs", + "tests/crashes/119786.rs", + "tests/crashes/119830.rs", + "tests/crashes/120503.rs", + "tests/crashes/121422.rs", + "tests/crashes/121429.rs", + "tests/crashes/121585-2.rs", + "tests/crashes/122989.rs", + "tests/crashes/123077-2.rs", + "tests/crashes/23707.rs", + "tests/pretty/delegation.rs", + "tests/pretty/postfix-match.rs", + "tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs", + "tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs", + "tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs", + "tests/ui/async-await/async-closures/auxiliary/foreign.rs", + "tests/ui/async-await/async-closures/brand.rs", + "tests/ui/async-await/async-closures/captures.rs", + "tests/ui/async-await/async-closures/constrained-but-no-upvars-yet.rs", + "tests/ui/async-await/async-closures/drop.rs", + "tests/ui/async-await/async-closures/mangle.rs", + "tests/ui/async-await/async-closures/moro-example.rs", + "tests/ui/async-await/async-closures/move-is-async-fn.rs", + "tests/ui/async-await/async-closures/mut-ref-reborrow.rs", + "tests/ui/async-await/async-closures/no-borrow-from-env.rs", + "tests/ui/async-await/async-closures/overlapping-projs.rs", + "tests/ui/async-await/async-closures/precise-captures.rs", + "tests/ui/async-await/async-closures/refd.rs", + "tests/ui/async-await/async-closures/signature-deduction.rs", + "tests/ui/async-await/async-fn/edition-2015-not-async-bound.rs", + "tests/ui/async-await/async-fn/higher-ranked-async-fn.rs", + "tests/ui/async-await/async-fn/impl-trait.rs", + "tests/ui/async-await/async-fn/project.rs", + "tests/ui/async-await/async-fn/sugar.rs", + "tests/ui/async-await/for-await-2015.rs", + "tests/ui/async-await/for-await-passthrough.rs", + "tests/ui/async-await/for-await.rs", + "tests/ui/coroutine/async-gen-deduce-yield.rs", + "tests/ui/coroutine/async-gen-yield-ty-is-unit.rs", + "tests/ui/coroutine/async_gen_fn_iter.rs", + "tests/ui/coroutine/gen_block_is_fused_iter.rs", + "tests/ui/coroutine/gen_fn_iter.rs", + "tests/ui/coroutine/gen_fn_lifetime_capture.rs", + "tests/ui/coroutine/return-types-diverge.rs", + "tests/ui/delegation/explicit-paths-in-traits-pass.rs", + "tests/ui/delegation/explicit-paths-pass.rs", + "tests/ui/delegation/explicit-paths-signature-pass.rs", + "tests/ui/delegation/parse.rs", + "tests/ui/generic-const-items/const-trait-impl.rs", + "tests/ui/higher-ranked/builtin-closure-like-bounds.rs", + "tests/ui/match/postfix-match/no-unused-parens.rs", + "tests/ui/match/postfix-match/pf-match-chain.rs", + "tests/ui/match/postfix-match/postfix-match.rs", + "tests/ui/mut/mut-ref.rs", + "tests/ui/parser/constraints-before-generic-args-syntactic-pass.rs", + "tests/ui/rfcs/rfc-0000-never_patterns/diverges.rs", + "tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.rs", + "tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds.rs", + "tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs", + "tests/ui/sanitizer/cfi-coroutine.rs", + "tests/ui/traits/negative-bounds/supertrait.rs", + // TODO: explicit tail calls: `become _g()` // https://github.com/dtolnay/syn/issues/1501 "tests/ui/explicit-tail-calls/return-lifetime-sub.rs", From d44d43d85a0ed1e0580606d0af9bba2b1136c259 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 17 Apr 2024 22:32:25 -0700 Subject: [PATCH 2/4] Categorize excluded dirs --- tests/repo/mod.rs | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs index c441c68e7..dad7d8bb7 100644 --- a/tests/repo/mod.rs +++ b/tests/repo/mod.rs @@ -33,24 +33,6 @@ static EXCLUDE_FILES: &[&str] = &[ "src/tools/rustfmt/tests/target/mut_ref.rs", "src/tools/rustfmt/tests/target/postfix-match/pf-match.rs", "tests/codegen/async-closure-debug.rs", - "tests/crashes/108814.rs", - "tests/crashes/110627.rs", - "tests/crashes/111742.rs", - "tests/crashes/116519.rs", - "tests/crashes/116554.rs", - "tests/crashes/118038.rs", - "tests/crashes/119701.rs", - "tests/crashes/119716-2.rs", - "tests/crashes/119716.rs", - "tests/crashes/119786.rs", - "tests/crashes/119830.rs", - "tests/crashes/120503.rs", - "tests/crashes/121422.rs", - "tests/crashes/121429.rs", - "tests/crashes/121585-2.rs", - "tests/crashes/122989.rs", - "tests/crashes/123077-2.rs", - "tests/crashes/23707.rs", "tests/pretty/delegation.rs", "tests/pretty/postfix-match.rs", "tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs", @@ -305,6 +287,9 @@ static EXCLUDE_DIRS: &[&str] = &[ // Inputs that used to crash rust-analyzer, but aren't necessarily supposed to parse "src/tools/rust-analyzer/crates/syntax/test_data/parser/fuzz-failures", "src/tools/rust-analyzer/crates/syntax/test_data/reparse/fuzz-failures", + + // Inputs that crash rustc, making no claim about whether they are valid Rust + "tests/crashes", ]; // Directories in which a .stderr implies the corresponding .rs is not expected From 81fa568ecbecf910b426c7b453bdf2ebe24d80c3 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 17 Apr 2024 22:37:46 -0700 Subject: [PATCH 3/4] Categorize other failures --- tests/repo/mod.rs | 146 +++++++++++++++++++++++++--------------------- 1 file changed, 80 insertions(+), 66 deletions(-) diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs index dad7d8bb7..6187f8b86 100644 --- a/tests/repo/mod.rs +++ b/tests/repo/mod.rs @@ -17,25 +17,61 @@ const REVISION: &str = "becebb3158149a115cad8a402612e25436a7e37b"; #[rustfmt::skip] static EXCLUDE_FILES: &[&str] = &[ - // TODO - "compiler/rustc_expand/src/module.rs", - "compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs", + // TODO: explicit tail calls: `become _g()` + // https://github.com/dtolnay/syn/issues/1501 + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0209_become_expr.rs", + "tests/ui/explicit-tail-calls/return-lifetime-sub.rs", + + // TODO: non-lifetime binders: `where for<'a, T> &'a Struct: Trait` + // https://github.com/dtolnay/syn/issues/1435 + "src/tools/rustfmt/tests/source/issue_5721.rs", + "src/tools/rustfmt/tests/source/non-lifetime-binders.rs", + "src/tools/rustfmt/tests/target/issue_5721.rs", + "src/tools/rustfmt/tests/target/non-lifetime-binders.rs", + "tests/rustdoc-json/non_lifetime_binders.rs", + "tests/rustdoc/inline_cross/auxiliary/non_lifetime_binders.rs", + "tests/rustdoc/non_lifetime_binders.rs", + + // TODO: return type notation: `where T: Trait` + // https://github.com/dtolnay/syn/issues/1434 + "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0208_associated_return_type_bounds.rs", + "tests/ui/associated-type-bounds/return-type-notation/basic.rs", + "tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs", + "tests/ui/feature-gates/feature-gate-return_type_notation.rs", + + // TODO: lazy type alias syntax with where-clause in trailing position + // https://github.com/dtolnay/syn/issues/1525 + "tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs", + + // TODO: gen blocks and functions + // https://github.com/dtolnay/syn/issues/1526 + "compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs", + "tests/ui/coroutine/async-gen-deduce-yield.rs", + "tests/ui/coroutine/async-gen-yield-ty-is-unit.rs", + "tests/ui/coroutine/async_gen_fn_iter.rs", + "tests/ui/coroutine/gen_block_is_fused_iter.rs", + "tests/ui/coroutine/gen_block_is_iter.rs", + "tests/ui/coroutine/gen_block_iterate.rs", + "tests/ui/coroutine/gen_fn_iter.rs", + "tests/ui/coroutine/gen_fn_lifetime_capture.rs", + "tests/ui/coroutine/return-types-diverge.rs", + "tests/ui/higher-ranked/builtin-closure-like-bounds.rs", + "tests/ui/sanitizer/cfi-coroutine.rs", + + // TODO: struct literal in match guard + // https://github.com/dtolnay/syn/issues/1527 + "tests/ui/parser/struct-literal-in-match-guard.rs", + + // TODO: `!` as a pattern + "tests/ui/rfcs/rfc-0000-never_patterns/diverges.rs", + + // TODO: async trait bounds: `impl async Fn()` "src/tools/miri/tests/pass/async-closure-captures.rs", "src/tools/miri/tests/pass/async-closure-drop.rs", - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0209_become_expr.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0211_async_trait_bound.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0212_const_trait_bound.rs", - "src/tools/rustfmt/tests/parser/stashed-diag.rs", - "src/tools/rustfmt/tests/parser/stashed-diag2.rs", - "src/tools/rustfmt/tests/source/mut_ref.rs", - "src/tools/rustfmt/tests/source/postfix-match/pf-match.rs", "src/tools/rustfmt/tests/target/asyncness.rs", - "src/tools/rustfmt/tests/target/mut_ref.rs", - "src/tools/rustfmt/tests/target/postfix-match/pf-match.rs", "tests/codegen/async-closure-debug.rs", - "tests/pretty/delegation.rs", - "tests/pretty/postfix-match.rs", - "tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs", "tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs", "tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs", "tests/ui/async-await/async-closures/auxiliary/foreign.rs", @@ -57,67 +93,37 @@ static EXCLUDE_FILES: &[&str] = &[ "tests/ui/async-await/async-fn/impl-trait.rs", "tests/ui/async-await/async-fn/project.rs", "tests/ui/async-await/async-fn/sugar.rs", - "tests/ui/async-await/for-await-2015.rs", - "tests/ui/async-await/for-await-passthrough.rs", - "tests/ui/async-await/for-await.rs", - "tests/ui/coroutine/async-gen-deduce-yield.rs", - "tests/ui/coroutine/async-gen-yield-ty-is-unit.rs", - "tests/ui/coroutine/async_gen_fn_iter.rs", - "tests/ui/coroutine/gen_block_is_fused_iter.rs", - "tests/ui/coroutine/gen_fn_iter.rs", - "tests/ui/coroutine/gen_fn_lifetime_capture.rs", - "tests/ui/coroutine/return-types-diverge.rs", + + // TODO: mutable by-reference bindings (mut ref) + "src/tools/rustfmt/tests/source/mut_ref.rs", + "src/tools/rustfmt/tests/target/mut_ref.rs", + "tests/ui/mut/mut-ref.rs", + + // TODO: postfix match + "src/tools/rustfmt/tests/source/postfix-match/pf-match.rs", + "src/tools/rustfmt/tests/target/postfix-match/pf-match.rs", + "tests/pretty/postfix-match.rs", + "tests/ui/match/postfix-match/no-unused-parens.rs", + "tests/ui/match/postfix-match/pf-match-chain.rs", + "tests/ui/match/postfix-match/postfix-match.rs", + + // TODO: delegation + "tests/pretty/delegation.rs", "tests/ui/delegation/explicit-paths-in-traits-pass.rs", "tests/ui/delegation/explicit-paths-pass.rs", "tests/ui/delegation/explicit-paths-signature-pass.rs", "tests/ui/delegation/parse.rs", + + // TODO: for await + "tests/ui/async-await/for-await-2015.rs", + "tests/ui/async-await/for-await-passthrough.rs", + "tests/ui/async-await/for-await.rs", + + // TODO: const trait bound: `T: const Trait` "tests/ui/generic-const-items/const-trait-impl.rs", - "tests/ui/higher-ranked/builtin-closure-like-bounds.rs", - "tests/ui/match/postfix-match/no-unused-parens.rs", - "tests/ui/match/postfix-match/pf-match-chain.rs", - "tests/ui/match/postfix-match/postfix-match.rs", - "tests/ui/mut/mut-ref.rs", - "tests/ui/parser/constraints-before-generic-args-syntactic-pass.rs", - "tests/ui/rfcs/rfc-0000-never_patterns/diverges.rs", "tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.rs", "tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds.rs", "tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs", - "tests/ui/sanitizer/cfi-coroutine.rs", - "tests/ui/traits/negative-bounds/supertrait.rs", - - // TODO: explicit tail calls: `become _g()` - // https://github.com/dtolnay/syn/issues/1501 - "tests/ui/explicit-tail-calls/return-lifetime-sub.rs", - - // TODO: non-lifetime binders: `where for<'a, T> &'a Struct: Trait` - // https://github.com/dtolnay/syn/issues/1435 - "src/tools/rustfmt/tests/source/issue_5721.rs", - "src/tools/rustfmt/tests/source/non-lifetime-binders.rs", - "src/tools/rustfmt/tests/target/issue_5721.rs", - "src/tools/rustfmt/tests/target/non-lifetime-binders.rs", - "tests/rustdoc-json/non_lifetime_binders.rs", - "tests/rustdoc/inline_cross/auxiliary/non_lifetime_binders.rs", - "tests/rustdoc/non_lifetime_binders.rs", - - // TODO: return type notation: `where T: Trait` - // https://github.com/dtolnay/syn/issues/1434 - "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0208_associated_return_type_bounds.rs", - "tests/ui/associated-type-bounds/return-type-notation/basic.rs", - "tests/ui/feature-gates/feature-gate-return_type_notation.rs", - - // TODO: lazy type alias syntax with where-clause in trailing position - // https://github.com/dtolnay/syn/issues/1525 - "tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs", - - // TODO: gen blocks and functions - // https://github.com/dtolnay/syn/issues/1526 - "compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs", - "tests/ui/coroutine/gen_block_is_iter.rs", - "tests/ui/coroutine/gen_block_iterate.rs", - - // TODO: struct literal in match guard - // https://github.com/dtolnay/syn/issues/1527 - "tests/ui/parser/struct-literal-in-match-guard.rs", // Compile-fail expr parameter in const generic position: f::<1 + 2>() "tests/ui/const-generics/early/closing-args-token.rs", @@ -131,6 +137,7 @@ static EXCLUDE_FILES: &[&str] = &[ // Negative polarity trait bound: `where T: !Copy` "src/tools/rustfmt/tests/target/negative-bounds.rs", + "tests/ui/traits/negative-bounds/supertrait.rs", // Lifetime bound inside for<>: `T: ~const ?for<'a: 'b> Trait<'a>` "tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-syntax.rs", @@ -138,6 +145,9 @@ static EXCLUDE_FILES: &[&str] = &[ // Const impl that is not a trait impl: `impl ~const T {}` "tests/ui/rfcs/rfc-2632-const-trait-impl/syntax.rs", + // Lifetimes and types out of order in angle bracketed path arguments + "tests/ui/parser/constraints-before-generic-args-syntactic-pass.rs", + // Deprecated anonymous parameter syntax in traits "src/tools/rustfmt/tests/source/trait.rs", "src/tools/rustfmt/tests/target/trait.rs", @@ -214,6 +224,8 @@ static EXCLUDE_FILES: &[&str] = &[ // Placeholder syntax for "throw expressions" "compiler/rustc_errors/src/translation.rs", + "compiler/rustc_expand/src/module.rs", + "compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs", "src/tools/clippy/tests/ui/needless_return.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0204_yeet_expr.rs", "tests/pretty/yeet-expr.rs", @@ -249,6 +261,8 @@ static EXCLUDE_FILES: &[&str] = &[ "src/tools/rustfmt/tests/coverage/target/comments.rs", "src/tools/rustfmt/tests/parser/issue-4126/invalid.rs", "src/tools/rustfmt/tests/parser/issue_4418.rs", + "src/tools/rustfmt/tests/parser/stashed-diag.rs", + "src/tools/rustfmt/tests/parser/stashed-diag2.rs", "src/tools/rustfmt/tests/parser/unclosed-delims/issue_4466.rs", "src/tools/rustfmt/tests/source/configs/disable_all_formatting/true.rs", "src/tools/rustfmt/tests/source/configs/spaces_around_ranges/false.rs", From a27036da52a7eb6cf5ae78e47d82bab9f68cd5d6 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 17 Apr 2024 23:52:11 -0700 Subject: [PATCH 4/4] Add issue links for missing syntax support --- tests/repo/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs index 6187f8b86..0f1b0a643 100644 --- a/tests/repo/mod.rs +++ b/tests/repo/mod.rs @@ -63,9 +63,11 @@ static EXCLUDE_FILES: &[&str] = &[ "tests/ui/parser/struct-literal-in-match-guard.rs", // TODO: `!` as a pattern + // https://github.com/dtolnay/syn/issues/1546 "tests/ui/rfcs/rfc-0000-never_patterns/diverges.rs", // TODO: async trait bounds: `impl async Fn()` + // https://github.com/dtolnay/syn/issues/1628 "src/tools/miri/tests/pass/async-closure-captures.rs", "src/tools/miri/tests/pass/async-closure-drop.rs", "src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0211_async_trait_bound.rs", @@ -95,11 +97,13 @@ static EXCLUDE_FILES: &[&str] = &[ "tests/ui/async-await/async-fn/sugar.rs", // TODO: mutable by-reference bindings (mut ref) + // https://github.com/dtolnay/syn/issues/1629 "src/tools/rustfmt/tests/source/mut_ref.rs", "src/tools/rustfmt/tests/target/mut_ref.rs", "tests/ui/mut/mut-ref.rs", // TODO: postfix match + // https://github.com/dtolnay/syn/issues/1630 "src/tools/rustfmt/tests/source/postfix-match/pf-match.rs", "src/tools/rustfmt/tests/target/postfix-match/pf-match.rs", "tests/pretty/postfix-match.rs", @@ -108,6 +112,7 @@ static EXCLUDE_FILES: &[&str] = &[ "tests/ui/match/postfix-match/postfix-match.rs", // TODO: delegation + // https://github.com/dtolnay/syn/issues/1580 "tests/pretty/delegation.rs", "tests/ui/delegation/explicit-paths-in-traits-pass.rs", "tests/ui/delegation/explicit-paths-pass.rs", @@ -115,11 +120,13 @@ static EXCLUDE_FILES: &[&str] = &[ "tests/ui/delegation/parse.rs", // TODO: for await + // https://github.com/dtolnay/syn/issues/1631 "tests/ui/async-await/for-await-2015.rs", "tests/ui/async-await/for-await-passthrough.rs", "tests/ui/async-await/for-await.rs", // TODO: const trait bound: `T: const Trait` + // https://github.com/dtolnay/syn/issues/1632 "tests/ui/generic-const-items/const-trait-impl.rs", "tests/ui/rfcs/rfc-2632-const-trait-impl/const-fns-are-early-bound.rs", "tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds.rs",