about summary refs log tree commit diff
path: root/tests/ui/span
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-08-15 16:16:41 +1000
committerGitHub <noreply@github.com>2025-08-15 16:16:41 +1000
commitdc047f1385f03c12dcdcd24d76351fc55ab83592 (patch)
treeacbf824bcda0fd11890c487e370f155149201cbc /tests/ui/span
parent36515e780a22441f67c77ffecc3d3c64e2d50610 (diff)
parent3ce555f6313e78d3eed80fd22e22ef49f5bd3611 (diff)
downloadrust-dc047f1385f03c12dcdcd24d76351fc55ab83592.tar.gz
rust-dc047f1385f03c12dcdcd24d76351fc55ab83592.zip
Rollup merge of #145378 - xizheyin:144968, r=davidtwco
Add `FnContext` in parser for diagnostic

Fixes rust-lang/rust#144968

Inspired by https://github.com/rust-lang/rust/issues/144968#issuecomment-3156094581, I implemented `FnContext` to indicate whether a function should have a self parameter, for example, whether the function is a trait method, whether it is in an impl block. And I removed the outdated note.

I made two commits to show the difference.

cc ``@estebank`` ``@djc``

r? compiler
Diffstat (limited to 'tests/ui/span')
-rw-r--r--tests/ui/span/issue-34264.stderr11
1 files changed, 0 insertions, 11 deletions
diff --git a/tests/ui/span/issue-34264.stderr b/tests/ui/span/issue-34264.stderr
index c8046a1bddf..cc41d3048df 100644
--- a/tests/ui/span/issue-34264.stderr
+++ b/tests/ui/span/issue-34264.stderr
@@ -4,11 +4,6 @@ error: expected one of `:`, `@`, or `|`, found `<`
 LL | fn foo(Option<i32>, String) {}
    |              ^ expected one of `:`, `@`, or `|`
    |
-   = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: if this is a `self` type, give it a parameter name
-   |
-LL | fn foo(self: Option<i32>, String) {}
-   |        +++++
 help: if this is a type, explicitly ignore the parameter name
    |
 LL | fn foo(_: Option<i32>, String) {}
@@ -20,7 +15,6 @@ error: expected one of `:`, `@`, or `|`, found `)`
 LL | fn foo(Option<i32>, String) {}
    |                           ^ expected one of `:`, `@`, or `|`
    |
-   = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
 help: if this is a parameter name, give it a type
    |
 LL | fn foo(Option<i32>, String: TypeName) {}
@@ -36,11 +30,6 @@ error: expected one of `:`, `@`, or `|`, found `,`
 LL | fn bar(x, y: usize) {}
    |         ^ expected one of `:`, `@`, or `|`
    |
-   = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
-help: if this is a `self` type, give it a parameter name
-   |
-LL | fn bar(self: x, y: usize) {}
-   |        +++++
 help: if this is a parameter name, give it a type
    |
 LL | fn bar(x: TypeName, y: usize) {}