summaryrefslogtreecommitdiffstats
path: root/src/test/ui/resolve
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:12:43 +0000
commitcf94bdc0742c13e2a0cac864c478b8626b266e1b (patch)
tree044670aa50cc5e2b4229aa0b6b3df6676730c0a6 /src/test/ui/resolve
parentAdding debian version 1.65.0+dfsg1-2. (diff)
downloadrustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.tar.xz
rustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/resolve')
-rw-r--r--src/test/ui/resolve/bad-env-capture.stderr12
-rw-r--r--src/test/ui/resolve/bad-env-capture2.stderr12
-rw-r--r--src/test/ui/resolve/bad-env-capture3.stderr12
-rw-r--r--src/test/ui/resolve/bad-expr-path.stderr12
-rw-r--r--src/test/ui/resolve/bad-expr-path2.stderr12
-rw-r--r--src/test/ui/resolve/issue-102946.rs7
-rw-r--r--src/test/ui/resolve/issue-102946.stderr26
-rw-r--r--src/test/ui/resolve/issue-103202.rs7
-rw-r--r--src/test/ui/resolve/issue-103202.stderr9
-rw-r--r--src/test/ui/resolve/issue-14254.stderr127
-rw-r--r--src/test/ui/resolve/issue-23305.rs2
-rw-r--r--src/test/ui/resolve/issue-23305.stderr16
-rw-r--r--src/test/ui/resolve/issue-2356.stderr90
-rw-r--r--src/test/ui/resolve/issue-42944.stderr24
-rw-r--r--src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr4
-rw-r--r--src/test/ui/resolve/issue-73427.stderr40
-rw-r--r--src/test/ui/resolve/levenshtein.stderr18
-rw-r--r--src/test/ui/resolve/name-collision-in-trait-fn-sig.rs11
-rw-r--r--src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr13
-rw-r--r--src/test/ui/resolve/privacy-enum-ctor.stderr6
-rw-r--r--src/test/ui/resolve/resolve-assoc-suggestions.stderr2
-rw-r--r--src/test/ui/resolve/resolve-hint-macro.stderr22
-rw-r--r--src/test/ui/resolve/resolve-self-in-impl.rs9
-rw-r--r--src/test/ui/resolve/resolve-self-in-impl.stderr74
-rw-r--r--src/test/ui/resolve/resolve-speculative-adjustment.stderr12
-rw-r--r--src/test/ui/resolve/tuple-struct-alias.stderr16
-rw-r--r--src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr38
27 files changed, 343 insertions, 290 deletions
diff --git a/src/test/ui/resolve/bad-env-capture.stderr b/src/test/ui/resolve/bad-env-capture.stderr
index f78a38a3d..59b1fabfd 100644
--- a/src/test/ui/resolve/bad-env-capture.stderr
+++ b/src/test/ui/resolve/bad-env-capture.stderr
@@ -6,18 +6,18 @@ LL | fn bar() { log(debug, x); }
|
= help: use the `|| { ... }` closure form instead
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-env-capture.rs:4:16
- |
-LL | fn bar() { log(debug, x); }
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-env-capture.rs:4:20
|
LL | fn bar() { log(debug, x); }
| ^^^^^ not found in this scope
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-env-capture.rs:4:16
+ |
+LL | fn bar() { log(debug, x); }
+ | ^^^ not found in this scope
+
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0425, E0434.
diff --git a/src/test/ui/resolve/bad-env-capture2.stderr b/src/test/ui/resolve/bad-env-capture2.stderr
index 57c807fd7..811c259de 100644
--- a/src/test/ui/resolve/bad-env-capture2.stderr
+++ b/src/test/ui/resolve/bad-env-capture2.stderr
@@ -6,18 +6,18 @@ LL | fn bar() { log(debug, x); }
|
= help: use the `|| { ... }` closure form instead
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-env-capture2.rs:3:16
- |
-LL | fn bar() { log(debug, x); }
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-env-capture2.rs:3:20
|
LL | fn bar() { log(debug, x); }
| ^^^^^ not found in this scope
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-env-capture2.rs:3:16
+ |
+LL | fn bar() { log(debug, x); }
+ | ^^^ not found in this scope
+
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0425, E0434.
diff --git a/src/test/ui/resolve/bad-env-capture3.stderr b/src/test/ui/resolve/bad-env-capture3.stderr
index d6eb4f86e..eab37fde9 100644
--- a/src/test/ui/resolve/bad-env-capture3.stderr
+++ b/src/test/ui/resolve/bad-env-capture3.stderr
@@ -6,18 +6,18 @@ LL | fn bar() { log(debug, x); }
|
= help: use the `|| { ... }` closure form instead
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-env-capture3.rs:4:20
- |
-LL | fn bar() { log(debug, x); }
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-env-capture3.rs:4:24
|
LL | fn bar() { log(debug, x); }
| ^^^^^ not found in this scope
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-env-capture3.rs:4:20
+ |
+LL | fn bar() { log(debug, x); }
+ | ^^^ not found in this scope
+
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0425, E0434.
diff --git a/src/test/ui/resolve/bad-expr-path.stderr b/src/test/ui/resolve/bad-expr-path.stderr
index 77c48c951..8261e8e53 100644
--- a/src/test/ui/resolve/bad-expr-path.stderr
+++ b/src/test/ui/resolve/bad-expr-path.stderr
@@ -1,9 +1,3 @@
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-expr-path.rs:4:5
- |
-LL | log(debug, m1::arguments);
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-expr-path.rs:4:9
|
@@ -16,6 +10,12 @@ error[E0425]: cannot find value `arguments` in module `m1`
LL | log(debug, m1::arguments);
| ^^^^^^^^^ not found in `m1`
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-expr-path.rs:4:5
+ |
+LL | log(debug, m1::arguments);
+ | ^^^ not found in this scope
+
error[E0580]: `main` function has wrong type
--> $DIR/bad-expr-path.rs:3:1
|
diff --git a/src/test/ui/resolve/bad-expr-path2.stderr b/src/test/ui/resolve/bad-expr-path2.stderr
index d06e10271..6e11296d9 100644
--- a/src/test/ui/resolve/bad-expr-path2.stderr
+++ b/src/test/ui/resolve/bad-expr-path2.stderr
@@ -1,9 +1,3 @@
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-expr-path2.rs:6:5
- |
-LL | log(debug, m1::arguments);
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-expr-path2.rs:6:9
|
@@ -16,6 +10,12 @@ error[E0423]: expected value, found module `m1::arguments`
LL | log(debug, m1::arguments);
| ^^^^^^^^^^^^^ not a value
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-expr-path2.rs:6:5
+ |
+LL | log(debug, m1::arguments);
+ | ^^^ not found in this scope
+
error[E0580]: `main` function has wrong type
--> $DIR/bad-expr-path2.rs:5:1
|
diff --git a/src/test/ui/resolve/issue-102946.rs b/src/test/ui/resolve/issue-102946.rs
new file mode 100644
index 000000000..c6feca6f3
--- /dev/null
+++ b/src/test/ui/resolve/issue-102946.rs
@@ -0,0 +1,7 @@
+impl Error for str::Utf8Error {
+ //~^ ERROR cannot find trait `Error` in this scope
+ //~| ERROR ambiguous associated type
+ fn description(&self) {}
+}
+
+fn main() {}
diff --git a/src/test/ui/resolve/issue-102946.stderr b/src/test/ui/resolve/issue-102946.stderr
new file mode 100644
index 000000000..65be0258e
--- /dev/null
+++ b/src/test/ui/resolve/issue-102946.stderr
@@ -0,0 +1,26 @@
+error[E0405]: cannot find trait `Error` in this scope
+ --> $DIR/issue-102946.rs:1:6
+ |
+LL | impl Error for str::Utf8Error {
+ | ^^^^^ not found in this scope
+ |
+help: consider importing this trait
+ |
+LL | use std::error::Error;
+ |
+
+error[E0223]: ambiguous associated type
+ --> $DIR/issue-102946.rs:1:16
+ |
+LL | impl Error for str::Utf8Error {
+ | ^^^^^^^^^^^^^^
+ |
+help: you are looking for the module in `std`, not the primitive type
+ |
+LL | impl Error for std::str::Utf8Error {
+ | +++++
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0223, E0405.
+For more information about an error, try `rustc --explain E0223`.
diff --git a/src/test/ui/resolve/issue-103202.rs b/src/test/ui/resolve/issue-103202.rs
new file mode 100644
index 000000000..469d9d7c8
--- /dev/null
+++ b/src/test/ui/resolve/issue-103202.rs
@@ -0,0 +1,7 @@
+struct S {}
+
+impl S {
+ fn f(self: &S::x) {} //~ ERROR ambiguous associated type
+}
+
+fn main() {}
diff --git a/src/test/ui/resolve/issue-103202.stderr b/src/test/ui/resolve/issue-103202.stderr
new file mode 100644
index 000000000..880389371
--- /dev/null
+++ b/src/test/ui/resolve/issue-103202.stderr
@@ -0,0 +1,9 @@
+error[E0223]: ambiguous associated type
+ --> $DIR/issue-103202.rs:4:17
+ |
+LL | fn f(self: &S::x) {}
+ | ^^^^ help: use fully-qualified syntax: `<S as Trait>::x`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0223`.
diff --git a/src/test/ui/resolve/issue-14254.stderr b/src/test/ui/resolve/issue-14254.stderr
index b1f45adb8..690a40f7e 100644
--- a/src/test/ui/resolve/issue-14254.stderr
+++ b/src/test/ui/resolve/issue-14254.stderr
@@ -1,21 +1,9 @@
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:19:9
- |
-LL | baz();
- | ^^^ help: you might have meant to call the method: `self.baz`
-
error[E0425]: cannot find value `a` in this scope
--> $DIR/issue-14254.rs:21:9
|
LL | a;
| ^ not found in this scope
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:28:9
- |
-LL | baz();
- | ^^^ help: you might have meant to call the method: `self.baz`
-
error[E0425]: cannot find value `x` in this scope
--> $DIR/issue-14254.rs:30:9
|
@@ -38,7 +26,12 @@ error[E0425]: cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:36:9
|
LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
error[E0425]: cannot find value `b` in this scope
--> $DIR/issue-14254.rs:38:9
@@ -46,12 +39,6 @@ error[E0425]: cannot find value `b` in this scope
LL | b;
| ^ not found in this scope
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:45:9
- |
-LL | baz();
- | ^^^ help: you might have meant to call the method: `self.baz`
-
error[E0425]: cannot find value `x` in this scope
--> $DIR/issue-14254.rs:47:9
|
@@ -74,7 +61,12 @@ error[E0425]: cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:53:9
|
LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
error[E0425]: cannot find value `b` in this scope
--> $DIR/issue-14254.rs:55:9
@@ -82,65 +74,108 @@ error[E0425]: cannot find value `b` in this scope
LL | b;
| ^ not found in this scope
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:62:9
+error[E0425]: cannot find value `bah` in this scope
+ --> $DIR/issue-14254.rs:64:9
|
-LL | baz();
- | ^^^ help: you might have meant to call the method: `self.baz`
+LL | bah;
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:64:9
+ --> $DIR/issue-14254.rs:73:9
+ |
+LL | bah;
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
+
+error[E0425]: cannot find value `bah` in this scope
+ --> $DIR/issue-14254.rs:82:9
+ |
+LL | bah;
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
+
+error[E0425]: cannot find value `bah` in this scope
+ --> $DIR/issue-14254.rs:91:9
+ |
+LL | bah;
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
+
+error[E0425]: cannot find value `bah` in this scope
+ --> $DIR/issue-14254.rs:100:9
|
LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:71:9
+ --> $DIR/issue-14254.rs:19:9
|
LL | baz();
| ^^^ help: you might have meant to call the method: `self.baz`
-error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:73:9
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/issue-14254.rs:28:9
|
-LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+LL | baz();
+ | ^^^ help: you might have meant to call the method: `self.baz`
error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:80:9
+ --> $DIR/issue-14254.rs:45:9
|
LL | baz();
| ^^^ help: you might have meant to call the method: `self.baz`
-error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:82:9
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/issue-14254.rs:62:9
|
-LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+LL | baz();
+ | ^^^ help: you might have meant to call the method: `self.baz`
error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:89:9
+ --> $DIR/issue-14254.rs:71:9
|
LL | baz();
| ^^^ help: you might have meant to call the method: `self.baz`
-error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:91:9
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/issue-14254.rs:80:9
|
-LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+LL | baz();
+ | ^^^ help: you might have meant to call the method: `self.baz`
error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:98:9
+ --> $DIR/issue-14254.rs:89:9
|
LL | baz();
| ^^^ help: you might have meant to call the method: `self.baz`
-error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:100:9
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/issue-14254.rs:98:9
|
-LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+LL | baz();
+ | ^^^ help: you might have meant to call the method: `self.baz`
error: aborting due to 24 previous errors
diff --git a/src/test/ui/resolve/issue-23305.rs b/src/test/ui/resolve/issue-23305.rs
index 95635e12a..6d7fe7c50 100644
--- a/src/test/ui/resolve/issue-23305.rs
+++ b/src/test/ui/resolve/issue-23305.rs
@@ -3,6 +3,6 @@ pub trait ToNbt<T> {
}
impl dyn ToNbt<Self> {}
-//~^ ERROR cycle detected
+//~^ ERROR `Self` is not valid in the self type of an impl block
fn main() {}
diff --git a/src/test/ui/resolve/issue-23305.stderr b/src/test/ui/resolve/issue-23305.stderr
index 20aeb7b99..aad1b583a 100644
--- a/src/test/ui/resolve/issue-23305.stderr
+++ b/src/test/ui/resolve/issue-23305.stderr
@@ -1,22 +1,10 @@
-error[E0391]: cycle detected when computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:21>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/issue-23305.rs:5:16
|
LL | impl dyn ToNbt<Self> {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:21>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/issue-23305.rs:1:1
- |
-LL | / pub trait ToNbt<T> {
-LL | | fn new(val: T) -> Self;
-LL | | }
-LL | |
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+ = note: replace `Self` with a different type
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/resolve/issue-2356.stderr b/src/test/ui/resolve/issue-2356.stderr
index b8d528efc..e7c53ff44 100644
--- a/src/test/ui/resolve/issue-2356.stderr
+++ b/src/test/ui/resolve/issue-2356.stderr
@@ -1,15 +1,3 @@
-error[E0425]: cannot find function `shave` in this scope
- --> $DIR/issue-2356.rs:17:5
- |
-LL | shave();
- | ^^^^^ not found in this scope
-
-error[E0425]: cannot find function `clone` in this scope
- --> $DIR/issue-2356.rs:24:5
- |
-LL | clone();
- | ^^^^^ help: you might have meant to call the method: `self.clone`
-
error[E0425]: cannot find function `default` in this scope
--> $DIR/issue-2356.rs:31:5
|
@@ -31,6 +19,51 @@ error[E0425]: cannot find value `whiskers` in this scope
LL | whiskers -= other;
| ^^^^^^^^ a field by this name exists in `Self`
+error[E0424]: expected value, found module `self`
+ --> $DIR/issue-2356.rs:65:8
+ |
+LL | fn meow() {
+ | ---- this function doesn't have a `self` parameter
+LL | if self.whiskers > 3 {
+ | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
+ |
+help: add a `self` receiver parameter to make the associated `fn` a method
+ |
+LL | fn meow(&self) {
+ | +++++
+
+error[E0425]: cannot find value `whiskers` in this scope
+ --> $DIR/issue-2356.rs:79:5
+ |
+LL | whiskers = 0;
+ | ^^^^^^^^ help: you might have meant to use the available field: `self.whiskers`
+
+error[E0425]: cannot find value `whiskers` in this scope
+ --> $DIR/issue-2356.rs:84:5
+ |
+LL | whiskers = 4;
+ | ^^^^^^^^ a field by this name exists in `Self`
+
+error[E0424]: expected value, found module `self`
+ --> $DIR/issue-2356.rs:92:5
+ |
+LL | fn main() {
+ | ---- this function can't have a `self` parameter
+LL | self += 1;
+ | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
+
+error[E0425]: cannot find function `shave` in this scope
+ --> $DIR/issue-2356.rs:17:5
+ |
+LL | shave();
+ | ^^^^^ not found in this scope
+
+error[E0425]: cannot find function `clone` in this scope
+ --> $DIR/issue-2356.rs:24:5
+ |
+LL | clone();
+ | ^^^^^ help: you might have meant to call the method: `self.clone`
+
error[E0425]: cannot find function `shave` in this scope
--> $DIR/issue-2356.rs:41:5
|
@@ -72,19 +105,6 @@ error[E0425]: cannot find function `purr` in this scope
LL | purr();
| ^^^^ not found in this scope
-error[E0424]: expected value, found module `self`
- --> $DIR/issue-2356.rs:65:8
- |
-LL | fn meow() {
- | ---- this function doesn't have a `self` parameter
-LL | if self.whiskers > 3 {
- | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
- |
-help: add a `self` receiver parameter to make the associated `fn` a method
- |
-LL | fn meow(&self) {
- | +++++
-
error[E0425]: cannot find function `grow_older` in this scope
--> $DIR/issue-2356.rs:72:5
|
@@ -102,32 +122,12 @@ error[E0425]: cannot find function `shave` in this scope
LL | shave();
| ^^^^^ not found in this scope
-error[E0425]: cannot find value `whiskers` in this scope
- --> $DIR/issue-2356.rs:79:5
- |
-LL | whiskers = 0;
- | ^^^^^^^^ help: you might have meant to use the available field: `self.whiskers`
-
-error[E0425]: cannot find value `whiskers` in this scope
- --> $DIR/issue-2356.rs:84:5
- |
-LL | whiskers = 4;
- | ^^^^^^^^ a field by this name exists in `Self`
-
error[E0425]: cannot find function `purr_louder` in this scope
--> $DIR/issue-2356.rs:86:5
|
LL | purr_louder();
| ^^^^^^^^^^^ not found in this scope
-error[E0424]: expected value, found module `self`
- --> $DIR/issue-2356.rs:92:5
- |
-LL | fn main() {
- | ---- this function can't have a `self` parameter
-LL | self += 1;
- | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
-
error: aborting due to 17 previous errors
Some errors have detailed explanations: E0424, E0425.
diff --git a/src/test/ui/resolve/issue-42944.stderr b/src/test/ui/resolve/issue-42944.stderr
index cad3ccc4a..0ee9fd391 100644
--- a/src/test/ui/resolve/issue-42944.stderr
+++ b/src/test/ui/resolve/issue-42944.stderr
@@ -1,15 +1,3 @@
-error[E0423]: cannot initialize a tuple struct which contains private fields
- --> $DIR/issue-42944.rs:9:9
- |
-LL | Bx(());
- | ^^
- |
-note: constructor is not visible here due to private fields
- --> $DIR/issue-42944.rs:2:19
- |
-LL | pub struct Bx(());
- | ^^ private field
-
error[E0425]: cannot find function, tuple struct or tuple variant `Bx` in this scope
--> $DIR/issue-42944.rs:16:9
|
@@ -22,6 +10,18 @@ note: tuple struct `foo::Bx` exists but is inaccessible
LL | pub struct Bx(());
| ^^^^^^^^^^^^^^^^^^ not accessible
+error[E0423]: cannot initialize a tuple struct which contains private fields
+ --> $DIR/issue-42944.rs:9:9
+ |
+LL | Bx(());
+ | ^^
+ |
+note: constructor is not visible here due to private fields
+ --> $DIR/issue-42944.rs:2:19
+ |
+LL | pub struct Bx(());
+ | ^^ private field
+
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0423, E0425.
diff --git a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr
index 55c3b66f1..1354abb4f 100644
--- a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr
+++ b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr
@@ -33,7 +33,7 @@ LL | async fn associated();
= 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(return_position_impl_trait_in_trait)]` to the crate attributes to enable
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
error[E0706]: functions in traits cannot be declared `async`
--> $DIR/issue-70736-async-fn-no-body-def-collector.rs:15:5
@@ -46,7 +46,7 @@ LL | async fn associated();
= 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(return_position_impl_trait_in_trait)]` to the crate attributes to enable
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
error: aborting due to 5 previous errors
diff --git a/src/test/ui/resolve/issue-73427.stderr b/src/test/ui/resolve/issue-73427.stderr
index a2ca46f0c..d31c5e477 100644
--- a/src/test/ui/resolve/issue-73427.stderr
+++ b/src/test/ui/resolve/issue-73427.stderr
@@ -124,13 +124,13 @@ LL | use std::f32::consts::E;
LL | use std::f64::consts::E;
|
-error[E0423]: expected function, tuple struct or tuple variant, found enum `A`
- --> $DIR/issue-73427.rs:46:13
+error[E0532]: expected tuple struct or tuple variant, found enum `A`
+ --> $DIR/issue-73427.rs:48:12
|
-LL | let x = A(3);
- | ^
+LL | if let A(3) = x { }
+ | ^
|
- = help: you might have meant to construct one of the enum's non-tuple variants
+ = help: you might have meant to match against one of the enum's non-tuple variants
note: the enum is defined here
--> $DIR/issue-73427.rs:1:1
|
@@ -142,20 +142,20 @@ LL | | Tuple(),
LL | | Unit,
LL | | }
| |_^
-help: try to construct one of the enum's variants
+help: try to match against one of the enum's variants
|
-LL | let x = A::Tuple(3);
- | ~~~~~~~~
-LL | let x = A::TupleWithFields(3);
- | ~~~~~~~~~~~~~~~~~~
+LL | if let A::Tuple(3) = x { }
+ | ~~~~~~~~
+LL | if let A::TupleWithFields(3) = x { }
+ | ~~~~~~~~~~~~~~~~~~
-error[E0532]: expected tuple struct or tuple variant, found enum `A`
- --> $DIR/issue-73427.rs:48:12
+error[E0423]: expected function, tuple struct or tuple variant, found enum `A`
+ --> $DIR/issue-73427.rs:46:13
|
-LL | if let A(3) = x { }
- | ^
+LL | let x = A(3);
+ | ^
|
- = help: you might have meant to match against one of the enum's non-tuple variants
+ = help: you might have meant to construct one of the enum's non-tuple variants
note: the enum is defined here
--> $DIR/issue-73427.rs:1:1
|
@@ -167,12 +167,12 @@ LL | | Tuple(),
LL | | Unit,
LL | | }
| |_^
-help: try to match against one of the enum's variants
+help: try to construct one of the enum's variants
|
-LL | if let A::Tuple(3) = x { }
- | ~~~~~~~~
-LL | if let A::TupleWithFields(3) = x { }
- | ~~~~~~~~~~~~~~~~~~
+LL | let x = A::Tuple(3);
+ | ~~~~~~~~
+LL | let x = A::TupleWithFields(3);
+ | ~~~~~~~~~~~~~~~~~~
error: aborting due to 7 previous errors
diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr
index 249a7e53d..9a2d61ea4 100644
--- a/src/test/ui/resolve/levenshtein.stderr
+++ b/src/test/ui/resolve/levenshtein.stderr
@@ -39,15 +39,6 @@ LL | const MAX_ITEM: usize = 10;
LL | let v = [0u32; MAXITEM]; // Misspelled constant name.
| ^^^^^^^ help: a constant with a similar name exists: `MAX_ITEM`
-error[E0425]: cannot find function `foobar` in this scope
- --> $DIR/levenshtein.rs:26:5
- |
-LL | fn foo_bar() {}
- | ------------ similarly named function `foo_bar` defined here
-...
-LL | foobar(); // Misspelled function name.
- | ^^^^^^ help: a function with a similar name exists: `foo_bar`
-
error[E0412]: cannot find type `first` in module `m`
--> $DIR/levenshtein.rs:28:15
|
@@ -66,6 +57,15 @@ LL | pub struct Second;
LL | let b: m::first = m::second; // Misspelled item in module.
| ^^^^^^ help: a unit struct with a similar name exists (notice the capitalization): `Second`
+error[E0425]: cannot find function `foobar` in this scope
+ --> $DIR/levenshtein.rs:26:5
+ |
+LL | fn foo_bar() {}
+ | ------------ similarly named function `foo_bar` defined here
+...
+LL | foobar(); // Misspelled function name.
+ | ^^^^^^ help: a function with a similar name exists: `foo_bar`
+
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0412, E0425.
diff --git a/src/test/ui/resolve/name-collision-in-trait-fn-sig.rs b/src/test/ui/resolve/name-collision-in-trait-fn-sig.rs
new file mode 100644
index 000000000..fba4ffa1c
--- /dev/null
+++ b/src/test/ui/resolve/name-collision-in-trait-fn-sig.rs
@@ -0,0 +1,11 @@
+// check-pass
+// This is currently stable behavior, which was almost accidentally made an
+// error in #102161 since there is no test exercising it. I am not sure if
+// this _should_ be the desired behavior, but at least we should know if it
+// changes.
+
+fn main() {}
+
+trait Foo {
+ fn fn_with_type_named_same_as_local_in_param(b: i32, b: i32);
+}
diff --git a/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr b/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr
index af9f4612a..eb26cd9ca 100644
--- a/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr
+++ b/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr
@@ -1,11 +1,16 @@
error[E0574]: expected struct, variant or union type, found type parameter `Baz`
--> $DIR/point-at-type-parameter-shadowing-another-type.rs:16:13
|
-LL | impl<Baz> Foo<Baz> for Bar {
- | --- found this type parameter
+LL | / struct Baz {
+LL | | num: usize,
+LL | | }
+ | |_- you might have meant to refer to this struct
+LL |
+LL | impl<Baz> Foo<Baz> for Bar {
+ | --- found this type parameter
...
-LL | Baz { num } => num,
- | ^^^ not a struct, variant or union type
+LL | Baz { num } => num,
+ | ^^^ not a struct, variant or union type
error: aborting due to previous error
diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr
index a369dc6db..82a4211f0 100644
--- a/src/test/ui/resolve/privacy-enum-ctor.stderr
+++ b/src/test/ui/resolve/privacy-enum-ctor.stderr
@@ -327,7 +327,7 @@ LL | let _: Z = Z::Fn;
|
= note: expected enum `Z`
found fn item `fn(u8) -> Z {Z::Fn}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
|
LL | let _: Z = Z::Fn(/* u8 */);
| ++++++++++
@@ -362,7 +362,7 @@ LL | let _: E = m::E::Fn;
|
= note: expected enum `E`
found fn item `fn(u8) -> E {E::Fn}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
|
LL | let _: E = m::E::Fn(/* u8 */);
| ++++++++++
@@ -397,7 +397,7 @@ LL | let _: E = E::Fn;
|
= note: expected enum `E`
found fn item `fn(u8) -> E {E::Fn}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
|
LL | let _: E = E::Fn(/* u8 */);
| ++++++++++
diff --git a/src/test/ui/resolve/resolve-assoc-suggestions.stderr b/src/test/ui/resolve/resolve-assoc-suggestions.stderr
index b6acaeb8c..8def9aa20 100644
--- a/src/test/ui/resolve/resolve-assoc-suggestions.stderr
+++ b/src/test/ui/resolve/resolve-assoc-suggestions.stderr
@@ -50,7 +50,7 @@ error[E0425]: cannot find value `method` in this scope
--> $DIR/resolve-assoc-suggestions.rs:34:9
|
LL | method;
- | ^^^^^^ help: you might have meant to call the method: `self.method`
+ | ^^^^^^ help: you might have meant to refer to the method: `self.method`
error: aborting due to 9 previous errors
diff --git a/src/test/ui/resolve/resolve-hint-macro.stderr b/src/test/ui/resolve/resolve-hint-macro.stderr
index bc69ddd8f..1e7ab48ef 100644
--- a/src/test/ui/resolve/resolve-hint-macro.stderr
+++ b/src/test/ui/resolve/resolve-hint-macro.stderr
@@ -14,17 +14,6 @@ LL | assert_eq { 1, 1 };
| |
| while parsing this struct
-error[E0423]: expected function, found macro `assert_eq`
- --> $DIR/resolve-hint-macro.rs:3:5
- |
-LL | assert_eq(1, 1);
- | ^^^^^^^^^ not a function
- |
-help: use `!` to invoke the macro
- |
-LL | assert_eq!(1, 1);
- | +
-
error[E0574]: expected struct, variant or union type, found macro `assert_eq`
--> $DIR/resolve-hint-macro.rs:5:5
|
@@ -47,6 +36,17 @@ help: use `!` to invoke the macro
LL | assert![true];
| +
+error[E0423]: expected function, found macro `assert_eq`
+ --> $DIR/resolve-hint-macro.rs:3:5
+ |
+LL | assert_eq(1, 1);
+ | ^^^^^^^^^ not a function
+ |
+help: use `!` to invoke the macro
+ |
+LL | assert_eq!(1, 1);
+ | +
+
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0423, E0574.
diff --git a/src/test/ui/resolve/resolve-self-in-impl.rs b/src/test/ui/resolve/resolve-self-in-impl.rs
index 024fdc51e..d0872d1b7 100644
--- a/src/test/ui/resolve/resolve-self-in-impl.rs
+++ b/src/test/ui/resolve/resolve-self-in-impl.rs
@@ -11,10 +11,11 @@ impl Tr for S where Self: Copy {} // OK
impl Tr for S where S<Self>: Copy {} // OK
impl Tr for S where Self::A: Copy {} // OK
-impl Tr for Self {} //~ ERROR cycle detected
-impl Tr for S<Self> {} //~ ERROR cycle detected
-impl Self {} //~ ERROR cycle detected
-impl S<Self> {} //~ ERROR cycle detected
+impl Tr for Self {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl Tr for S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl Self {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl (Self, Self) {} //~ ERROR `Self` is not valid in the self type of an impl block
impl Tr<Self::A> for S {} //~ ERROR cycle detected
fn main() {}
diff --git a/src/test/ui/resolve/resolve-self-in-impl.stderr b/src/test/ui/resolve/resolve-self-in-impl.stderr
index aa99c1a33..9f9ed6889 100644
--- a/src/test/ui/resolve/resolve-self-in-impl.stderr
+++ b/src/test/ui/resolve/resolve-self-in-impl.stderr
@@ -1,86 +1,50 @@
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:17>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/resolve-self-in-impl.rs:14:13
|
LL | impl Tr for Self {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:17>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/resolve-self-in-impl.rs:1:1
- |
-LL | / #![feature(associated_type_defaults)]
-LL | |
-LL | | struct S<T = u8>(T);
-LL | | trait Tr<T = u8> {
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+ = note: replace `Self` with a different type
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:20>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/resolve-self-in-impl.rs:15:15
|
LL | impl Tr for S<Self> {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:20>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/resolve-self-in-impl.rs:1:1
- |
-LL | / #![feature(associated_type_defaults)]
-LL | |
-LL | | struct S<T = u8>(T);
-LL | | trait Tr<T = u8> {
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+ = note: replace `Self` with a different type
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:10>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/resolve-self-in-impl.rs:16:6
|
LL | impl Self {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:10>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/resolve-self-in-impl.rs:1:1
- |
-LL | / #![feature(associated_type_defaults)]
-LL | |
-LL | | struct S<T = u8>(T);
-LL | | trait Tr<T = u8> {
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+ = note: replace `Self` with a different type
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:13>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/resolve-self-in-impl.rs:17:8
|
LL | impl S<Self> {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:13>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/resolve-self-in-impl.rs:1:1
+ = note: replace `Self` with a different type
+
+error: `Self` is not valid in the self type of an impl block
+ --> $DIR/resolve-self-in-impl.rs:18:7
|
-LL | / #![feature(associated_type_defaults)]
-LL | |
-LL | | struct S<T = u8>(T);
-LL | | trait Tr<T = u8> {
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+LL | impl (Self, Self) {}
+ | ^^^^ ^^^^
+ |
+ = note: replace `Self` with a different type
-error[E0391]: cycle detected when computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:23>`
- --> $DIR/resolve-self-in-impl.rs:18:1
+error[E0391]: cycle detected when computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:19:1: 19:23>`
+ --> $DIR/resolve-self-in-impl.rs:19:1
|
LL | impl Tr<Self::A> for S {}
| ^^^^^^^^^^^^^^^^^^^^^^
|
- = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:23>` again
+ = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:19:1: 19:23>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
@@ -93,6 +57,6 @@ LL | |
LL | | fn main() {}
| |____________^
-error: aborting due to 5 previous errors
+error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/resolve/resolve-speculative-adjustment.stderr b/src/test/ui/resolve/resolve-speculative-adjustment.stderr
index 1c34af6d0..be11a7ebe 100644
--- a/src/test/ui/resolve/resolve-speculative-adjustment.stderr
+++ b/src/test/ui/resolve/resolve-speculative-adjustment.stderr
@@ -4,12 +4,6 @@ error[E0425]: cannot find value `field` in this scope
LL | field;
| ^^^^^ not found in this scope
-error[E0425]: cannot find function `method` in this scope
- --> $DIR/resolve-speculative-adjustment.rs:19:13
- |
-LL | method();
- | ^^^^^^ not found in this scope
-
error[E0425]: cannot find value `field` in this scope
--> $DIR/resolve-speculative-adjustment.rs:23:9
|
@@ -22,6 +16,12 @@ error[E0425]: cannot find function `method` in this scope
LL | method();
| ^^^^^^ help: you might have meant to call the method: `self.method`
+error[E0425]: cannot find function `method` in this scope
+ --> $DIR/resolve-speculative-adjustment.rs:19:13
+ |
+LL | method();
+ | ^^^^^^ not found in this scope
+
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/resolve/tuple-struct-alias.stderr b/src/test/ui/resolve/tuple-struct-alias.stderr
index 5a7873301..a739ea43e 100644
--- a/src/test/ui/resolve/tuple-struct-alias.stderr
+++ b/src/test/ui/resolve/tuple-struct-alias.stderr
@@ -1,22 +1,22 @@
-error[E0423]: expected function, tuple struct or tuple variant, found type alias `A`
- --> $DIR/tuple-struct-alias.rs:5:13
+error[E0532]: expected tuple struct or tuple variant, found type alias `A`
+ --> $DIR/tuple-struct-alias.rs:7:9
|
LL | struct S(u8, u16);
| ------------------ similarly named tuple struct `S` defined here
...
-LL | let s = A(0, 1);
- | ^ help: a tuple struct with a similar name exists: `S`
+LL | A(..) => {}
+ | ^ help: a tuple struct with a similar name exists: `S`
|
= note: can't use a type alias as a constructor
-error[E0532]: expected tuple struct or tuple variant, found type alias `A`
- --> $DIR/tuple-struct-alias.rs:7:9
+error[E0423]: expected function, tuple struct or tuple variant, found type alias `A`
+ --> $DIR/tuple-struct-alias.rs:5:13
|
LL | struct S(u8, u16);
| ------------------ similarly named tuple struct `S` defined here
...
-LL | A(..) => {}
- | ^ help: a tuple struct with a similar name exists: `S`
+LL | let s = A(0, 1);
+ | ^ help: a tuple struct with a similar name exists: `S`
|
= note: can't use a type alias as a constructor
diff --git a/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr b/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
index 0b0a37f24..f32e0404e 100644
--- a/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
+++ b/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
@@ -31,24 +31,6 @@ help: a local variable with a similar name exists
LL | println!("{cofig}");
| ~~~~~
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:31:9
- |
-LL | baz();
- | ^^^
-...
-LL | fn ba() {}
- | ------- similarly named function `ba` defined here
- |
-help: you might have meant to call the method
- |
-LL | self.baz();
- | ~~~~~~~~
-help: a function with a similar name exists
- |
-LL | ba();
- | ~~
-
error[E0425]: cannot find value `bah` in this scope
--> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:33:9
|
@@ -58,7 +40,7 @@ LL | bah;
LL | fn ba() {}
| ------- similarly named function `ba` defined here
|
-help: you might have meant to call the associated function
+help: you might have meant to refer to the associated function
|
LL | Self::bah;
| ~~~~~~~~~
@@ -103,6 +85,24 @@ help: a type alias with a similar name exists
LL | let foo: Bar = "".to_string();
| ~~~
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:31:9
+ |
+LL | baz();
+ | ^^^
+...
+LL | fn ba() {}
+ | ------- similarly named function `ba` defined here
+ |
+help: you might have meant to call the method
+ |
+LL | self.baz();
+ | ~~~~~~~~
+help: a function with a similar name exists
+ |
+LL | ba();
+ | ~~
+
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0412, E0425.