summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/assoc/assoc-const-underscore-semantic-fail.rs (renamed from tests/ui/parser/assoc-const-underscore-semantic-fail.rs)0
-rw-r--r--tests/ui/parser/assoc/assoc-const-underscore-semantic-fail.stderr (renamed from tests/ui/parser/assoc-const-underscore-semantic-fail.stderr)0
-rw-r--r--tests/ui/parser/assoc/assoc-const-underscore-syntactic-pass.rs (renamed from tests/ui/parser/assoc-const-underscore-syntactic-pass.rs)0
-rw-r--r--tests/ui/parser/assoc/assoc-oddities-1.rs (renamed from tests/ui/parser/assoc-oddities-1.rs)0
-rw-r--r--tests/ui/parser/assoc/assoc-oddities-1.stderr (renamed from tests/ui/parser/assoc-oddities-1.stderr)0
-rw-r--r--tests/ui/parser/assoc/assoc-oddities-2.rs (renamed from tests/ui/parser/assoc-oddities-2.rs)0
-rw-r--r--tests/ui/parser/assoc/assoc-oddities-2.stderr (renamed from tests/ui/parser/assoc-oddities-2.stderr)0
-rw-r--r--tests/ui/parser/assoc/assoc-static-semantic-fail.rs (renamed from tests/ui/parser/assoc-static-semantic-fail.rs)0
-rw-r--r--tests/ui/parser/assoc/assoc-static-semantic-fail.stderr (renamed from tests/ui/parser/assoc-static-semantic-fail.stderr)0
-rw-r--r--tests/ui/parser/assoc/assoc-static-syntactic-fail.rs (renamed from tests/ui/parser/assoc-static-syntactic-fail.rs)0
-rw-r--r--tests/ui/parser/assoc/assoc-static-syntactic-fail.stderr (renamed from tests/ui/parser/assoc-static-syntactic-fail.stderr)0
-rw-r--r--tests/ui/parser/assoc/assoc-type-in-type-arg.rs (renamed from tests/ui/parser/assoc-type-in-type-arg.rs)0
-rw-r--r--tests/ui/parser/assoc/assoc-type-in-type-arg.stderr (renamed from tests/ui/parser/assoc-type-in-type-arg.stderr)0
-rw-r--r--tests/ui/parser/assoc/associated-types-project-from-hrtb-explicit.rs (renamed from tests/ui/parser/associated-types-project-from-hrtb-explicit.rs)0
-rw-r--r--tests/ui/parser/assoc/associated-types-project-from-hrtb-explicit.stderr (renamed from tests/ui/parser/associated-types-project-from-hrtb-explicit.stderr)0
-rw-r--r--tests/ui/parser/attribute/attr-bad-meta-2.rs (renamed from tests/ui/parser/attr-bad-meta-2.rs)0
-rw-r--r--tests/ui/parser/attribute/attr-bad-meta-2.stderr (renamed from tests/ui/parser/attr-bad-meta-2.stderr)0
-rw-r--r--tests/ui/parser/attribute/attr-bad-meta-3.rs (renamed from tests/ui/parser/attr-bad-meta-3.rs)0
-rw-r--r--tests/ui/parser/attribute/attr-bad-meta-3.stderr (renamed from tests/ui/parser/attr-bad-meta-3.stderr)0
-rw-r--r--tests/ui/parser/attribute/attr-bad-meta.rs (renamed from tests/ui/parser/attr-bad-meta.rs)0
-rw-r--r--tests/ui/parser/attribute/attr-bad-meta.stderr (renamed from tests/ui/parser/attr-bad-meta.stderr)0
-rw-r--r--tests/ui/parser/attribute/attr-before-eof.rs (renamed from tests/ui/parser/attr-before-eof.rs)0
-rw-r--r--tests/ui/parser/attribute/attr-before-eof.stderr (renamed from tests/ui/parser/attr-before-eof.stderr)0
-rw-r--r--tests/ui/parser/attribute/attr-dangling-in-fn.rs (renamed from tests/ui/parser/attr-dangling-in-fn.rs)0
-rw-r--r--tests/ui/parser/attribute/attr-dangling-in-fn.stderr (renamed from tests/ui/parser/attr-dangling-in-fn.stderr)0
-rw-r--r--tests/ui/parser/attribute/attr-dangling-in-mod.rs (renamed from tests/ui/parser/attr-dangling-in-mod.rs)0
-rw-r--r--tests/ui/parser/attribute/attr-dangling-in-mod.stderr (renamed from tests/ui/parser/attr-dangling-in-mod.stderr)0
-rw-r--r--tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs (renamed from tests/ui/parser/attr-stmt-expr-attr-bad.rs)0
-rw-r--r--tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr (renamed from tests/ui/parser/attr-stmt-expr-attr-bad.stderr)1
-rw-r--r--tests/ui/parser/attribute/attr-with-a-semicolon.rs (renamed from tests/ui/parser/attr-with-a-semicolon.rs)0
-rw-r--r--tests/ui/parser/attribute/attr-with-a-semicolon.stderr (renamed from tests/ui/parser/attr-with-a-semicolon.stderr)0
-rw-r--r--tests/ui/parser/attribute/attr.rs (renamed from tests/ui/parser/attr.rs)0
-rw-r--r--tests/ui/parser/attribute/attr.stderr (renamed from tests/ui/parser/attr.stderr)0
-rw-r--r--tests/ui/parser/attribute/attribute-with-no-generics-in-parameter-list.rs (renamed from tests/ui/parser/attribute-with-no-generics-in-parameter-list.rs)0
-rw-r--r--tests/ui/parser/attribute/attribute-with-no-generics-in-parameter-list.stderr (renamed from tests/ui/parser/attribute-with-no-generics-in-parameter-list.stderr)0
-rw-r--r--tests/ui/parser/attribute/attrs-after-extern-mod.rs (renamed from tests/ui/parser/attrs-after-extern-mod.rs)0
-rw-r--r--tests/ui/parser/attribute/attrs-after-extern-mod.stderr (renamed from tests/ui/parser/attrs-after-extern-mod.stderr)0
-rw-r--r--tests/ui/parser/break-in-unlabeled-block-in-macro.rs43
-rw-r--r--tests/ui/parser/break-in-unlabeled-block-in-macro.stderr69
-rw-r--r--tests/ui/parser/break-in-unlabeled-block.fixed11
-rw-r--r--tests/ui/parser/break-in-unlabeled-block.rs11
-rw-r--r--tests/ui/parser/break-in-unlabeled-block.stderr27
-rw-r--r--tests/ui/parser/deep-unmatched-angle-brackets.rs17
-rw-r--r--tests/ui/parser/deep-unmatched-angle-brackets.stderr13
-rw-r--r--tests/ui/parser/diff-markers/unclosed-delims-in-macro.rs9
-rw-r--r--tests/ui/parser/diff-markers/unclosed-delims-in-macro.stderr18
-rw-r--r--tests/ui/parser/diff-markers/unclosed-delims.rs14
-rw-r--r--tests/ui/parser/diff-markers/unclosed-delims.stderr18
-rw-r--r--tests/ui/parser/doc-comment-in-stmt.fixed27
-rw-r--r--tests/ui/parser/doc-comment-in-stmt.rs11
-rw-r--r--tests/ui/parser/doc-comment-in-stmt.stderr45
-rw-r--r--tests/ui/parser/emoji-identifiers.stderr6
-rw-r--r--tests/ui/parser/fn-header-semantic-fail.rs10
-rw-r--r--tests/ui/parser/fn-header-semantic-fail.stderr77
-rw-r--r--tests/ui/parser/issue-116781.rs8
-rw-r--r--tests/ui/parser/issue-116781.stderr16
-rw-r--r--tests/ui/parser/issues/issue-100197-mut-let.fixed (renamed from tests/ui/parser/issue-100197-mut-let.fixed)0
-rw-r--r--tests/ui/parser/issues/issue-100197-mut-let.rs (renamed from tests/ui/parser/issue-100197-mut-let.rs)0
-rw-r--r--tests/ui/parser/issues/issue-100197-mut-let.stderr (renamed from tests/ui/parser/issue-100197-mut-let.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-101477-enum.fixed (renamed from tests/ui/parser/issue-101477-enum.fixed)0
-rw-r--r--tests/ui/parser/issues/issue-101477-enum.rs (renamed from tests/ui/parser/issue-101477-enum.rs)0
-rw-r--r--tests/ui/parser/issues/issue-101477-enum.stderr (renamed from tests/ui/parser/issue-101477-enum.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-101477-let.fixed (renamed from tests/ui/parser/issue-101477-let.fixed)0
-rw-r--r--tests/ui/parser/issues/issue-101477-let.rs (renamed from tests/ui/parser/issue-101477-let.rs)0
-rw-r--r--tests/ui/parser/issues/issue-101477-let.stderr (renamed from tests/ui/parser/issue-101477-let.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-102806.rs (renamed from tests/ui/parser/issue-102806.rs)0
-rw-r--r--tests/ui/parser/issues/issue-102806.stderr (renamed from tests/ui/parser/issue-102806.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-103143.rs (renamed from tests/ui/parser/issue-103143.rs)0
-rw-r--r--tests/ui/parser/issues/issue-103143.stderr (renamed from tests/ui/parser/issue-103143.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-103381.fixed (renamed from tests/ui/parser/issue-103381.fixed)0
-rw-r--r--tests/ui/parser/issues/issue-103381.rs (renamed from tests/ui/parser/issue-103381.rs)0
-rw-r--r--tests/ui/parser/issues/issue-103381.stderr (renamed from tests/ui/parser/issue-103381.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-103425.rs (renamed from tests/ui/parser/issue-103425.rs)0
-rw-r--r--tests/ui/parser/issues/issue-103425.stderr (renamed from tests/ui/parser/issue-103425.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-103451.rs (renamed from tests/ui/parser/issue-103451.rs)0
-rw-r--r--tests/ui/parser/issues/issue-103451.stderr (renamed from tests/ui/parser/issue-103451.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs (renamed from tests/ui/parser/issue-103748-ICE-wrong-braces.rs)0
-rw-r--r--tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr (renamed from tests/ui/parser/issue-103748-ICE-wrong-braces.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-104620.rs (renamed from tests/ui/parser/issue-104620.rs)0
-rw-r--r--tests/ui/parser/issues/issue-104620.stderr (renamed from tests/ui/parser/issue-104620.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-104867-inc-dec-2.rs (renamed from tests/ui/parser/issue-104867-inc-dec-2.rs)0
-rw-r--r--tests/ui/parser/issues/issue-104867-inc-dec-2.stderr (renamed from tests/ui/parser/issue-104867-inc-dec-2.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-104867-inc-dec.rs (renamed from tests/ui/parser/issue-104867-inc-dec.rs)0
-rw-r--r--tests/ui/parser/issues/issue-104867-inc-dec.stderr (renamed from tests/ui/parser/issue-104867-inc-dec.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-105366.fixed (renamed from tests/ui/parser/issue-105366.fixed)0
-rw-r--r--tests/ui/parser/issues/issue-105366.rs (renamed from tests/ui/parser/issue-105366.rs)0
-rw-r--r--tests/ui/parser/issues/issue-105366.stderr (renamed from tests/ui/parser/issue-105366.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-105634.rs (renamed from tests/ui/parser/issue-105634.rs)0
-rw-r--r--tests/ui/parser/issues/issue-107705.rs (renamed from tests/ui/parser/issue-107705.rs)0
-rw-r--r--tests/ui/parser/issues/issue-107705.stderr (renamed from tests/ui/parser/issue-107705.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-108109-fn-missing-params.fixed9
-rw-r--r--tests/ui/parser/issues/issue-108109-fn-missing-params.rs9
-rw-r--r--tests/ui/parser/issues/issue-108109-fn-missing-params.stderr14
-rw-r--r--tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.fixed8
-rw-r--r--tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.rs8
-rw-r--r--tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.stderr11
-rw-r--r--tests/ui/parser/issues/issue-108495-dec.rs (renamed from tests/ui/parser/issue-108495-dec.rs)0
-rw-r--r--tests/ui/parser/issues/issue-108495-dec.stderr (renamed from tests/ui/parser/issue-108495-dec.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-112188.fixed (renamed from tests/ui/parser/issue-112188.fixed)0
-rw-r--r--tests/ui/parser/issues/issue-112188.rs (renamed from tests/ui/parser/issue-112188.rs)0
-rw-r--r--tests/ui/parser/issues/issue-112188.stderr (renamed from tests/ui/parser/issue-112188.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-113342.rs (renamed from tests/ui/parser/issue-113342.rs)0
-rw-r--r--tests/ui/parser/issues/issue-113342.stderr (renamed from tests/ui/parser/issue-113342.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-15980.rs3
-rw-r--r--tests/ui/parser/issues/issue-15980.stderr13
-rw-r--r--tests/ui/parser/issues/issue-17718-parse-const.rs (renamed from tests/ui/parser/issue-17718-parse-const.rs)0
-rw-r--r--tests/ui/parser/issues/issue-32505.rs1
-rw-r--r--tests/ui/parser/issues/issue-32505.stderr18
-rw-r--r--tests/ui/parser/issues/issue-39616.rs (renamed from tests/ui/parser/issue-39616.rs)0
-rw-r--r--tests/ui/parser/issues/issue-39616.stderr (renamed from tests/ui/parser/issue-39616.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-49257.rs (renamed from tests/ui/parser/issue-49257.rs)0
-rw-r--r--tests/ui/parser/issues/issue-49257.stderr (renamed from tests/ui/parser/issue-49257.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-52496.stderr9
-rw-r--r--tests/ui/parser/issues/issue-61858.rs (renamed from tests/ui/parser/issue-61858.rs)0
-rw-r--r--tests/ui/parser/issues/issue-61858.stderr (renamed from tests/ui/parser/issue-61858.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-68091-unicode-ident-after-if.rs (renamed from tests/ui/parser/issue-68091-unicode-ident-after-if.rs)0
-rw-r--r--tests/ui/parser/issues/issue-68091-unicode-ident-after-if.stderr (renamed from tests/ui/parser/issue-68091-unicode-ident-after-if.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.rs (renamed from tests/ui/parser/issue-68092-unicode-ident-after-incomplete-expr.rs)0
-rw-r--r--tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.stderr (renamed from tests/ui/parser/issue-68092-unicode-ident-after-incomplete-expr.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-68987-unmatch-issue-1.rs (renamed from tests/ui/parser/issue-68987-unmatch-issue-1.rs)0
-rw-r--r--tests/ui/parser/issues/issue-68987-unmatch-issue-1.stderr (renamed from tests/ui/parser/issue-68987-unmatch-issue-1.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-68987-unmatch-issue-2.rs (renamed from tests/ui/parser/issue-68987-unmatch-issue-2.rs)0
-rw-r--r--tests/ui/parser/issues/issue-68987-unmatch-issue-2.stderr (renamed from tests/ui/parser/issue-68987-unmatch-issue-2.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-68987-unmatch-issue-3.rs (renamed from tests/ui/parser/issue-68987-unmatch-issue-3.rs)0
-rw-r--r--tests/ui/parser/issues/issue-68987-unmatch-issue-3.stderr (renamed from tests/ui/parser/issue-68987-unmatch-issue-3.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-68987-unmatch-issue.rs (renamed from tests/ui/parser/issue-68987-unmatch-issue.rs)0
-rw-r--r--tests/ui/parser/issues/issue-68987-unmatch-issue.stderr (renamed from tests/ui/parser/issue-68987-unmatch-issue.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-81804.rs (renamed from tests/ui/parser/issue-81804.rs)0
-rw-r--r--tests/ui/parser/issues/issue-81804.stderr (renamed from tests/ui/parser/issue-81804.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-81827.rs (renamed from tests/ui/parser/issue-81827.rs)0
-rw-r--r--tests/ui/parser/issues/issue-81827.stderr (renamed from tests/ui/parser/issue-81827.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-84117.stderr3
-rw-r--r--tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.rs5
-rw-r--r--tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr11
-rw-r--r--tests/ui/parser/issues/issue-87217-keyword-order/recovery.rs22
-rw-r--r--tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr28
-rw-r--r--tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.rs5
-rw-r--r--tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr11
-rw-r--r--tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.rs2
-rw-r--r--tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.rs2
-rw-r--r--tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs2
-rw-r--r--tests/ui/parser/issues/issue-87694-duplicated-pub.rs (renamed from tests/ui/parser/issue-87694-duplicated-pub.rs)0
-rw-r--r--tests/ui/parser/issues/issue-87694-duplicated-pub.stderr (renamed from tests/ui/parser/issue-87694-duplicated-pub.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-87694-misplaced-pub.rs (renamed from tests/ui/parser/issue-87694-misplaced-pub.rs)0
-rw-r--r--tests/ui/parser/issues/issue-87694-misplaced-pub.stderr (renamed from tests/ui/parser/issue-87694-misplaced-pub.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-89396.fixed4
-rw-r--r--tests/ui/parser/issues/issue-89396.rs4
-rw-r--r--tests/ui/parser/issues/issue-89396.stderr4
-rw-r--r--tests/ui/parser/issues/issue-90728.rs (renamed from tests/ui/parser/issue-90728.rs)0
-rw-r--r--tests/ui/parser/issues/issue-90728.stderr (renamed from tests/ui/parser/issue-90728.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-91421.rs (renamed from tests/ui/parser/issue-91421.rs)0
-rw-r--r--tests/ui/parser/issues/issue-91421.stderr (renamed from tests/ui/parser/issue-91421.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.fixed (renamed from tests/ui/parser/issue-99625-enum-struct-mutually-exclusive.fixed)0
-rw-r--r--tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.rs (renamed from tests/ui/parser/issue-99625-enum-struct-mutually-exclusive.rs)0
-rw-r--r--tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr (renamed from tests/ui/parser/issue-99625-enum-struct-mutually-exclusive.stderr)0
-rw-r--r--tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.fixed (renamed from tests/ui/parser/issue-99910-const-let-mutually-exclusive.fixed)0
-rw-r--r--tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.rs (renamed from tests/ui/parser/issue-99910-const-let-mutually-exclusive.rs)0
-rw-r--r--tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr (renamed from tests/ui/parser/issue-99910-const-let-mutually-exclusive.stderr)0
-rw-r--r--tests/ui/parser/macro/macro-repeat.stderr2
-rw-r--r--tests/ui/parser/missing-fat-arrow.rs38
-rw-r--r--tests/ui/parser/missing-fat-arrow.stderr78
-rw-r--r--tests/ui/parser/mod_file_not_exist.stderr1
-rw-r--r--tests/ui/parser/mod_file_not_exist_windows.stderr1
-rw-r--r--tests/ui/parser/recover-missing-semi-before-item.fixed2
-rw-r--r--tests/ui/parser/recover-missing-semi-before-item.rs2
-rw-r--r--tests/ui/parser/recover-quantified-closure.stderr4
-rw-r--r--tests/ui/parser/removed-syntax-fn-sigil.rs3
-rw-r--r--tests/ui/parser/removed-syntax-fn-sigil.stderr14
-rw-r--r--tests/ui/parser/removed-syntax-with-2.stderr5
-rw-r--r--tests/ui/parser/semi-in-let-chain.rs27
-rw-r--r--tests/ui/parser/semi-in-let-chain.stderr50
-rw-r--r--tests/ui/parser/ternary_operator.rs59
-rw-r--r--tests/ui/parser/ternary_operator.stderr91
-rw-r--r--tests/ui/parser/unsafe-mod.stderr1
-rw-r--r--tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs6
-rw-r--r--tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr13
-rw-r--r--tests/ui/parser/variadic-ffi-semantic-restrictions.rs17
-rw-r--r--tests/ui/parser/variadic-ffi-semantic-restrictions.stderr103
178 files changed, 875 insertions, 299 deletions
diff --git a/tests/ui/parser/assoc-const-underscore-semantic-fail.rs b/tests/ui/parser/assoc/assoc-const-underscore-semantic-fail.rs
index d37ce06c5..d37ce06c5 100644
--- a/tests/ui/parser/assoc-const-underscore-semantic-fail.rs
+++ b/tests/ui/parser/assoc/assoc-const-underscore-semantic-fail.rs
diff --git a/tests/ui/parser/assoc-const-underscore-semantic-fail.stderr b/tests/ui/parser/assoc/assoc-const-underscore-semantic-fail.stderr
index 538bf0ec1..538bf0ec1 100644
--- a/tests/ui/parser/assoc-const-underscore-semantic-fail.stderr
+++ b/tests/ui/parser/assoc/assoc-const-underscore-semantic-fail.stderr
diff --git a/tests/ui/parser/assoc-const-underscore-syntactic-pass.rs b/tests/ui/parser/assoc/assoc-const-underscore-syntactic-pass.rs
index 60da408c8..60da408c8 100644
--- a/tests/ui/parser/assoc-const-underscore-syntactic-pass.rs
+++ b/tests/ui/parser/assoc/assoc-const-underscore-syntactic-pass.rs
diff --git a/tests/ui/parser/assoc-oddities-1.rs b/tests/ui/parser/assoc/assoc-oddities-1.rs
index 5914805e5..5914805e5 100644
--- a/tests/ui/parser/assoc-oddities-1.rs
+++ b/tests/ui/parser/assoc/assoc-oddities-1.rs
diff --git a/tests/ui/parser/assoc-oddities-1.stderr b/tests/ui/parser/assoc/assoc-oddities-1.stderr
index acf71b489..acf71b489 100644
--- a/tests/ui/parser/assoc-oddities-1.stderr
+++ b/tests/ui/parser/assoc/assoc-oddities-1.stderr
diff --git a/tests/ui/parser/assoc-oddities-2.rs b/tests/ui/parser/assoc/assoc-oddities-2.rs
index 3d35aad74..3d35aad74 100644
--- a/tests/ui/parser/assoc-oddities-2.rs
+++ b/tests/ui/parser/assoc/assoc-oddities-2.rs
diff --git a/tests/ui/parser/assoc-oddities-2.stderr b/tests/ui/parser/assoc/assoc-oddities-2.stderr
index d3b90c34c..d3b90c34c 100644
--- a/tests/ui/parser/assoc-oddities-2.stderr
+++ b/tests/ui/parser/assoc/assoc-oddities-2.stderr
diff --git a/tests/ui/parser/assoc-static-semantic-fail.rs b/tests/ui/parser/assoc/assoc-static-semantic-fail.rs
index 403160f12..403160f12 100644
--- a/tests/ui/parser/assoc-static-semantic-fail.rs
+++ b/tests/ui/parser/assoc/assoc-static-semantic-fail.rs
diff --git a/tests/ui/parser/assoc-static-semantic-fail.stderr b/tests/ui/parser/assoc/assoc-static-semantic-fail.stderr
index 8178bd223..8178bd223 100644
--- a/tests/ui/parser/assoc-static-semantic-fail.stderr
+++ b/tests/ui/parser/assoc/assoc-static-semantic-fail.stderr
diff --git a/tests/ui/parser/assoc-static-syntactic-fail.rs b/tests/ui/parser/assoc/assoc-static-syntactic-fail.rs
index 492f2ea16..492f2ea16 100644
--- a/tests/ui/parser/assoc-static-syntactic-fail.rs
+++ b/tests/ui/parser/assoc/assoc-static-syntactic-fail.rs
diff --git a/tests/ui/parser/assoc-static-syntactic-fail.stderr b/tests/ui/parser/assoc/assoc-static-syntactic-fail.stderr
index e97236145..e97236145 100644
--- a/tests/ui/parser/assoc-static-syntactic-fail.stderr
+++ b/tests/ui/parser/assoc/assoc-static-syntactic-fail.stderr
diff --git a/tests/ui/parser/assoc-type-in-type-arg.rs b/tests/ui/parser/assoc/assoc-type-in-type-arg.rs
index 000956ea2..000956ea2 100644
--- a/tests/ui/parser/assoc-type-in-type-arg.rs
+++ b/tests/ui/parser/assoc/assoc-type-in-type-arg.rs
diff --git a/tests/ui/parser/assoc-type-in-type-arg.stderr b/tests/ui/parser/assoc/assoc-type-in-type-arg.stderr
index b637702f2..b637702f2 100644
--- a/tests/ui/parser/assoc-type-in-type-arg.stderr
+++ b/tests/ui/parser/assoc/assoc-type-in-type-arg.stderr
diff --git a/tests/ui/parser/associated-types-project-from-hrtb-explicit.rs b/tests/ui/parser/assoc/associated-types-project-from-hrtb-explicit.rs
index b238a9ca2..b238a9ca2 100644
--- a/tests/ui/parser/associated-types-project-from-hrtb-explicit.rs
+++ b/tests/ui/parser/assoc/associated-types-project-from-hrtb-explicit.rs
diff --git a/tests/ui/parser/associated-types-project-from-hrtb-explicit.stderr b/tests/ui/parser/assoc/associated-types-project-from-hrtb-explicit.stderr
index aa0fa0e3c..aa0fa0e3c 100644
--- a/tests/ui/parser/associated-types-project-from-hrtb-explicit.stderr
+++ b/tests/ui/parser/assoc/associated-types-project-from-hrtb-explicit.stderr
diff --git a/tests/ui/parser/attr-bad-meta-2.rs b/tests/ui/parser/attribute/attr-bad-meta-2.rs
index db612ed88..db612ed88 100644
--- a/tests/ui/parser/attr-bad-meta-2.rs
+++ b/tests/ui/parser/attribute/attr-bad-meta-2.rs
diff --git a/tests/ui/parser/attr-bad-meta-2.stderr b/tests/ui/parser/attribute/attr-bad-meta-2.stderr
index 6fc6fb665..6fc6fb665 100644
--- a/tests/ui/parser/attr-bad-meta-2.stderr
+++ b/tests/ui/parser/attribute/attr-bad-meta-2.stderr
diff --git a/tests/ui/parser/attr-bad-meta-3.rs b/tests/ui/parser/attribute/attr-bad-meta-3.rs
index b51e9f221..b51e9f221 100644
--- a/tests/ui/parser/attr-bad-meta-3.rs
+++ b/tests/ui/parser/attribute/attr-bad-meta-3.rs
diff --git a/tests/ui/parser/attr-bad-meta-3.stderr b/tests/ui/parser/attribute/attr-bad-meta-3.stderr
index 4fa420c79..4fa420c79 100644
--- a/tests/ui/parser/attr-bad-meta-3.stderr
+++ b/tests/ui/parser/attribute/attr-bad-meta-3.stderr
diff --git a/tests/ui/parser/attr-bad-meta.rs b/tests/ui/parser/attribute/attr-bad-meta.rs
index 8001977f5..8001977f5 100644
--- a/tests/ui/parser/attr-bad-meta.rs
+++ b/tests/ui/parser/attribute/attr-bad-meta.rs
diff --git a/tests/ui/parser/attr-bad-meta.stderr b/tests/ui/parser/attribute/attr-bad-meta.stderr
index 8d65c423c..8d65c423c 100644
--- a/tests/ui/parser/attr-bad-meta.stderr
+++ b/tests/ui/parser/attribute/attr-bad-meta.stderr
diff --git a/tests/ui/parser/attr-before-eof.rs b/tests/ui/parser/attribute/attr-before-eof.rs
index 6af1783e6..6af1783e6 100644
--- a/tests/ui/parser/attr-before-eof.rs
+++ b/tests/ui/parser/attribute/attr-before-eof.rs
diff --git a/tests/ui/parser/attr-before-eof.stderr b/tests/ui/parser/attribute/attr-before-eof.stderr
index a2acb9437..a2acb9437 100644
--- a/tests/ui/parser/attr-before-eof.stderr
+++ b/tests/ui/parser/attribute/attr-before-eof.stderr
diff --git a/tests/ui/parser/attr-dangling-in-fn.rs b/tests/ui/parser/attribute/attr-dangling-in-fn.rs
index c7c45bafb..c7c45bafb 100644
--- a/tests/ui/parser/attr-dangling-in-fn.rs
+++ b/tests/ui/parser/attribute/attr-dangling-in-fn.rs
diff --git a/tests/ui/parser/attr-dangling-in-fn.stderr b/tests/ui/parser/attribute/attr-dangling-in-fn.stderr
index b1bb3ab3b..b1bb3ab3b 100644
--- a/tests/ui/parser/attr-dangling-in-fn.stderr
+++ b/tests/ui/parser/attribute/attr-dangling-in-fn.stderr
diff --git a/tests/ui/parser/attr-dangling-in-mod.rs b/tests/ui/parser/attribute/attr-dangling-in-mod.rs
index 261ed3913..261ed3913 100644
--- a/tests/ui/parser/attr-dangling-in-mod.rs
+++ b/tests/ui/parser/attribute/attr-dangling-in-mod.rs
diff --git a/tests/ui/parser/attr-dangling-in-mod.stderr b/tests/ui/parser/attribute/attr-dangling-in-mod.stderr
index 1c892eac0..1c892eac0 100644
--- a/tests/ui/parser/attr-dangling-in-mod.stderr
+++ b/tests/ui/parser/attribute/attr-dangling-in-mod.stderr
diff --git a/tests/ui/parser/attr-stmt-expr-attr-bad.rs b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs
index d1950087c..d1950087c 100644
--- a/tests/ui/parser/attr-stmt-expr-attr-bad.rs
+++ b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs
diff --git a/tests/ui/parser/attr-stmt-expr-attr-bad.stderr b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr
index 96899fd3f..e46c59108 100644
--- a/tests/ui/parser/attr-stmt-expr-attr-bad.stderr
+++ b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr
@@ -27,6 +27,7 @@ LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
= note: outer attributes, like `#[test]`, annotate the item following them
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: expected expression, found `)`
--> $DIR/attr-stmt-expr-attr-bad.rs:7:44
diff --git a/tests/ui/parser/attr-with-a-semicolon.rs b/tests/ui/parser/attribute/attr-with-a-semicolon.rs
index 56fe40b91..56fe40b91 100644
--- a/tests/ui/parser/attr-with-a-semicolon.rs
+++ b/tests/ui/parser/attribute/attr-with-a-semicolon.rs
diff --git a/tests/ui/parser/attr-with-a-semicolon.stderr b/tests/ui/parser/attribute/attr-with-a-semicolon.stderr
index 0de3490b8..0de3490b8 100644
--- a/tests/ui/parser/attr-with-a-semicolon.stderr
+++ b/tests/ui/parser/attribute/attr-with-a-semicolon.stderr
diff --git a/tests/ui/parser/attr.rs b/tests/ui/parser/attribute/attr.rs
index 42b2dfde8..42b2dfde8 100644
--- a/tests/ui/parser/attr.rs
+++ b/tests/ui/parser/attribute/attr.rs
diff --git a/tests/ui/parser/attr.stderr b/tests/ui/parser/attribute/attr.stderr
index 7cd0ac224..7cd0ac224 100644
--- a/tests/ui/parser/attr.stderr
+++ b/tests/ui/parser/attribute/attr.stderr
diff --git a/tests/ui/parser/attribute-with-no-generics-in-parameter-list.rs b/tests/ui/parser/attribute/attribute-with-no-generics-in-parameter-list.rs
index c2cc91d8f..c2cc91d8f 100644
--- a/tests/ui/parser/attribute-with-no-generics-in-parameter-list.rs
+++ b/tests/ui/parser/attribute/attribute-with-no-generics-in-parameter-list.rs
diff --git a/tests/ui/parser/attribute-with-no-generics-in-parameter-list.stderr b/tests/ui/parser/attribute/attribute-with-no-generics-in-parameter-list.stderr
index 4c5964715..4c5964715 100644
--- a/tests/ui/parser/attribute-with-no-generics-in-parameter-list.stderr
+++ b/tests/ui/parser/attribute/attribute-with-no-generics-in-parameter-list.stderr
diff --git a/tests/ui/parser/attrs-after-extern-mod.rs b/tests/ui/parser/attribute/attrs-after-extern-mod.rs
index e3f0fa0fc..e3f0fa0fc 100644
--- a/tests/ui/parser/attrs-after-extern-mod.rs
+++ b/tests/ui/parser/attribute/attrs-after-extern-mod.rs
diff --git a/tests/ui/parser/attrs-after-extern-mod.stderr b/tests/ui/parser/attribute/attrs-after-extern-mod.stderr
index 135d98457..135d98457 100644
--- a/tests/ui/parser/attrs-after-extern-mod.stderr
+++ b/tests/ui/parser/attribute/attrs-after-extern-mod.stderr
diff --git a/tests/ui/parser/break-in-unlabeled-block-in-macro.rs b/tests/ui/parser/break-in-unlabeled-block-in-macro.rs
new file mode 100644
index 000000000..eecc0026b
--- /dev/null
+++ b/tests/ui/parser/break-in-unlabeled-block-in-macro.rs
@@ -0,0 +1,43 @@
+macro_rules! foo {
+ () => {
+ break (); //~ ERROR `break` outside of a loop or labeled block
+ };
+ ($e: expr) => {
+ break $e; //~ ERROR `break` outside of a loop or labeled block
+ };
+ (stmt $s: stmt) => {
+ $s
+ };
+ (@ $e: expr) => {
+ { break $e; } //~ ERROR `break` outside of a loop or labeled block
+ };
+ (=> $s: stmt) => {
+ { $s }
+ };
+}
+
+fn main() {
+ {
+ foo!();
+ }
+ {
+ foo!(());
+ }
+ {
+ foo!(stmt break ()); //~ ERROR `break` outside of a loop or labeled block
+ }
+ {
+ foo!(@ ());
+ }
+ {
+ foo!(=> break ()); //~ ERROR `break` outside of a loop or labeled block
+ }
+ {
+ macro_rules! bar {
+ () => {
+ break () //~ ERROR `break` outside of a loop or labeled block
+ };
+ }
+ bar!()
+ }
+}
diff --git a/tests/ui/parser/break-in-unlabeled-block-in-macro.stderr b/tests/ui/parser/break-in-unlabeled-block-in-macro.stderr
new file mode 100644
index 000000000..9407e8ac0
--- /dev/null
+++ b/tests/ui/parser/break-in-unlabeled-block-in-macro.stderr
@@ -0,0 +1,69 @@
+error[E0268]: `break` outside of a loop or labeled block
+ --> $DIR/break-in-unlabeled-block-in-macro.rs:3:9
+ |
+LL | break ();
+ | ^^^^^^^^ cannot `break` outside of a loop or labeled block
+...
+LL | foo!();
+ | ------ in this macro invocation
+ |
+ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0268]: `break` outside of a loop or labeled block
+ --> $DIR/break-in-unlabeled-block-in-macro.rs:6:9
+ |
+LL | break $e;
+ | ^^^^^^^^ cannot `break` outside of a loop or labeled block
+...
+LL | foo!(());
+ | -------- in this macro invocation
+ |
+ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0268]: `break` outside of a loop or labeled block
+ --> $DIR/break-in-unlabeled-block-in-macro.rs:27:19
+ |
+LL | foo!(stmt break ());
+ | ^^^^^^^^ cannot `break` outside of a loop or labeled block
+ |
+help: consider labeling this block to be able to break within it
+ |
+LL ~ 'block: {
+LL ~ foo!(stmt break 'block ());
+ |
+
+error[E0268]: `break` outside of a loop or labeled block
+ --> $DIR/break-in-unlabeled-block-in-macro.rs:12:11
+ |
+LL | { break $e; }
+ | ^^^^^^^^ cannot `break` outside of a loop or labeled block
+...
+LL | foo!(@ ());
+ | ---------- in this macro invocation
+ |
+ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider labeling this block to be able to break within it
+ |
+LL | 'block: { break 'block $e; }
+ | +++++++ ++++++
+
+error[E0268]: `break` outside of a loop or labeled block
+ --> $DIR/break-in-unlabeled-block-in-macro.rs:33:17
+ |
+LL | foo!(=> break ());
+ | ^^^^^^^^ cannot `break` outside of a loop or labeled block
+
+error[E0268]: `break` outside of a loop or labeled block
+ --> $DIR/break-in-unlabeled-block-in-macro.rs:38:17
+ |
+LL | break ()
+ | ^^^^^^^^ cannot `break` outside of a loop or labeled block
+...
+LL | bar!()
+ | ------ in this macro invocation
+ |
+ = note: this error originates in the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0268`.
diff --git a/tests/ui/parser/break-in-unlabeled-block.fixed b/tests/ui/parser/break-in-unlabeled-block.fixed
new file mode 100644
index 000000000..088562325
--- /dev/null
+++ b/tests/ui/parser/break-in-unlabeled-block.fixed
@@ -0,0 +1,11 @@
+// run-rustfix
+fn main() {
+ 'block: {
+ break 'block (); //~ ERROR `break` outside of a loop or labeled block
+ }
+ {
+ 'block: {
+ break 'block (); //~ ERROR `break` outside of a loop or labeled block
+ }
+ }
+}
diff --git a/tests/ui/parser/break-in-unlabeled-block.rs b/tests/ui/parser/break-in-unlabeled-block.rs
new file mode 100644
index 000000000..3e5587e9f
--- /dev/null
+++ b/tests/ui/parser/break-in-unlabeled-block.rs
@@ -0,0 +1,11 @@
+// run-rustfix
+fn main() {
+ {
+ break (); //~ ERROR `break` outside of a loop or labeled block
+ }
+ {
+ {
+ break (); //~ ERROR `break` outside of a loop or labeled block
+ }
+ }
+}
diff --git a/tests/ui/parser/break-in-unlabeled-block.stderr b/tests/ui/parser/break-in-unlabeled-block.stderr
new file mode 100644
index 000000000..632cca80d
--- /dev/null
+++ b/tests/ui/parser/break-in-unlabeled-block.stderr
@@ -0,0 +1,27 @@
+error[E0268]: `break` outside of a loop or labeled block
+ --> $DIR/break-in-unlabeled-block.rs:4:9
+ |
+LL | break ();
+ | ^^^^^^^^ cannot `break` outside of a loop or labeled block
+ |
+help: consider labeling this block to be able to break within it
+ |
+LL ~ 'block: {
+LL ~ break 'block ();
+ |
+
+error[E0268]: `break` outside of a loop or labeled block
+ --> $DIR/break-in-unlabeled-block.rs:8:13
+ |
+LL | break ();
+ | ^^^^^^^^ cannot `break` outside of a loop or labeled block
+ |
+help: consider labeling this block to be able to break within it
+ |
+LL ~ 'block: {
+LL ~ break 'block ();
+ |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0268`.
diff --git a/tests/ui/parser/deep-unmatched-angle-brackets.rs b/tests/ui/parser/deep-unmatched-angle-brackets.rs
new file mode 100644
index 000000000..f8d490e1c
--- /dev/null
+++ b/tests/ui/parser/deep-unmatched-angle-brackets.rs
@@ -0,0 +1,17 @@
+trait Mul<T> {
+ type Output;
+}
+trait Matrix: Mul<<Self as Matrix>::Row, Output = ()> {
+ type Row;
+ type Transpose: Matrix<Row = Self::Row>;
+}
+fn is_mul<S, T: Mul<S, Output = ()>>() {}
+fn f<T: Matrix>() {
+ is_mul::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<
+ f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<
+ f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<
+ f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::
+ <f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<>();
+ //~^ ERROR expected one of `!`, `+`, `,`, `::`, or `>`, found `(`
+}
+fn main() {}
diff --git a/tests/ui/parser/deep-unmatched-angle-brackets.stderr b/tests/ui/parser/deep-unmatched-angle-brackets.stderr
new file mode 100644
index 000000000..1f2850374
--- /dev/null
+++ b/tests/ui/parser/deep-unmatched-angle-brackets.stderr
@@ -0,0 +1,13 @@
+error: expected one of `!`, `+`, `,`, `::`, or `>`, found `(`
+ --> $DIR/deep-unmatched-angle-brackets.rs:14:63
+ |
+LL | <f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<>();
+ | ^ expected one of `!`, `+`, `,`, `::`, or `>`
+ |
+help: you might have meant to end the type parameters here
+ |
+LL | <f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<f::<>>();
+ | +
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/diff-markers/unclosed-delims-in-macro.rs b/tests/ui/parser/diff-markers/unclosed-delims-in-macro.rs
new file mode 100644
index 000000000..da1774ace
--- /dev/null
+++ b/tests/ui/parser/diff-markers/unclosed-delims-in-macro.rs
@@ -0,0 +1,9 @@
+macro_rules! foo {
+<<<<<<< HEAD
+ //~^ ERROR encountered diff marker
+ () {
+=======
+ () { //
+>>>>>>> 7a4f13c blah blah blah
+ }
+}
diff --git a/tests/ui/parser/diff-markers/unclosed-delims-in-macro.stderr b/tests/ui/parser/diff-markers/unclosed-delims-in-macro.stderr
new file mode 100644
index 000000000..e0b6f1b5e
--- /dev/null
+++ b/tests/ui/parser/diff-markers/unclosed-delims-in-macro.stderr
@@ -0,0 +1,18 @@
+error: encountered diff marker
+ --> $DIR/unclosed-delims-in-macro.rs:2:1
+ |
+LL | <<<<<<< HEAD
+ | ^^^^^^^ after this is the code before the merge
+...
+LL | =======
+ | -------
+LL | () { //
+LL | >>>>>>> 7a4f13c blah blah blah
+ | ^^^^^^^ above this are the incoming code changes
+ |
+ = help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code
+ = help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased
+ = note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/diff-markers/unclosed-delims.rs b/tests/ui/parser/diff-markers/unclosed-delims.rs
new file mode 100644
index 000000000..653a605c2
--- /dev/null
+++ b/tests/ui/parser/diff-markers/unclosed-delims.rs
@@ -0,0 +1,14 @@
+mod tests {
+ #[test]
+<<<<<<< HEAD
+//~^ ERROR encountered diff marker
+//~| NOTE after this is the code before the merge
+//~| NOTE for an explanation on these markers
+ fn test1() {
+=======
+//~^ NOTE
+ fn test2() {
+>>>>>>> 7a4f13c blah blah blah
+//~^ NOTE above this are the incoming code changes
+ }
+}
diff --git a/tests/ui/parser/diff-markers/unclosed-delims.stderr b/tests/ui/parser/diff-markers/unclosed-delims.stderr
new file mode 100644
index 000000000..67199179b
--- /dev/null
+++ b/tests/ui/parser/diff-markers/unclosed-delims.stderr
@@ -0,0 +1,18 @@
+error: encountered diff marker
+ --> $DIR/unclosed-delims.rs:3:1
+ |
+LL | <<<<<<< HEAD
+ | ^^^^^^^ after this is the code before the merge
+...
+LL | =======
+ | -------
+...
+LL | >>>>>>> 7a4f13c blah blah blah
+ | ^^^^^^^ above this are the incoming code changes
+ |
+ = help: if you're having merge conflicts after pulling new code, the top section is the code you already had and the bottom section is the remote code
+ = help: if you're in the middle of a rebase, the top section is the code being rebased onto and the bottom section is the code coming from the current commit being rebased
+ = note: for an explanation on these markers from the `git` documentation, visit <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/doc-comment-in-stmt.fixed b/tests/ui/parser/doc-comment-in-stmt.fixed
new file mode 100644
index 000000000..4b3ecccf6
--- /dev/null
+++ b/tests/ui/parser/doc-comment-in-stmt.fixed
@@ -0,0 +1,27 @@
+// run-rustfix
+#![allow(unused)]
+fn foo() -> bool {
+ false
+ // !self.allow_ty_infer()
+ //~^ ERROR found doc comment
+}
+
+fn bar() -> bool {
+ false
+ /* ! bar */ //~ ERROR found doc comment
+}
+
+fn baz() -> i32 {
+ 1 /* * baz */ //~ ERROR found doc comment
+}
+
+fn quux() -> i32 {
+ 2 // / quux
+ //~^ ERROR found doc comment
+}
+
+fn main() {
+ let x = 0;
+ let y = x.max(1) // !foo //~ ERROR found doc comment
+ .min(2);
+}
diff --git a/tests/ui/parser/doc-comment-in-stmt.rs b/tests/ui/parser/doc-comment-in-stmt.rs
index b02df1321..73d08f51c 100644
--- a/tests/ui/parser/doc-comment-in-stmt.rs
+++ b/tests/ui/parser/doc-comment-in-stmt.rs
@@ -1,3 +1,5 @@
+// run-rustfix
+#![allow(unused)]
fn foo() -> bool {
false
//!self.allow_ty_infer()
@@ -14,7 +16,12 @@ fn baz() -> i32 {
}
fn quux() -> i32 {
- 2 /*! quux */ //~ ERROR found doc comment
+ 2 /// quux
+ //~^ ERROR found doc comment
}
-fn main() {}
+fn main() {
+ let x = 0;
+ let y = x.max(1) //!foo //~ ERROR found doc comment
+ .min(2);
+}
diff --git a/tests/ui/parser/doc-comment-in-stmt.stderr b/tests/ui/parser/doc-comment-in-stmt.stderr
index febfb600c..7aefd5c99 100644
--- a/tests/ui/parser/doc-comment-in-stmt.stderr
+++ b/tests/ui/parser/doc-comment-in-stmt.stderr
@@ -1,50 +1,61 @@
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `//!self.allow_ty_infer()`
- --> $DIR/doc-comment-in-stmt.rs:3:5
+ --> $DIR/doc-comment-in-stmt.rs:5:5
|
LL | false
| - expected one of `.`, `;`, `?`, `}`, or an operator
LL | //!self.allow_ty_infer()
| ^^^^^^^^^^^^^^^^^^^^^^^^ unexpected token
|
-help: add a space before `!` to use a regular comment
+help: add a space before `!` to write a regular comment
|
LL | // !self.allow_ty_infer()
- | ~~~~
+ | +
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/*! bar */`
- --> $DIR/doc-comment-in-stmt.rs:9:5
+ --> $DIR/doc-comment-in-stmt.rs:11:5
|
LL | false
| - expected one of `.`, `;`, `?`, `}`, or an operator
LL | /*! bar */
| ^^^^^^^^^^ unexpected token
|
-help: add a space before `!` to use a regular comment
+help: add a space before `!` to write a regular comment
|
LL | /* ! bar */
- | ~~~~
+ | +
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/** baz */`
- --> $DIR/doc-comment-in-stmt.rs:13:7
+ --> $DIR/doc-comment-in-stmt.rs:15:7
|
LL | 1 /** baz */
| ^^^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
-help: add a space before `*` to use a regular comment
+help: add a space before the last `*` to write a regular comment
|
LL | 1 /* * baz */
- | ~~~~
+ | +
-error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/*! quux */`
- --> $DIR/doc-comment-in-stmt.rs:17:7
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/// quux`
+ --> $DIR/doc-comment-in-stmt.rs:19:7
|
-LL | 2 /*! quux */
- | ^^^^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
+LL | 2 /// quux
+ | ^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
-help: add a space before `!` to use a regular comment
+help: add a space before the last `/` to write a regular comment
|
-LL | 2 /* ! quux */
- | ~~~~
+LL | 2 // / quux
+ | +
-error: aborting due to 4 previous errors
+error: expected one of `.`, `;`, `?`, `else`, or an operator, found doc comment `//!foo
+ --> $DIR/doc-comment-in-stmt.rs:25:22
+ |
+LL | let y = x.max(1) //!foo
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected one of `.`, `;`, `?`, `else`, or an operator
+ |
+help: add a space before `!` to write a regular comment
+ |
+LL | let y = x.max(1) // !foo
+ | +
+
+error: aborting due to 5 previous errors
diff --git a/tests/ui/parser/emoji-identifiers.stderr b/tests/ui/parser/emoji-identifiers.stderr
index e645b68ba..8250dd1ea 100644
--- a/tests/ui/parser/emoji-identifiers.stderr
+++ b/tests/ui/parser/emoji-identifiers.stderr
@@ -75,6 +75,12 @@ LL | 👀::full_of✨()
| |
| function or associated item not found in `👀`
| help: there is an associated function with a similar name: `full_of_✨`
+ |
+note: if you're trying to build a new `👀`, consider using `👀::full_of_✨` which returns `👀`
+ --> $DIR/emoji-identifiers.rs:4:5
+ |
+LL | fn full_of_✨() -> 👀 {
+ | ^^^^^^^^^^^^^^^^^^^^^
error[E0425]: cannot find function `i_like_to_😄_a_lot` in this scope
--> $DIR/emoji-identifiers.rs:13:13
diff --git a/tests/ui/parser/fn-header-semantic-fail.rs b/tests/ui/parser/fn-header-semantic-fail.rs
index 71f18a27e..f8b58cad7 100644
--- a/tests/ui/parser/fn-header-semantic-fail.rs
+++ b/tests/ui/parser/fn-header-semantic-fail.rs
@@ -13,25 +13,23 @@ fn main() {
//~^ ERROR functions cannot be both `const` and `async`
trait X {
- async fn ft1(); //~ ERROR functions in traits cannot be declared `async`
+ async fn ft1(); // OK.
unsafe fn ft2(); // OK.
const fn ft3(); //~ ERROR functions in traits cannot be declared const
extern "C" fn ft4(); // OK.
const async unsafe extern "C" fn ft5();
- //~^ ERROR functions in traits cannot be declared `async`
- //~| ERROR functions in traits cannot be declared const
+ //~^ ERROR functions in traits cannot be declared const
//~| ERROR functions cannot be both `const` and `async`
}
struct Y;
impl X for Y {
- async fn ft1() {} //~ ERROR functions in traits cannot be declared `async`
+ async fn ft1() {} // OK.
unsafe fn ft2() {} // OK.
const fn ft3() {} //~ ERROR functions in traits cannot be declared const
extern "C" fn ft4() {}
const async unsafe extern "C" fn ft5() {}
- //~^ ERROR functions in traits cannot be declared `async`
- //~| ERROR functions in traits cannot be declared const
+ //~^ ERROR functions in traits cannot be declared const
//~| ERROR functions cannot be both `const` and `async`
}
diff --git a/tests/ui/parser/fn-header-semantic-fail.stderr b/tests/ui/parser/fn-header-semantic-fail.stderr
index 7f7b7e835..cdf01e0c5 100644
--- a/tests/ui/parser/fn-header-semantic-fail.stderr
+++ b/tests/ui/parser/fn-header-semantic-fail.stderr
@@ -29,19 +29,19 @@ LL | const async unsafe extern "C" fn ft5();
| `const` because of this
error[E0379]: functions in traits cannot be declared const
- --> $DIR/fn-header-semantic-fail.rs:30:9
+ --> $DIR/fn-header-semantic-fail.rs:29:9
|
LL | const fn ft3() {}
| ^^^^^ functions in traits cannot be const
error[E0379]: functions in traits cannot be declared const
- --> $DIR/fn-header-semantic-fail.rs:32:9
+ --> $DIR/fn-header-semantic-fail.rs:31:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^ functions in traits cannot be const
error: functions cannot be both `const` and `async`
- --> $DIR/fn-header-semantic-fail.rs:32:9
+ --> $DIR/fn-header-semantic-fail.rs:31:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^-^^^^^------------------------------
@@ -50,7 +50,7 @@ LL | const async unsafe extern "C" fn ft5() {}
| `const` because of this
error: functions cannot be both `const` and `async`
- --> $DIR/fn-header-semantic-fail.rs:43:9
+ --> $DIR/fn-header-semantic-fail.rs:41:9
|
LL | const async unsafe extern "C" fn fi5() {}
| ^^^^^-^^^^^------------------------------
@@ -59,7 +59,7 @@ LL | const async unsafe extern "C" fn fi5() {}
| `const` because of this
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:48:18
+ --> $DIR/fn-header-semantic-fail.rs:46:18
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -72,7 +72,7 @@ LL | fn fe1();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:49:19
+ --> $DIR/fn-header-semantic-fail.rs:47:19
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -86,7 +86,7 @@ LL | fn fe2();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:50:18
+ --> $DIR/fn-header-semantic-fail.rs:48:18
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -100,7 +100,7 @@ LL | fn fe3();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:51:23
+ --> $DIR/fn-header-semantic-fail.rs:49:23
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -114,7 +114,7 @@ LL | fn fe4();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:52:42
+ --> $DIR/fn-header-semantic-fail.rs:50:42
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -128,7 +128,7 @@ LL | fn fe5();
| ~~
error: functions cannot be both `const` and `async`
- --> $DIR/fn-header-semantic-fail.rs:52:9
+ --> $DIR/fn-header-semantic-fail.rs:50:9
|
LL | const async unsafe extern "C" fn fe5();
| ^^^^^-^^^^^----------------------------
@@ -136,59 +136,6 @@ LL | const async unsafe extern "C" fn fe5();
| | `async` because of this
| `const` because of this
-error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:16:9
- |
-LL | async fn ft1();
- | -----^^^^^^^^^^
- | |
- | `async` because of this
- |
- = note: `async` trait functions are not currently supported
- = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
- = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
- = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
-
-error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:20:9
- |
-LL | const async unsafe extern "C" fn ft5();
- | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | `async` because of this
- |
- = note: `async` trait functions are not currently supported
- = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
- = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
- = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
-
-error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:28:9
- |
-LL | async fn ft1() {}
- | -----^^^^^^^^^
- | |
- | `async` because of this
- |
- = note: `async` trait functions are not currently supported
- = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
- = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
- = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
-
-error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:32:9
- |
-LL | const async unsafe extern "C" fn ft5() {}
- | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | `async` because of this
- |
- = note: `async` trait functions are not currently supported
- = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
- = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
- = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
-
-error: aborting due to 18 previous errors
+error: aborting due to 14 previous errors
-Some errors have detailed explanations: E0379, E0706.
-For more information about an error, try `rustc --explain E0379`.
+For more information about this error, try `rustc --explain E0379`.
diff --git a/tests/ui/parser/issue-116781.rs b/tests/ui/parser/issue-116781.rs
new file mode 100644
index 000000000..0e951d2ea
--- /dev/null
+++ b/tests/ui/parser/issue-116781.rs
@@ -0,0 +1,8 @@
+#[derive(Debug)]
+struct Foo {
+ #[cfg(all())]
+ field: fn(($),), //~ ERROR expected pattern, found `$`
+ //~^ ERROR expected pattern, found `$`
+}
+
+fn main() {}
diff --git a/tests/ui/parser/issue-116781.stderr b/tests/ui/parser/issue-116781.stderr
new file mode 100644
index 000000000..1a77b60a5
--- /dev/null
+++ b/tests/ui/parser/issue-116781.stderr
@@ -0,0 +1,16 @@
+error: expected pattern, found `$`
+ --> $DIR/issue-116781.rs:4:16
+ |
+LL | field: fn(($),),
+ | ^ expected pattern
+
+error: expected pattern, found `$`
+ --> $DIR/issue-116781.rs:4:16
+ |
+LL | field: fn(($),),
+ | ^ expected pattern
+ |
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/parser/issue-100197-mut-let.fixed b/tests/ui/parser/issues/issue-100197-mut-let.fixed
index 5a8956222..5a8956222 100644
--- a/tests/ui/parser/issue-100197-mut-let.fixed
+++ b/tests/ui/parser/issues/issue-100197-mut-let.fixed
diff --git a/tests/ui/parser/issue-100197-mut-let.rs b/tests/ui/parser/issues/issue-100197-mut-let.rs
index 71103813a..71103813a 100644
--- a/tests/ui/parser/issue-100197-mut-let.rs
+++ b/tests/ui/parser/issues/issue-100197-mut-let.rs
diff --git a/tests/ui/parser/issue-100197-mut-let.stderr b/tests/ui/parser/issues/issue-100197-mut-let.stderr
index 86658e4f3..86658e4f3 100644
--- a/tests/ui/parser/issue-100197-mut-let.stderr
+++ b/tests/ui/parser/issues/issue-100197-mut-let.stderr
diff --git a/tests/ui/parser/issue-101477-enum.fixed b/tests/ui/parser/issues/issue-101477-enum.fixed
index 1dfeae22a..1dfeae22a 100644
--- a/tests/ui/parser/issue-101477-enum.fixed
+++ b/tests/ui/parser/issues/issue-101477-enum.fixed
diff --git a/tests/ui/parser/issue-101477-enum.rs b/tests/ui/parser/issues/issue-101477-enum.rs
index ea7051d69..ea7051d69 100644
--- a/tests/ui/parser/issue-101477-enum.rs
+++ b/tests/ui/parser/issues/issue-101477-enum.rs
diff --git a/tests/ui/parser/issue-101477-enum.stderr b/tests/ui/parser/issues/issue-101477-enum.stderr
index 94130671f..94130671f 100644
--- a/tests/ui/parser/issue-101477-enum.stderr
+++ b/tests/ui/parser/issues/issue-101477-enum.stderr
diff --git a/tests/ui/parser/issue-101477-let.fixed b/tests/ui/parser/issues/issue-101477-let.fixed
index 9989ad815..9989ad815 100644
--- a/tests/ui/parser/issue-101477-let.fixed
+++ b/tests/ui/parser/issues/issue-101477-let.fixed
diff --git a/tests/ui/parser/issue-101477-let.rs b/tests/ui/parser/issues/issue-101477-let.rs
index 8b0e8bee1..8b0e8bee1 100644
--- a/tests/ui/parser/issue-101477-let.rs
+++ b/tests/ui/parser/issues/issue-101477-let.rs
diff --git a/tests/ui/parser/issue-101477-let.stderr b/tests/ui/parser/issues/issue-101477-let.stderr
index 1b30d4b17..1b30d4b17 100644
--- a/tests/ui/parser/issue-101477-let.stderr
+++ b/tests/ui/parser/issues/issue-101477-let.stderr
diff --git a/tests/ui/parser/issue-102806.rs b/tests/ui/parser/issues/issue-102806.rs
index ba297bdc9..ba297bdc9 100644
--- a/tests/ui/parser/issue-102806.rs
+++ b/tests/ui/parser/issues/issue-102806.rs
diff --git a/tests/ui/parser/issue-102806.stderr b/tests/ui/parser/issues/issue-102806.stderr
index ba8174a82..ba8174a82 100644
--- a/tests/ui/parser/issue-102806.stderr
+++ b/tests/ui/parser/issues/issue-102806.stderr
diff --git a/tests/ui/parser/issue-103143.rs b/tests/ui/parser/issues/issue-103143.rs
index a584274c4..a584274c4 100644
--- a/tests/ui/parser/issue-103143.rs
+++ b/tests/ui/parser/issues/issue-103143.rs
diff --git a/tests/ui/parser/issue-103143.stderr b/tests/ui/parser/issues/issue-103143.stderr
index 4035c69af..4035c69af 100644
--- a/tests/ui/parser/issue-103143.stderr
+++ b/tests/ui/parser/issues/issue-103143.stderr
diff --git a/tests/ui/parser/issue-103381.fixed b/tests/ui/parser/issues/issue-103381.fixed
index 6a9fb9910..6a9fb9910 100644
--- a/tests/ui/parser/issue-103381.fixed
+++ b/tests/ui/parser/issues/issue-103381.fixed
diff --git a/tests/ui/parser/issue-103381.rs b/tests/ui/parser/issues/issue-103381.rs
index bf79e1010..bf79e1010 100644
--- a/tests/ui/parser/issue-103381.rs
+++ b/tests/ui/parser/issues/issue-103381.rs
diff --git a/tests/ui/parser/issue-103381.stderr b/tests/ui/parser/issues/issue-103381.stderr
index 85fcc18e7..85fcc18e7 100644
--- a/tests/ui/parser/issue-103381.stderr
+++ b/tests/ui/parser/issues/issue-103381.stderr
diff --git a/tests/ui/parser/issue-103425.rs b/tests/ui/parser/issues/issue-103425.rs
index c2f8123ca..c2f8123ca 100644
--- a/tests/ui/parser/issue-103425.rs
+++ b/tests/ui/parser/issues/issue-103425.rs
diff --git a/tests/ui/parser/issue-103425.stderr b/tests/ui/parser/issues/issue-103425.stderr
index 0efe3e3ca..0efe3e3ca 100644
--- a/tests/ui/parser/issue-103425.stderr
+++ b/tests/ui/parser/issues/issue-103425.stderr
diff --git a/tests/ui/parser/issue-103451.rs b/tests/ui/parser/issues/issue-103451.rs
index be33213f3..be33213f3 100644
--- a/tests/ui/parser/issue-103451.rs
+++ b/tests/ui/parser/issues/issue-103451.rs
diff --git a/tests/ui/parser/issue-103451.stderr b/tests/ui/parser/issues/issue-103451.stderr
index 6aacd5012..6aacd5012 100644
--- a/tests/ui/parser/issue-103451.stderr
+++ b/tests/ui/parser/issues/issue-103451.stderr
diff --git a/tests/ui/parser/issue-103748-ICE-wrong-braces.rs b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs
index 8012cb652..8012cb652 100644
--- a/tests/ui/parser/issue-103748-ICE-wrong-braces.rs
+++ b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.rs
diff --git a/tests/ui/parser/issue-103748-ICE-wrong-braces.stderr b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr
index b0d8b03ae..b0d8b03ae 100644
--- a/tests/ui/parser/issue-103748-ICE-wrong-braces.stderr
+++ b/tests/ui/parser/issues/issue-103748-ICE-wrong-braces.stderr
diff --git a/tests/ui/parser/issue-104620.rs b/tests/ui/parser/issues/issue-104620.rs
index f49476c44..f49476c44 100644
--- a/tests/ui/parser/issue-104620.rs
+++ b/tests/ui/parser/issues/issue-104620.rs
diff --git a/tests/ui/parser/issue-104620.stderr b/tests/ui/parser/issues/issue-104620.stderr
index d06a6b255..d06a6b255 100644
--- a/tests/ui/parser/issue-104620.stderr
+++ b/tests/ui/parser/issues/issue-104620.stderr
diff --git a/tests/ui/parser/issue-104867-inc-dec-2.rs b/tests/ui/parser/issues/issue-104867-inc-dec-2.rs
index a006421a9..a006421a9 100644
--- a/tests/ui/parser/issue-104867-inc-dec-2.rs
+++ b/tests/ui/parser/issues/issue-104867-inc-dec-2.rs
diff --git a/tests/ui/parser/issue-104867-inc-dec-2.stderr b/tests/ui/parser/issues/issue-104867-inc-dec-2.stderr
index 4e2d05468..4e2d05468 100644
--- a/tests/ui/parser/issue-104867-inc-dec-2.stderr
+++ b/tests/ui/parser/issues/issue-104867-inc-dec-2.stderr
diff --git a/tests/ui/parser/issue-104867-inc-dec.rs b/tests/ui/parser/issues/issue-104867-inc-dec.rs
index 760c67b4b..760c67b4b 100644
--- a/tests/ui/parser/issue-104867-inc-dec.rs
+++ b/tests/ui/parser/issues/issue-104867-inc-dec.rs
diff --git a/tests/ui/parser/issue-104867-inc-dec.stderr b/tests/ui/parser/issues/issue-104867-inc-dec.stderr
index 78bfd3e82..78bfd3e82 100644
--- a/tests/ui/parser/issue-104867-inc-dec.stderr
+++ b/tests/ui/parser/issues/issue-104867-inc-dec.stderr
diff --git a/tests/ui/parser/issue-105366.fixed b/tests/ui/parser/issues/issue-105366.fixed
index ad26643c3..ad26643c3 100644
--- a/tests/ui/parser/issue-105366.fixed
+++ b/tests/ui/parser/issues/issue-105366.fixed
diff --git a/tests/ui/parser/issue-105366.rs b/tests/ui/parser/issues/issue-105366.rs
index 311b6a60f..311b6a60f 100644
--- a/tests/ui/parser/issue-105366.rs
+++ b/tests/ui/parser/issues/issue-105366.rs
diff --git a/tests/ui/parser/issue-105366.stderr b/tests/ui/parser/issues/issue-105366.stderr
index 0a7408e2c..0a7408e2c 100644
--- a/tests/ui/parser/issue-105366.stderr
+++ b/tests/ui/parser/issues/issue-105366.stderr
diff --git a/tests/ui/parser/issue-105634.rs b/tests/ui/parser/issues/issue-105634.rs
index 579aa6e5b..579aa6e5b 100644
--- a/tests/ui/parser/issue-105634.rs
+++ b/tests/ui/parser/issues/issue-105634.rs
diff --git a/tests/ui/parser/issue-107705.rs b/tests/ui/parser/issues/issue-107705.rs
index b80984fcd..b80984fcd 100644
--- a/tests/ui/parser/issue-107705.rs
+++ b/tests/ui/parser/issues/issue-107705.rs
diff --git a/tests/ui/parser/issue-107705.stderr b/tests/ui/parser/issues/issue-107705.stderr
index d2d613461..d2d613461 100644
--- a/tests/ui/parser/issue-107705.stderr
+++ b/tests/ui/parser/issues/issue-107705.stderr
diff --git a/tests/ui/parser/issues/issue-108109-fn-missing-params.fixed b/tests/ui/parser/issues/issue-108109-fn-missing-params.fixed
new file mode 100644
index 000000000..b819aa810
--- /dev/null
+++ b/tests/ui/parser/issues/issue-108109-fn-missing-params.fixed
@@ -0,0 +1,9 @@
+// run-rustfix
+
+pub fn missing() -> () {}
+//~^ ERROR missing parameters for function definition
+
+pub fn missing2() {}
+//~^ ERROR missing parameters for function definition
+
+fn main() {}
diff --git a/tests/ui/parser/issues/issue-108109-fn-missing-params.rs b/tests/ui/parser/issues/issue-108109-fn-missing-params.rs
new file mode 100644
index 000000000..01efe7280
--- /dev/null
+++ b/tests/ui/parser/issues/issue-108109-fn-missing-params.rs
@@ -0,0 +1,9 @@
+// run-rustfix
+
+pub fn missing -> () {}
+//~^ ERROR missing parameters for function definition
+
+pub fn missing2 {}
+//~^ ERROR missing parameters for function definition
+
+fn main() {}
diff --git a/tests/ui/parser/issues/issue-108109-fn-missing-params.stderr b/tests/ui/parser/issues/issue-108109-fn-missing-params.stderr
new file mode 100644
index 000000000..86d3449cc
--- /dev/null
+++ b/tests/ui/parser/issues/issue-108109-fn-missing-params.stderr
@@ -0,0 +1,14 @@
+error: missing parameters for function definition
+ --> $DIR/issue-108109-fn-missing-params.rs:3:15
+ |
+LL | pub fn missing -> () {}
+ | ^ help: add a parameter list
+
+error: missing parameters for function definition
+ --> $DIR/issue-108109-fn-missing-params.rs:6:16
+ |
+LL | pub fn missing2 {}
+ | ^ help: add a parameter list
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.fixed b/tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.fixed
new file mode 100644
index 000000000..eaae28886
--- /dev/null
+++ b/tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.fixed
@@ -0,0 +1,8 @@
+// run-rustfix
+
+pub fn func<F>() where F: FnOnce() -> () {}
+//~^ ERROR expected one of
+//~| NOTE expected one of
+//~| NOTE `Fn` bounds require arguments in parentheses
+
+fn main() {}
diff --git a/tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.rs b/tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.rs
new file mode 100644
index 000000000..ea5c71150
--- /dev/null
+++ b/tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.rs
@@ -0,0 +1,8 @@
+// run-rustfix
+
+pub fn func<F>() where F: FnOnce -> () {}
+//~^ ERROR expected one of
+//~| NOTE expected one of
+//~| NOTE `Fn` bounds require arguments in parentheses
+
+fn main() {}
diff --git a/tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.stderr b/tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.stderr
new file mode 100644
index 000000000..7cda66757
--- /dev/null
+++ b/tests/ui/parser/issues/issue-108109-fn-trait-missing-paren.stderr
@@ -0,0 +1,11 @@
+error: expected one of `(`, `+`, `,`, `::`, `<`, or `{`, found `->`
+ --> $DIR/issue-108109-fn-trait-missing-paren.rs:3:34
+ |
+LL | pub fn func<F>() where F: FnOnce -> () {}
+ | -------^^ expected one of `(`, `+`, `,`, `::`, `<`, or `{`
+ | | |
+ | | help: try adding parentheses
+ | `Fn` bounds require arguments in parentheses
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/issue-108495-dec.rs b/tests/ui/parser/issues/issue-108495-dec.rs
index e0816f84e..e0816f84e 100644
--- a/tests/ui/parser/issue-108495-dec.rs
+++ b/tests/ui/parser/issues/issue-108495-dec.rs
diff --git a/tests/ui/parser/issue-108495-dec.stderr b/tests/ui/parser/issues/issue-108495-dec.stderr
index 85b29038f..85b29038f 100644
--- a/tests/ui/parser/issue-108495-dec.stderr
+++ b/tests/ui/parser/issues/issue-108495-dec.stderr
diff --git a/tests/ui/parser/issue-112188.fixed b/tests/ui/parser/issues/issue-112188.fixed
index 5e73d8e38..5e73d8e38 100644
--- a/tests/ui/parser/issue-112188.fixed
+++ b/tests/ui/parser/issues/issue-112188.fixed
diff --git a/tests/ui/parser/issue-112188.rs b/tests/ui/parser/issues/issue-112188.rs
index 27ca192e5..27ca192e5 100644
--- a/tests/ui/parser/issue-112188.rs
+++ b/tests/ui/parser/issues/issue-112188.rs
diff --git a/tests/ui/parser/issue-112188.stderr b/tests/ui/parser/issues/issue-112188.stderr
index 6d2d8e6a3..6d2d8e6a3 100644
--- a/tests/ui/parser/issue-112188.stderr
+++ b/tests/ui/parser/issues/issue-112188.stderr
diff --git a/tests/ui/parser/issue-113342.rs b/tests/ui/parser/issues/issue-113342.rs
index 18b502736..18b502736 100644
--- a/tests/ui/parser/issue-113342.rs
+++ b/tests/ui/parser/issues/issue-113342.rs
diff --git a/tests/ui/parser/issue-113342.stderr b/tests/ui/parser/issues/issue-113342.stderr
index a0c5e665f..a0c5e665f 100644
--- a/tests/ui/parser/issue-113342.stderr
+++ b/tests/ui/parser/issues/issue-113342.stderr
diff --git a/tests/ui/parser/issues/issue-15980.rs b/tests/ui/parser/issues/issue-15980.rs
index 87faa7d5f..eb7b6ca82 100644
--- a/tests/ui/parser/issues/issue-15980.rs
+++ b/tests/ui/parser/issues/issue-15980.rs
@@ -9,9 +9,6 @@ fn main(){
//~^ ERROR expected identifier, found keyword `return`
//~| NOTE expected identifier, found keyword
}
- //~^ NOTE expected one of `.`, `=>`, `?`, or an operator
_ => {}
- //~^ ERROR expected one of `.`, `=>`, `?`, or an operator, found reserved identifier `_`
- //~| NOTE unexpected token
}
}
diff --git a/tests/ui/parser/issues/issue-15980.stderr b/tests/ui/parser/issues/issue-15980.stderr
index c59c81119..cf8d01147 100644
--- a/tests/ui/parser/issues/issue-15980.stderr
+++ b/tests/ui/parser/issues/issue-15980.stderr
@@ -11,15 +11,10 @@ help: escape `return` to use it as an identifier
|
LL | r#return
| ++
-
-error: expected one of `.`, `=>`, `?`, or an operator, found reserved identifier `_`
- --> $DIR/issue-15980.rs:13:9
+help: you might have meant to start a match arm after the match guard
|
-LL | }
- | - expected one of `.`, `=>`, `?`, or an operator
-LL |
-LL | _ => {}
- | ^ unexpected token
+LL | Err(ref e) if e.kind == io::EndOfFile => {
+ | ++
-error: aborting due to 2 previous errors
+error: aborting due to previous error
diff --git a/tests/ui/parser/issue-17718-parse-const.rs b/tests/ui/parser/issues/issue-17718-parse-const.rs
index d5a5f445d..d5a5f445d 100644
--- a/tests/ui/parser/issue-17718-parse-const.rs
+++ b/tests/ui/parser/issues/issue-17718-parse-const.rs
diff --git a/tests/ui/parser/issues/issue-32505.rs b/tests/ui/parser/issues/issue-32505.rs
index f31c00e5c..d95e7dc7d 100644
--- a/tests/ui/parser/issues/issue-32505.rs
+++ b/tests/ui/parser/issues/issue-32505.rs
@@ -1,5 +1,6 @@
pub fn test() {
foo(|_|) //~ ERROR expected expression, found `)`
+ //~^ ERROR cannot find function `foo` in this scope
}
fn main() { }
diff --git a/tests/ui/parser/issues/issue-32505.stderr b/tests/ui/parser/issues/issue-32505.stderr
index cdd779a93..27ad2c3e5 100644
--- a/tests/ui/parser/issues/issue-32505.stderr
+++ b/tests/ui/parser/issues/issue-32505.stderr
@@ -2,7 +2,21 @@ error: expected expression, found `)`
--> $DIR/issue-32505.rs:2:12
|
LL | foo(|_|)
- | ^ expected expression
+ | ---^ expected expression
+ | |
+ | while parsing the body of this closure
+ |
+help: you might have meant to open the body of the closure
+ |
+LL | foo(|_| {})
+ | ++
+
+error[E0425]: cannot find function `foo` in this scope
+ --> $DIR/issue-32505.rs:2:5
+ |
+LL | foo(|_|)
+ | ^^^ not found in this scope
-error: aborting due to previous error
+error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/parser/issue-39616.rs b/tests/ui/parser/issues/issue-39616.rs
index 46b5aa334..46b5aa334 100644
--- a/tests/ui/parser/issue-39616.rs
+++ b/tests/ui/parser/issues/issue-39616.rs
diff --git a/tests/ui/parser/issue-39616.stderr b/tests/ui/parser/issues/issue-39616.stderr
index 393d1f2e2..393d1f2e2 100644
--- a/tests/ui/parser/issue-39616.stderr
+++ b/tests/ui/parser/issues/issue-39616.stderr
diff --git a/tests/ui/parser/issue-49257.rs b/tests/ui/parser/issues/issue-49257.rs
index a7fa19d52..a7fa19d52 100644
--- a/tests/ui/parser/issue-49257.rs
+++ b/tests/ui/parser/issues/issue-49257.rs
diff --git a/tests/ui/parser/issue-49257.stderr b/tests/ui/parser/issues/issue-49257.stderr
index 97e16f88b..97e16f88b 100644
--- a/tests/ui/parser/issue-49257.stderr
+++ b/tests/ui/parser/issues/issue-49257.stderr
diff --git a/tests/ui/parser/issues/issue-52496.stderr b/tests/ui/parser/issues/issue-52496.stderr
index 77335c64c..78c81bf5b 100644
--- a/tests/ui/parser/issues/issue-52496.stderr
+++ b/tests/ui/parser/issues/issue-52496.stderr
@@ -8,10 +8,15 @@ error: expected one of `,`, `:`, or `}`, found `.`
--> $DIR/issue-52496.rs:8:22
|
LL | let _ = Foo { bar.into(), bat: -1, . };
- | --- - ^ expected one of `,`, `:`, or `}`
+ | --- ---^ expected one of `,`, `:`, or `}`
| | |
- | | help: try naming a field: `bar:`
+ | | while parsing this struct field
| while parsing this struct
+ |
+help: try naming a field
+ |
+LL | let _ = Foo { bar: bar.into(), bat: -1, . };
+ | ++++
error: expected identifier, found `.`
--> $DIR/issue-52496.rs:8:40
diff --git a/tests/ui/parser/issue-61858.rs b/tests/ui/parser/issues/issue-61858.rs
index 6c3b56586..6c3b56586 100644
--- a/tests/ui/parser/issue-61858.rs
+++ b/tests/ui/parser/issues/issue-61858.rs
diff --git a/tests/ui/parser/issue-61858.stderr b/tests/ui/parser/issues/issue-61858.stderr
index 03f51c6e3..03f51c6e3 100644
--- a/tests/ui/parser/issue-61858.stderr
+++ b/tests/ui/parser/issues/issue-61858.stderr
diff --git a/tests/ui/parser/issue-68091-unicode-ident-after-if.rs b/tests/ui/parser/issues/issue-68091-unicode-ident-after-if.rs
index 57d36feb3..57d36feb3 100644
--- a/tests/ui/parser/issue-68091-unicode-ident-after-if.rs
+++ b/tests/ui/parser/issues/issue-68091-unicode-ident-after-if.rs
diff --git a/tests/ui/parser/issue-68091-unicode-ident-after-if.stderr b/tests/ui/parser/issues/issue-68091-unicode-ident-after-if.stderr
index 6674b924e..6674b924e 100644
--- a/tests/ui/parser/issue-68091-unicode-ident-after-if.stderr
+++ b/tests/ui/parser/issues/issue-68091-unicode-ident-after-if.stderr
diff --git a/tests/ui/parser/issue-68092-unicode-ident-after-incomplete-expr.rs b/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.rs
index 1a90b4724..1a90b4724 100644
--- a/tests/ui/parser/issue-68092-unicode-ident-after-incomplete-expr.rs
+++ b/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.rs
diff --git a/tests/ui/parser/issue-68092-unicode-ident-after-incomplete-expr.stderr b/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.stderr
index 0b9c364f1..0b9c364f1 100644
--- a/tests/ui/parser/issue-68092-unicode-ident-after-incomplete-expr.stderr
+++ b/tests/ui/parser/issues/issue-68092-unicode-ident-after-incomplete-expr.stderr
diff --git a/tests/ui/parser/issue-68987-unmatch-issue-1.rs b/tests/ui/parser/issues/issue-68987-unmatch-issue-1.rs
index 30e7ef467..30e7ef467 100644
--- a/tests/ui/parser/issue-68987-unmatch-issue-1.rs
+++ b/tests/ui/parser/issues/issue-68987-unmatch-issue-1.rs
diff --git a/tests/ui/parser/issue-68987-unmatch-issue-1.stderr b/tests/ui/parser/issues/issue-68987-unmatch-issue-1.stderr
index 2d873b461..2d873b461 100644
--- a/tests/ui/parser/issue-68987-unmatch-issue-1.stderr
+++ b/tests/ui/parser/issues/issue-68987-unmatch-issue-1.stderr
diff --git a/tests/ui/parser/issue-68987-unmatch-issue-2.rs b/tests/ui/parser/issues/issue-68987-unmatch-issue-2.rs
index 89aaa68ba..89aaa68ba 100644
--- a/tests/ui/parser/issue-68987-unmatch-issue-2.rs
+++ b/tests/ui/parser/issues/issue-68987-unmatch-issue-2.rs
diff --git a/tests/ui/parser/issue-68987-unmatch-issue-2.stderr b/tests/ui/parser/issues/issue-68987-unmatch-issue-2.stderr
index 0ecb748a0..0ecb748a0 100644
--- a/tests/ui/parser/issue-68987-unmatch-issue-2.stderr
+++ b/tests/ui/parser/issues/issue-68987-unmatch-issue-2.stderr
diff --git a/tests/ui/parser/issue-68987-unmatch-issue-3.rs b/tests/ui/parser/issues/issue-68987-unmatch-issue-3.rs
index e98df8d7c..e98df8d7c 100644
--- a/tests/ui/parser/issue-68987-unmatch-issue-3.rs
+++ b/tests/ui/parser/issues/issue-68987-unmatch-issue-3.rs
diff --git a/tests/ui/parser/issue-68987-unmatch-issue-3.stderr b/tests/ui/parser/issues/issue-68987-unmatch-issue-3.stderr
index dfc4407ed..dfc4407ed 100644
--- a/tests/ui/parser/issue-68987-unmatch-issue-3.stderr
+++ b/tests/ui/parser/issues/issue-68987-unmatch-issue-3.stderr
diff --git a/tests/ui/parser/issue-68987-unmatch-issue.rs b/tests/ui/parser/issues/issue-68987-unmatch-issue.rs
index 5a3620bf2..5a3620bf2 100644
--- a/tests/ui/parser/issue-68987-unmatch-issue.rs
+++ b/tests/ui/parser/issues/issue-68987-unmatch-issue.rs
diff --git a/tests/ui/parser/issue-68987-unmatch-issue.stderr b/tests/ui/parser/issues/issue-68987-unmatch-issue.stderr
index cabd13324..cabd13324 100644
--- a/tests/ui/parser/issue-68987-unmatch-issue.stderr
+++ b/tests/ui/parser/issues/issue-68987-unmatch-issue.stderr
diff --git a/tests/ui/parser/issue-81804.rs b/tests/ui/parser/issues/issue-81804.rs
index ebc4752a1..ebc4752a1 100644
--- a/tests/ui/parser/issue-81804.rs
+++ b/tests/ui/parser/issues/issue-81804.rs
diff --git a/tests/ui/parser/issue-81804.stderr b/tests/ui/parser/issues/issue-81804.stderr
index de3b33ecd..de3b33ecd 100644
--- a/tests/ui/parser/issue-81804.stderr
+++ b/tests/ui/parser/issues/issue-81804.stderr
diff --git a/tests/ui/parser/issue-81827.rs b/tests/ui/parser/issues/issue-81827.rs
index 91defd12a..91defd12a 100644
--- a/tests/ui/parser/issue-81827.rs
+++ b/tests/ui/parser/issues/issue-81827.rs
diff --git a/tests/ui/parser/issue-81827.stderr b/tests/ui/parser/issues/issue-81827.stderr
index 63d135f73..63d135f73 100644
--- a/tests/ui/parser/issue-81827.stderr
+++ b/tests/ui/parser/issues/issue-81827.stderr
diff --git a/tests/ui/parser/issues/issue-84117.stderr b/tests/ui/parser/issues/issue-84117.stderr
index 237bc11bd..958f3b40b 100644
--- a/tests/ui/parser/issues/issue-84117.stderr
+++ b/tests/ui/parser/issues/issue-84117.stderr
@@ -47,6 +47,7 @@ LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
| |
| while parsing the type for `inner_local`
|
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: you might have meant to end the type parameters here
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str>, }
@@ -61,6 +62,8 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, fo
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
| ^ expected one of 8 possible tokens
+ |
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
--> $DIR/issue-84117.rs:2:33
diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.rs b/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.rs
index df0cd5439..099178a7d 100644
--- a/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.rs
+++ b/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.rs
@@ -7,3 +7,8 @@ const async const fn test() {}
//~| NOTE expected one of `extern`, `fn`, or `unsafe`
//~| HELP `const` already used earlier, remove this one
//~| NOTE `const` first seen here
+//~| ERROR functions cannot be both `const` and `async`
+//~| NOTE `const` because of this
+//~| NOTE `async` because of this
+
+fn main() {}
diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr
index 977c6ebfe..4c55179ce 100644
--- a/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr
+++ b/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr
@@ -13,5 +13,14 @@ note: `const` first seen here
LL | const async const fn test() {}
| ^^^^^
-error: aborting due to previous error
+error: functions cannot be both `const` and `async`
+ --> $DIR/const-async-const.rs:5:1
+ |
+LL | const async const fn test() {}
+ | ^^^^^-^^^^^-------------------
+ | | |
+ | | `async` because of this
+ | `const` because of this
+
+error: aborting due to 2 previous errors
diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/recovery.rs b/tests/ui/parser/issues/issue-87217-keyword-order/recovery.rs
new file mode 100644
index 000000000..9d7fe4389
--- /dev/null
+++ b/tests/ui/parser/issues/issue-87217-keyword-order/recovery.rs
@@ -0,0 +1,22 @@
+// test for #115714
+
+struct Misplaced;
+
+impl Misplaced {
+ unsafe const fn from_u32(val: u32) {}
+ //~^ ERROR expected one of `extern` or `fn`
+ fn oof(self){}
+}
+
+struct Duplicated;
+
+impl Duplicated {
+ unsafe unsafe fn from_u32(val: u32) {}
+ //~^ ERROR expected one of `extern` or `fn`
+ fn oof(self){}
+}
+
+fn main() {
+ Misplaced.oof();
+ Duplicated.oof();
+}
diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr
new file mode 100644
index 000000000..3f504a9eb
--- /dev/null
+++ b/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr
@@ -0,0 +1,28 @@
+error: expected one of `extern` or `fn`, found keyword `const`
+ --> $DIR/recovery.rs:6:12
+ |
+LL | unsafe const fn from_u32(val: u32) {}
+ | -------^^^^^
+ | | |
+ | | expected one of `extern` or `fn`
+ | help: `const` must come before `unsafe`: `const unsafe`
+ |
+ = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
+
+error: expected one of `extern` or `fn`, found keyword `unsafe`
+ --> $DIR/recovery.rs:14:12
+ |
+LL | unsafe unsafe fn from_u32(val: u32) {}
+ | ^^^^^^
+ | |
+ | expected one of `extern` or `fn`
+ | help: `unsafe` already used earlier, remove this one
+ |
+note: `unsafe` first seen here
+ --> $DIR/recovery.rs:14:5
+ |
+LL | unsafe unsafe fn from_u32(val: u32) {}
+ | ^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.rs b/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.rs
index bbebc99e9..479426626 100644
--- a/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.rs
+++ b/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.rs
@@ -12,3 +12,8 @@ async unsafe const fn test() {}
//~| HELP `const` must come before `async unsafe`
//~| SUGGESTION const async unsafe
//~| NOTE keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
+//~| ERROR functions cannot be both `const` and `async`
+//~| NOTE `const` because of this
+//~| NOTE `async` because of this
+
+fn main() {}
diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr
index f455caba1..489e8eefb 100644
--- a/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr
+++ b/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr
@@ -9,5 +9,14 @@ LL | async unsafe const fn test() {}
|
= note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
-error: aborting due to previous error
+error: functions cannot be both `const` and `async`
+ --> $DIR/several-kw-jump.rs:9:1
+ |
+LL | async unsafe const fn test() {}
+ | ^^^^^--------^^^^^-------------
+ | | |
+ | | `const` because of this
+ | `async` because of this
+
+error: aborting due to 2 previous errors
diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.rs b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.rs
index 4ff4cf5c8..867f71c12 100644
--- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.rs
+++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.rs
@@ -12,3 +12,5 @@ unsafe async fn test() {}
//~| HELP `async` must come before `unsafe`
//~| SUGGESTION async unsafe
//~| NOTE keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
+
+fn main() {}
diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.rs b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.rs
index 2f5fbc513..9a7f28210 100644
--- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.rs
+++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.rs
@@ -12,3 +12,5 @@ unsafe const fn test() {}
//~| HELP `const` must come before `unsafe`
//~| SUGGESTION const unsafe
//~| NOTE keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
+
+fn main() {}
diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs
index df2412e3e..8305ff4f6 100644
--- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs
+++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs
@@ -12,3 +12,5 @@ extern unsafe fn test() {}
//~| HELP `unsafe` must come before `extern`
//~| SUGGESTION unsafe extern
//~| NOTE keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern`
+
+fn main() {}
diff --git a/tests/ui/parser/issue-87694-duplicated-pub.rs b/tests/ui/parser/issues/issue-87694-duplicated-pub.rs
index e3ea61dc4..e3ea61dc4 100644
--- a/tests/ui/parser/issue-87694-duplicated-pub.rs
+++ b/tests/ui/parser/issues/issue-87694-duplicated-pub.rs
diff --git a/tests/ui/parser/issue-87694-duplicated-pub.stderr b/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr
index 8d242bc9d..8d242bc9d 100644
--- a/tests/ui/parser/issue-87694-duplicated-pub.stderr
+++ b/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr
diff --git a/tests/ui/parser/issue-87694-misplaced-pub.rs b/tests/ui/parser/issues/issue-87694-misplaced-pub.rs
index 3f824617c..3f824617c 100644
--- a/tests/ui/parser/issue-87694-misplaced-pub.rs
+++ b/tests/ui/parser/issues/issue-87694-misplaced-pub.rs
diff --git a/tests/ui/parser/issue-87694-misplaced-pub.stderr b/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr
index 94c6a29ef..94c6a29ef 100644
--- a/tests/ui/parser/issue-87694-misplaced-pub.stderr
+++ b/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr
diff --git a/tests/ui/parser/issues/issue-89396.fixed b/tests/ui/parser/issues/issue-89396.fixed
index 823ad8cd1..0c040ddea 100644
--- a/tests/ui/parser/issues/issue-89396.fixed
+++ b/tests/ui/parser/issues/issue-89396.fixed
@@ -8,9 +8,9 @@ fn main() {
let _ = match opt {
Some(_) => true,
//~^ ERROR: expected one of
- //~| HELP: try using a fat arrow here
+ //~| HELP: use a fat arrow to start a match arm
None => false,
//~^ ERROR: expected one of
- //~| HELP: try using a fat arrow here
+ //~| HELP: use a fat arrow to start a match arm
};
}
diff --git a/tests/ui/parser/issues/issue-89396.rs b/tests/ui/parser/issues/issue-89396.rs
index f1d9efa52..d95f666d7 100644
--- a/tests/ui/parser/issues/issue-89396.rs
+++ b/tests/ui/parser/issues/issue-89396.rs
@@ -8,9 +8,9 @@ fn main() {
let _ = match opt {
Some(_) = true,
//~^ ERROR: expected one of
- //~| HELP: try using a fat arrow here
+ //~| HELP: use a fat arrow to start a match arm
None -> false,
//~^ ERROR: expected one of
- //~| HELP: try using a fat arrow here
+ //~| HELP: use a fat arrow to start a match arm
};
}
diff --git a/tests/ui/parser/issues/issue-89396.stderr b/tests/ui/parser/issues/issue-89396.stderr
index 504420574..41ce07050 100644
--- a/tests/ui/parser/issues/issue-89396.stderr
+++ b/tests/ui/parser/issues/issue-89396.stderr
@@ -5,7 +5,7 @@ LL | Some(_) = true,
| ^
| |
| expected one of `=>`, `if`, or `|`
- | help: try using a fat arrow here: `=>`
+ | help: use a fat arrow to start a match arm: `=>`
error: expected one of `=>`, `@`, `if`, or `|`, found `->`
--> $DIR/issue-89396.rs:12:14
@@ -14,7 +14,7 @@ LL | None -> false,
| ^^
| |
| expected one of `=>`, `@`, `if`, or `|`
- | help: try using a fat arrow here: `=>`
+ | help: use a fat arrow to start a match arm: `=>`
error: aborting due to 2 previous errors
diff --git a/tests/ui/parser/issue-90728.rs b/tests/ui/parser/issues/issue-90728.rs
index d6a898361..d6a898361 100644
--- a/tests/ui/parser/issue-90728.rs
+++ b/tests/ui/parser/issues/issue-90728.rs
diff --git a/tests/ui/parser/issue-90728.stderr b/tests/ui/parser/issues/issue-90728.stderr
index b55c46030..b55c46030 100644
--- a/tests/ui/parser/issue-90728.stderr
+++ b/tests/ui/parser/issues/issue-90728.stderr
diff --git a/tests/ui/parser/issue-91421.rs b/tests/ui/parser/issues/issue-91421.rs
index 8bba27f37..8bba27f37 100644
--- a/tests/ui/parser/issue-91421.rs
+++ b/tests/ui/parser/issues/issue-91421.rs
diff --git a/tests/ui/parser/issue-91421.stderr b/tests/ui/parser/issues/issue-91421.stderr
index 2d9652051..2d9652051 100644
--- a/tests/ui/parser/issue-91421.stderr
+++ b/tests/ui/parser/issues/issue-91421.stderr
diff --git a/tests/ui/parser/issue-99625-enum-struct-mutually-exclusive.fixed b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.fixed
index 4b4a416b1..4b4a416b1 100644
--- a/tests/ui/parser/issue-99625-enum-struct-mutually-exclusive.fixed
+++ b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.fixed
diff --git a/tests/ui/parser/issue-99625-enum-struct-mutually-exclusive.rs b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.rs
index 9cc886641..9cc886641 100644
--- a/tests/ui/parser/issue-99625-enum-struct-mutually-exclusive.rs
+++ b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.rs
diff --git a/tests/ui/parser/issue-99625-enum-struct-mutually-exclusive.stderr b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr
index edc640bf5..edc640bf5 100644
--- a/tests/ui/parser/issue-99625-enum-struct-mutually-exclusive.stderr
+++ b/tests/ui/parser/issues/issue-99625-enum-struct-mutually-exclusive.stderr
diff --git a/tests/ui/parser/issue-99910-const-let-mutually-exclusive.fixed b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.fixed
index 64ab6f62b..64ab6f62b 100644
--- a/tests/ui/parser/issue-99910-const-let-mutually-exclusive.fixed
+++ b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.fixed
diff --git a/tests/ui/parser/issue-99910-const-let-mutually-exclusive.rs b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.rs
index 50520971f..50520971f 100644
--- a/tests/ui/parser/issue-99910-const-let-mutually-exclusive.rs
+++ b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.rs
diff --git a/tests/ui/parser/issue-99910-const-let-mutually-exclusive.stderr b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr
index 72377fc37..72377fc37 100644
--- a/tests/ui/parser/issue-99910-const-let-mutually-exclusive.stderr
+++ b/tests/ui/parser/issues/issue-99910-const-let-mutually-exclusive.stderr
diff --git a/tests/ui/parser/macro/macro-repeat.stderr b/tests/ui/parser/macro/macro-repeat.stderr
index 63554b197..ade2bbf9b 100644
--- a/tests/ui/parser/macro/macro-repeat.stderr
+++ b/tests/ui/parser/macro/macro-repeat.stderr
@@ -9,6 +9,8 @@ error: variable 'v' is still repeating at this depth
|
LL | $v
| ^^
+ |
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 2 previous errors
diff --git a/tests/ui/parser/missing-fat-arrow.rs b/tests/ui/parser/missing-fat-arrow.rs
new file mode 100644
index 000000000..325f1ccf2
--- /dev/null
+++ b/tests/ui/parser/missing-fat-arrow.rs
@@ -0,0 +1,38 @@
+fn main() {
+ let x = 1;
+ let y = 2;
+ let value = 3;
+
+ match value {
+ Some(x) if x == y {
+ self.next_token()?; //~ ERROR expected identifier, found keyword `self`
+ },
+ _ => {}
+ }
+ let _: i32 = (); //~ ERROR mismatched types
+}
+
+struct Foo {
+ value: usize
+}
+
+fn foo(a: Option<&mut Foo>, b: usize) {
+ match a {
+ Some(a) if a.value == b {
+ a.value = 1; //~ ERROR expected one of `,`, `:`, or `}`, found `.`
+ },
+ _ => {}
+ }
+ let _: i32 = (); //~ ERROR mismatched types
+}
+
+fn bar(a: Option<&mut Foo>, b: usize) {
+ match a {
+ Some(a) if a.value == b {
+ a.value, //~ ERROR expected one of `,`, `:`, or `}`, found `.`
+ } => {
+ }
+ _ => {}
+ }
+ let _: i32 = (); //~ ERROR mismatched types
+}
diff --git a/tests/ui/parser/missing-fat-arrow.stderr b/tests/ui/parser/missing-fat-arrow.stderr
new file mode 100644
index 000000000..a6c786905
--- /dev/null
+++ b/tests/ui/parser/missing-fat-arrow.stderr
@@ -0,0 +1,78 @@
+error: expected identifier, found keyword `self`
+ --> $DIR/missing-fat-arrow.rs:8:13
+ |
+LL | Some(x) if x == y {
+ | - while parsing this struct
+LL | self.next_token()?;
+ | ^^^^ expected identifier, found keyword
+ |
+help: you might have meant to start a match arm after the match guard
+ |
+LL | Some(x) if x == y => {
+ | ++
+
+error: expected one of `,`, `:`, or `}`, found `.`
+ --> $DIR/missing-fat-arrow.rs:22:14
+ |
+LL | Some(a) if a.value == b {
+ | - while parsing this struct
+LL | a.value = 1;
+ | -^ expected one of `,`, `:`, or `}`
+ | |
+ | while parsing this struct field
+ |
+help: try naming a field
+ |
+LL | a: a.value = 1;
+ | ++
+help: you might have meant to start a match arm after the match guard
+ |
+LL | Some(a) if a.value == b => {
+ | ++
+
+error: expected one of `,`, `:`, or `}`, found `.`
+ --> $DIR/missing-fat-arrow.rs:32:14
+ |
+LL | Some(a) if a.value == b {
+ | - while parsing this struct
+LL | a.value,
+ | -^ expected one of `,`, `:`, or `}`
+ | |
+ | while parsing this struct field
+ |
+help: try naming a field
+ |
+LL | a: a.value,
+ | ++
+help: you might have meant to start a match arm after the match guard
+ |
+LL | Some(a) if a.value == b => {
+ | ++
+
+error[E0308]: mismatched types
+ --> $DIR/missing-fat-arrow.rs:12:18
+ |
+LL | let _: i32 = ();
+ | --- ^^ expected `i32`, found `()`
+ | |
+ | expected due to this
+
+error[E0308]: mismatched types
+ --> $DIR/missing-fat-arrow.rs:26:18
+ |
+LL | let _: i32 = ();
+ | --- ^^ expected `i32`, found `()`
+ | |
+ | expected due to this
+
+error[E0308]: mismatched types
+ --> $DIR/missing-fat-arrow.rs:37:18
+ |
+LL | let _: i32 = ();
+ | --- ^^ expected `i32`, found `()`
+ | |
+ | expected due to this
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/parser/mod_file_not_exist.stderr b/tests/ui/parser/mod_file_not_exist.stderr
index 62456d518..c2f9d30d9 100644
--- a/tests/ui/parser/mod_file_not_exist.stderr
+++ b/tests/ui/parser/mod_file_not_exist.stderr
@@ -5,6 +5,7 @@ LL | mod not_a_real_file;
| ^^^^^^^^^^^^^^^^^^^^
|
= help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs"
+ = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead
error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
--> $DIR/mod_file_not_exist.rs:7:16
diff --git a/tests/ui/parser/mod_file_not_exist_windows.stderr b/tests/ui/parser/mod_file_not_exist_windows.stderr
index d5143dbe9..53b09d8ca 100644
--- a/tests/ui/parser/mod_file_not_exist_windows.stderr
+++ b/tests/ui/parser/mod_file_not_exist_windows.stderr
@@ -5,6 +5,7 @@ LL | mod not_a_real_file;
| ^^^^^^^^^^^^^^^^^^^^
|
= help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs"
+ = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead
error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
--> $DIR/mod_file_not_exist_windows.rs:7:16
diff --git a/tests/ui/parser/recover-missing-semi-before-item.fixed b/tests/ui/parser/recover-missing-semi-before-item.fixed
index 0be17e69e..acb846373 100644
--- a/tests/ui/parser/recover-missing-semi-before-item.fixed
+++ b/tests/ui/parser/recover-missing-semi-before-item.fixed
@@ -1,6 +1,6 @@
// run-rustfix
-#![allow(unused_variables, dead_code)]
+#![allow(unused_variables, dead_code, unused_imports)]
fn for_struct() {
let foo = 3; //~ ERROR expected `;`, found keyword `struct`
diff --git a/tests/ui/parser/recover-missing-semi-before-item.rs b/tests/ui/parser/recover-missing-semi-before-item.rs
index 867b7b749..ef6cfe3c4 100644
--- a/tests/ui/parser/recover-missing-semi-before-item.rs
+++ b/tests/ui/parser/recover-missing-semi-before-item.rs
@@ -1,6 +1,6 @@
// run-rustfix
-#![allow(unused_variables, dead_code)]
+#![allow(unused_variables, dead_code, unused_imports)]
fn for_struct() {
let foo = 3 //~ ERROR expected `;`, found keyword `struct`
diff --git a/tests/ui/parser/recover-quantified-closure.stderr b/tests/ui/parser/recover-quantified-closure.stderr
index 39eec80f6..37e93cbee 100644
--- a/tests/ui/parser/recover-quantified-closure.stderr
+++ b/tests/ui/parser/recover-quantified-closure.stderr
@@ -25,10 +25,10 @@ LL | for <Foo>::Bar in x {}
= help: consider removing `for<...>`
error: implicit types in closure signatures are forbidden when `for<...>` is present
- --> $DIR/recover-quantified-closure.rs:2:25
+ --> $DIR/recover-quantified-closure.rs:2:24
|
LL | for<'a> |x: &'a u8| *x + 1;
- | ------- ^
+ | ------- ^
| |
| `for<...>` is here
diff --git a/tests/ui/parser/removed-syntax-fn-sigil.rs b/tests/ui/parser/removed-syntax-fn-sigil.rs
index 725843429..d55a032d1 100644
--- a/tests/ui/parser/removed-syntax-fn-sigil.rs
+++ b/tests/ui/parser/removed-syntax-fn-sigil.rs
@@ -1,3 +1,4 @@
fn main() {
- let x: fn~() = || (); //~ ERROR expected `(`, found `~`
+ let x: fn~() = || (); //~ ERROR missing parameters for function definition
+ //~| ERROR expected one of `->`, `;`, or `=`, found `~`
}
diff --git a/tests/ui/parser/removed-syntax-fn-sigil.stderr b/tests/ui/parser/removed-syntax-fn-sigil.stderr
index 196a5af47..0d3774167 100644
--- a/tests/ui/parser/removed-syntax-fn-sigil.stderr
+++ b/tests/ui/parser/removed-syntax-fn-sigil.stderr
@@ -1,10 +1,14 @@
-error: expected `(`, found `~`
+error: missing parameters for function definition
--> $DIR/removed-syntax-fn-sigil.rs:2:14
|
LL | let x: fn~() = || ();
- | - ^ expected `(`
- | |
- | while parsing the type for `x`
+ | ^ help: add a parameter list
-error: aborting due to previous error
+error: expected one of `->`, `;`, or `=`, found `~`
+ --> $DIR/removed-syntax-fn-sigil.rs:2:14
+ |
+LL | let x: fn~() = || ();
+ | ^ expected one of `->`, `;`, or `=`
+
+error: aborting due to 2 previous errors
diff --git a/tests/ui/parser/removed-syntax-with-2.stderr b/tests/ui/parser/removed-syntax-with-2.stderr
index c6ae1ce67..e75c5bcd6 100644
--- a/tests/ui/parser/removed-syntax-with-2.stderr
+++ b/tests/ui/parser/removed-syntax-with-2.stderr
@@ -2,8 +2,9 @@ error: expected one of `,`, `:`, or `}`, found `a`
--> $DIR/removed-syntax-with-2.rs:8:31
|
LL | let b = S { foo: (), with a };
- | - ^ expected one of `,`, `:`, or `}`
- | |
+ | - ---- ^ expected one of `,`, `:`, or `}`
+ | | |
+ | | while parsing this struct field
| while parsing this struct
error[E0063]: missing field `bar` in initializer of `S`
diff --git a/tests/ui/parser/semi-in-let-chain.rs b/tests/ui/parser/semi-in-let-chain.rs
new file mode 100644
index 000000000..9c21af037
--- /dev/null
+++ b/tests/ui/parser/semi-in-let-chain.rs
@@ -0,0 +1,27 @@
+// Issue #117720
+
+#![feature(let_chains)]
+
+fn main() {
+ if let () = ()
+ && let () = (); //~ERROR
+ && let () = ()
+ {
+ }
+}
+
+fn foo() {
+ if let () = ()
+ && () == (); //~ERROR
+ && 1 < 0
+ {
+ }
+}
+
+fn bar() {
+ if let () = ()
+ && () == (); //~ERROR
+ && let () = ()
+ {
+ }
+}
diff --git a/tests/ui/parser/semi-in-let-chain.stderr b/tests/ui/parser/semi-in-let-chain.stderr
new file mode 100644
index 000000000..c1a8f9296
--- /dev/null
+++ b/tests/ui/parser/semi-in-let-chain.stderr
@@ -0,0 +1,50 @@
+error: expected `{`, found `;`
+ --> $DIR/semi-in-let-chain.rs:7:23
+ |
+LL | && let () = ();
+ | ^ expected `{`
+ |
+note: you likely meant to continue parsing the let-chain starting here
+ --> $DIR/semi-in-let-chain.rs:8:9
+ |
+LL | && let () = ()
+ | ^^^^^^
+help: consider removing this semicolon to parse the `let` as part of the same chain
+ |
+LL - && let () = ();
+LL + && let () = ()
+ |
+
+error: expected `{`, found `;`
+ --> $DIR/semi-in-let-chain.rs:15:20
+ |
+LL | && () == ();
+ | ^ expected `{`
+ |
+note: the `if` expression is missing a block after this condition
+ --> $DIR/semi-in-let-chain.rs:14:8
+ |
+LL | if let () = ()
+ | ________^
+LL | | && () == ();
+ | |___________________^
+
+error: expected `{`, found `;`
+ --> $DIR/semi-in-let-chain.rs:23:20
+ |
+LL | && () == ();
+ | ^ expected `{`
+ |
+note: you likely meant to continue parsing the let-chain starting here
+ --> $DIR/semi-in-let-chain.rs:24:9
+ |
+LL | && let () = ()
+ | ^^^^^^
+help: consider removing this semicolon to parse the `let` as part of the same chain
+ |
+LL - && () == ();
+LL + && () == ()
+ |
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/parser/ternary_operator.rs b/tests/ui/parser/ternary_operator.rs
index 23d537e77..c8810781b 100644
--- a/tests/ui/parser/ternary_operator.rs
+++ b/tests/ui/parser/ternary_operator.rs
@@ -1,69 +1,30 @@
-// A good chunk of these errors aren't shown to the user, but are still
-// required in the test for it to pass.
-
-fn a() { //~ NOTE this function should return `Result` or `Option` to accept `?`
+fn a() {
let x = 5 > 2 ? true : false;
//~^ ERROR Rust has no ternary operator
//~| HELP use an `if-else` expression instead
- //~| ERROR the `?` operator can only be applied to values that implement `Try` [E0277]
- //~| HELP the trait `Try` is not implemented for `{integer}`
- //~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) [E0277]
- //~| HELP the trait `FromResidual<_>` is not implemented for `()`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE the `?` operator cannot be applied to type `{integer}`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE cannot use the `?` operator in a function that returns `()`
- //~| NOTE in this expansion of desugaring of operator `?`
}
-fn b() { //~ NOTE this function should return `Result` or `Option` to accept `?`
+fn b() {
let x = 5 > 2 ? { true } : { false };
//~^ ERROR Rust has no ternary operator
//~| HELP use an `if-else` expression instead
- //~| ERROR the `?` operator can only be applied to values that implement `Try` [E0277]
- //~| HELP the trait `Try` is not implemented for `{integer}`
- //~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) [E0277]
- //~| HELP the trait `FromResidual<_>` is not implemented for `()`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE the `?` operator cannot be applied to type `{integer}`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE cannot use the `?` operator in a function that returns `()`
- //~| NOTE in this expansion of desugaring of operator `?`
}
-fn c() { //~ NOTE this function should return `Result` or `Option` to accept `?`
+fn c() {
let x = 5 > 2 ? f32::MAX : f32::MIN;
//~^ ERROR Rust has no ternary operator
//~| HELP use an `if-else` expression instead
- //~| ERROR the `?` operator can only be applied to values that implement `Try` [E0277]
- //~| HELP the trait `Try` is not implemented for `{integer}`
- //~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) [E0277]
- //~| HELP the trait `FromResidual<_>` is not implemented for `()`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE the `?` operator cannot be applied to type `{integer}`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE cannot use the `?` operator in a function that returns `()`
- //~| NOTE in this expansion of desugaring of operator `?`
}
-fn main() { //~ NOTE this function should return `Result` or `Option` to accept `?`
+fn bad() {
+ // regression test for #117208
+ v ? return;
+ //~^ ERROR expected one of
+}
+
+fn main() {
let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
//~^ ERROR Rust has no ternary operator
//~| HELP use an `if-else` expression instead
//~| ERROR expected one of `.`, `;`, `?`, `else`, or an operator, found `:`
- //~| NOTE expected one of `.`, `;`, `?`, `else`, or an operator
- //~| ERROR the `?` operator can only be applied to values that implement `Try` [E0277]
- //~| HELP the trait `Try` is not implemented for `{integer}`
- //~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) [E0277]
- //~| HELP the trait `FromResidual<_>` is not implemented for `()`
- //~| NOTE type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE the `?` operator cannot be applied to type `{integer}`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE in this expansion of desugaring of operator `?`
- //~| NOTE cannot use the `?` operator in a function that returns `()`
- //~| NOTE in this expansion of desugaring of operator `?`
}
diff --git a/tests/ui/parser/ternary_operator.stderr b/tests/ui/parser/ternary_operator.stderr
index af9565bbe..6635e1672 100644
--- a/tests/ui/parser/ternary_operator.stderr
+++ b/tests/ui/parser/ternary_operator.stderr
@@ -1,5 +1,5 @@
error: Rust has no ternary operator
- --> $DIR/ternary_operator.rs:5:19
+ --> $DIR/ternary_operator.rs:2:19
|
LL | let x = 5 > 2 ? true : false;
| ^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | let x = 5 > 2 ? true : false;
= help: use an `if-else` expression instead
error: Rust has no ternary operator
- --> $DIR/ternary_operator.rs:21:19
+ --> $DIR/ternary_operator.rs:8:19
|
LL | let x = 5 > 2 ? { true } : { false };
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -15,15 +15,21 @@ LL | let x = 5 > 2 ? { true } : { false };
= help: use an `if-else` expression instead
error: Rust has no ternary operator
- --> $DIR/ternary_operator.rs:37:19
+ --> $DIR/ternary_operator.rs:14:19
|
LL | let x = 5 > 2 ? f32::MAX : f32::MIN;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: use an `if-else` expression instead
+error: expected one of `.`, `;`, `?`, `}`, or an operator, found keyword `return`
+ --> $DIR/ternary_operator.rs:21:9
+ |
+LL | v ? return;
+ | ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
+
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `:`
- --> $DIR/ternary_operator.rs:53:37
+ --> $DIR/ternary_operator.rs:26:37
|
LL | let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
@@ -31,85 +37,12 @@ LL | let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
error: Rust has no ternary operator
- --> $DIR/ternary_operator.rs:53:19
+ --> $DIR/ternary_operator.rs:26:19
|
LL | let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use an `if-else` expression instead
-error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/ternary_operator.rs:5:17
- |
-LL | let x = 5 > 2 ? true : false;
- | ^^^ the `?` operator cannot be applied to type `{integer}`
- |
- = help: the trait `Try` is not implemented for `{integer}`
-
-error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
- --> $DIR/ternary_operator.rs:5:19
- |
-LL | fn a() {
- | ------ this function should return `Result` or `Option` to accept `?`
-LL | let x = 5 > 2 ? true : false;
- | ^ cannot use the `?` operator in a function that returns `()`
- |
- = help: the trait `FromResidual<_>` is not implemented for `()`
-
-error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/ternary_operator.rs:21:17
- |
-LL | let x = 5 > 2 ? { true } : { false };
- | ^^^ the `?` operator cannot be applied to type `{integer}`
- |
- = help: the trait `Try` is not implemented for `{integer}`
-
-error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
- --> $DIR/ternary_operator.rs:21:19
- |
-LL | fn b() {
- | ------ this function should return `Result` or `Option` to accept `?`
-LL | let x = 5 > 2 ? { true } : { false };
- | ^ cannot use the `?` operator in a function that returns `()`
- |
- = help: the trait `FromResidual<_>` is not implemented for `()`
-
-error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/ternary_operator.rs:37:17
- |
-LL | let x = 5 > 2 ? f32::MAX : f32::MIN;
- | ^^^ the `?` operator cannot be applied to type `{integer}`
- |
- = help: the trait `Try` is not implemented for `{integer}`
-
-error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
- --> $DIR/ternary_operator.rs:37:19
- |
-LL | fn c() {
- | ------ this function should return `Result` or `Option` to accept `?`
-LL | let x = 5 > 2 ? f32::MAX : f32::MIN;
- | ^ cannot use the `?` operator in a function that returns `()`
- |
- = help: the trait `FromResidual<_>` is not implemented for `()`
-
-error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/ternary_operator.rs:53:17
- |
-LL | let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
- | ^^^ the `?` operator cannot be applied to type `{integer}`
- |
- = help: the trait `Try` is not implemented for `{integer}`
-
-error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
- --> $DIR/ternary_operator.rs:53:19
- |
-LL | fn main() {
- | --------- this function should return `Result` or `Option` to accept `?`
-LL | let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
- | ^ cannot use the `?` operator in a function that returns `()`
- |
- = help: the trait `FromResidual<_>` is not implemented for `()`
-
-error: aborting due to 13 previous errors
+error: aborting due to 6 previous errors
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/parser/unsafe-mod.stderr b/tests/ui/parser/unsafe-mod.stderr
index dac6e7a35..fbe24aa10 100644
--- a/tests/ui/parser/unsafe-mod.stderr
+++ b/tests/ui/parser/unsafe-mod.stderr
@@ -5,6 +5,7 @@ LL | unsafe mod n;
| ^^^^^^^^^^^^^
|
= help: to create the module `n`, create file "$DIR/n.rs" or "$DIR/n/mod.rs"
+ = note: if there is a `mod n` elsewhere in the crate already, import it with `use crate::...` instead
error: module cannot be declared unsafe
--> $DIR/unsafe-mod.rs:1:1
diff --git a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs
index 9eeee195e..f1238ec24 100644
--- a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs
+++ b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs
@@ -5,5 +5,9 @@ fn f2<'a>(x: u8, y: Vec<&'a ...>) {}
//~^ ERROR C-variadic type `...` may not be nested inside another type
fn main() {
- let _recovery_witness: () = 0; //~ ERROR mismatched types
+ // While this is an error, wf-checks happen before typeck, and if any wf-checks
+ // encountered errors, we do not continue to typeck, even if the items are
+ // unrelated.
+ // FIXME(oli-obk): make this report a type mismatch again.
+ let _recovery_witness: () = 0;
}
diff --git a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr
index 8b9d676a4..7ca6a6d1b 100644
--- a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr
+++ b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.stderr
@@ -10,15 +10,6 @@ error[E0743]: C-variadic type `...` may not be nested inside another type
LL | fn f2<'a>(x: u8, y: Vec<&'a ...>) {}
| ^^^
-error[E0308]: mismatched types
- --> $DIR/variadic-ffi-nested-syntactic-fail.rs:8:33
- |
-LL | let _recovery_witness: () = 0;
- | -- ^ expected `()`, found integer
- | |
- | expected due to this
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0308, E0743.
-For more information about an error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0743`.
diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
index 0b61e267d..b173e23e7 100644
--- a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
+++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
@@ -32,6 +32,18 @@ extern "C" fn f3_3(..., x: isize) {}
//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic
//~| ERROR `...` must be the last argument of a C-variadic function
+const unsafe extern "C" fn f4_1(x: isize, ...) {}
+//~^ ERROR functions cannot be both `const` and C-variadic
+
+const extern "C" fn f4_2(x: isize, ...) {}
+//~^ ERROR functions cannot be both `const` and C-variadic
+//~| ERROR only foreign or `unsafe extern "C"` functions may be C-variadic
+
+const extern "C" fn f4_3(..., x: isize, ...) {}
+//~^ ERROR functions cannot be both `const` and C-variadic
+//~| ERROR only foreign or `unsafe extern "C"` functions may be C-variadic
+//~| ERROR `...` must be the last argument of a C-variadic function
+
extern "C" {
fn e_f1(...);
//~^ ERROR C-variadic function must be declared with at least one named argument
@@ -49,12 +61,13 @@ impl X {
//~| ERROR C-variadic function must be declared with at least one named argument
fn i_f3(..., x: isize, ...) {}
//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic
- //~| ERROR only foreign or `unsafe extern "C"` functions may be C-variadic
//~| ERROR `...` must be the last argument of a C-variadic function
fn i_f4(..., x: isize, ...) {}
//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic
- //~| ERROR only foreign or `unsafe extern "C"` functions may be C-variadic
//~| ERROR `...` must be the last argument of a C-variadic function
+ const fn i_f5(x: isize, ...) {}
+ //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic
+ //~| ERROR functions cannot be both `const` and C-variadic
}
trait T {
diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr
index f1cbbb279..18526080e 100644
--- a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr
+++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr
@@ -76,131 +76,172 @@ error: only foreign or `unsafe extern "C"` functions may be C-variadic
LL | extern "C" fn f3_3(..., x: isize) {}
| ^^^
+error: functions cannot be both `const` and C-variadic
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:35:1
+ |
+LL | const unsafe extern "C" fn f4_1(x: isize, ...) {}
+ | ^^^^^ `const` because of this ^^^ C-variadic because of this
+
+error: functions cannot be both `const` and C-variadic
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:38:1
+ |
+LL | const extern "C" fn f4_2(x: isize, ...) {}
+ | ^^^^^ `const` because of this ^^^ C-variadic because of this
+
+error: only foreign or `unsafe extern "C"` functions may be C-variadic
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:38:36
+ |
+LL | const extern "C" fn f4_2(x: isize, ...) {}
+ | ^^^
+
+error: `...` must be the last argument of a C-variadic function
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42:26
+ |
+LL | const extern "C" fn f4_3(..., x: isize, ...) {}
+ | ^^^
+
+error: functions cannot be both `const` and C-variadic
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42:1
+ |
+LL | const extern "C" fn f4_3(..., x: isize, ...) {}
+ | ^^^^^ ^^^ ^^^ C-variadic because of this
+ | | |
+ | | C-variadic because of this
+ | `const` because of this
+
+error: only foreign or `unsafe extern "C"` functions may be C-variadic
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42:26
+ |
+LL | const extern "C" fn f4_3(..., x: isize, ...) {}
+ | ^^^ ^^^
+
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:36:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:48:13
|
LL | fn e_f1(...);
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:38:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:50:13
|
LL | fn e_f2(..., x: isize);
| ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:45:23
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:57:23
|
LL | fn i_f1(x: isize, ...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:47:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:59:13
|
LL | fn i_f2(...) {}
| ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:47:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:59:13
|
LL | fn i_f2(...) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:50:13
- |
-LL | fn i_f3(..., x: isize, ...) {}
- | ^^^
-
-error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:50:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62:13
|
LL | fn i_f3(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:50:28
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62:13
|
LL | fn i_f3(..., x: isize, ...) {}
- | ^^^
+ | ^^^ ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:54:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65:13
|
LL | fn i_f4(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:54:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65:13
|
LL | fn i_f4(..., x: isize, ...) {}
- | ^^^
+ | ^^^ ^^^
+
+error: functions cannot be both `const` and C-variadic
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:68:5
+ |
+LL | const fn i_f5(x: isize, ...) {}
+ | ^^^^^ ^^^ C-variadic because of this
+ | |
+ | `const` because of this
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:54:28
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:68:29
|
-LL | fn i_f4(..., x: isize, ...) {}
- | ^^^
+LL | const fn i_f5(x: isize, ...) {}
+ | ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:61:23
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:74:23
|
LL | fn t_f1(x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:63:23
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:76:23
|
LL | fn t_f2(x: isize, ...);
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:65:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:78:13
|
LL | fn t_f3(...) {}
| ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:65:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:78:13
|
LL | fn t_f3(...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
- --> $DIR/variadic-ffi-semantic-restrictions.rs:68:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:81:13
|
LL | fn t_f4(...);
| ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:68:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:81:13
|
LL | fn t_f4(...);
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:71:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:84:13
|
LL | fn t_f5(..., x: isize) {}
| ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:71:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:84:13
|
LL | fn t_f5(..., x: isize) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
- --> $DIR/variadic-ffi-semantic-restrictions.rs:74:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:87:13
|
LL | fn t_f6(..., x: isize);
| ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
- --> $DIR/variadic-ffi-semantic-restrictions.rs:74:13
+ --> $DIR/variadic-ffi-semantic-restrictions.rs:87:13
|
LL | fn t_f6(..., x: isize);
| ^^^
-error: aborting due to 34 previous errors
+error: aborting due to 40 previous errors