summaryrefslogtreecommitdiffstats
path: root/tests/ui/methods
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/methods')
-rw-r--r--tests/ui/methods/issue-3707.stderr2
-rw-r--r--tests/ui/methods/issues/issue-84495.stderr2
-rw-r--r--tests/ui/methods/issues/issue-94581.stderr2
-rw-r--r--tests/ui/methods/method-ambig-two-traits-cross-crate.stderr2
-rw-r--r--tests/ui/methods/method-ambig-two-traits-from-bounds.stderr2
-rw-r--r--tests/ui/methods/method-ambig-two-traits-from-impls.stderr2
-rw-r--r--tests/ui/methods/method-ambig-two-traits-from-impls2.stderr2
-rw-r--r--tests/ui/methods/method-ambig-two-traits-with-default-method.stderr2
-rw-r--r--tests/ui/methods/method-ambiguity-no-rcvr.rs14
-rw-r--r--tests/ui/methods/method-ambiguity-no-rcvr.stderr32
-rw-r--r--tests/ui/methods/method-call-lifetime-args-unresolved.stderr2
-rw-r--r--tests/ui/methods/method-call-type-binding.stderr2
-rw-r--r--tests/ui/methods/method-macro-backtrace.stderr2
-rw-r--r--tests/ui/methods/method-not-found-but-doc-alias.stderr2
-rw-r--r--tests/ui/methods/method-resolvable-path-in-pattern.stderr2
-rw-r--r--tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr2
16 files changed, 60 insertions, 14 deletions
diff --git a/tests/ui/methods/issue-3707.stderr b/tests/ui/methods/issue-3707.stderr
index 07c8101cb..b3d4dfe5a 100644
--- a/tests/ui/methods/issue-3707.stderr
+++ b/tests/ui/methods/issue-3707.stderr
@@ -14,6 +14,6 @@ note: the candidate is defined in an impl for the type `Obj`
LL | pub fn boom() -> bool {
| ^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/methods/issues/issue-84495.stderr b/tests/ui/methods/issues/issue-84495.stderr
index b0217a7c8..1603c0026 100644
--- a/tests/ui/methods/issues/issue-84495.stderr
+++ b/tests/ui/methods/issues/issue-84495.stderr
@@ -8,6 +8,6 @@ LL | println!("{:?}", x.count());
`i32: Iterator`
which is required by `&mut i32: Iterator`
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/methods/issues/issue-94581.stderr b/tests/ui/methods/issues/issue-94581.stderr
index d6be29cf5..ae7446d48 100644
--- a/tests/ui/methods/issues/issue-94581.stderr
+++ b/tests/ui/methods/issues/issue-94581.stderr
@@ -10,6 +10,6 @@ LL | let sqsum = get_slice().map(|i| i * i).sum();
`[i32]: Iterator`
which is required by `&mut [i32]: Iterator`
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr b/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr
index 5132d9277..0c775612b 100644
--- a/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-cross-crate.stderr
@@ -19,6 +19,6 @@ help: disambiguate the method for candidate #2
LL | fn main() { Me2::me(&1_usize); }
| ~~~~~~~~~~~~~~~~~
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
diff --git a/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr b/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr
index 9a84768a9..690f979fa 100644
--- a/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-from-bounds.stderr
@@ -23,6 +23,6 @@ help: disambiguate the method for candidate #2
LL | B::foo(&t);
| ~~~~~~~~~~
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
diff --git a/tests/ui/methods/method-ambig-two-traits-from-impls.stderr b/tests/ui/methods/method-ambig-two-traits-from-impls.stderr
index 313591433..8be6d6d64 100644
--- a/tests/ui/methods/method-ambig-two-traits-from-impls.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-from-impls.stderr
@@ -23,6 +23,6 @@ help: disambiguate the method for candidate #2
LL | B::foo(AB {});
| ~~~~~~~~~~~~~
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
diff --git a/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr b/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr
index 5bb887b45..333520847 100644
--- a/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-from-impls2.stderr
@@ -21,6 +21,6 @@ LL | <AB as A>::foo();
LL | <AB as B>::foo();
| ~~~~~~~~~~~
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
diff --git a/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr b/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr
index df01966b3..9da307436 100644
--- a/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr
+++ b/tests/ui/methods/method-ambig-two-traits-with-default-method.stderr
@@ -23,6 +23,6 @@ help: disambiguate the method for candidate #2
LL | Bar::method(&1_usize);
| ~~~~~~~~~~~~~~~~~~~~~
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
diff --git a/tests/ui/methods/method-ambiguity-no-rcvr.rs b/tests/ui/methods/method-ambiguity-no-rcvr.rs
new file mode 100644
index 000000000..8f36011d4
--- /dev/null
+++ b/tests/ui/methods/method-ambiguity-no-rcvr.rs
@@ -0,0 +1,14 @@
+struct Qux;
+
+trait Foo {
+ fn foo();
+}
+
+trait FooBar {
+ fn foo() {}
+}
+
+fn main() {
+ Qux.foo();
+ //~^ ERROR no method named `foo` found for struct `Qux` in the current scope
+}
diff --git a/tests/ui/methods/method-ambiguity-no-rcvr.stderr b/tests/ui/methods/method-ambiguity-no-rcvr.stderr
new file mode 100644
index 000000000..73f6043f2
--- /dev/null
+++ b/tests/ui/methods/method-ambiguity-no-rcvr.stderr
@@ -0,0 +1,32 @@
+error[E0599]: no method named `foo` found for struct `Qux` in the current scope
+ --> $DIR/method-ambiguity-no-rcvr.rs:12:9
+ |
+LL | struct Qux;
+ | ---------- method `foo` not found for this struct
+...
+LL | Qux.foo();
+ | ^^^ this is an associated function, not a method
+ |
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
+note: candidate #1 is defined in the trait `Foo`
+ --> $DIR/method-ambiguity-no-rcvr.rs:4:5
+ |
+LL | fn foo();
+ | ^^^^^^^^^
+note: candidate #2 is defined in the trait `FooBar`
+ --> $DIR/method-ambiguity-no-rcvr.rs:8:5
+ |
+LL | fn foo() {}
+ | ^^^^^^^^
+help: disambiguate the associated function for candidate #1
+ |
+LL | <Qux as Foo>::foo(Qux);
+ | ~~~~~~~~~~~~~~~~~~~~~~
+help: disambiguate the associated function for candidate #2
+ |
+LL | <Qux as FooBar>::foo(Qux);
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/methods/method-call-lifetime-args-unresolved.stderr b/tests/ui/methods/method-call-lifetime-args-unresolved.stderr
index 25ad360b3..c72e7e0cd 100644
--- a/tests/ui/methods/method-call-lifetime-args-unresolved.stderr
+++ b/tests/ui/methods/method-call-lifetime-args-unresolved.stderr
@@ -19,6 +19,6 @@ LL | 0.clone::<'a>();
= note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868>
= note: `#[warn(late_bound_lifetime_arguments)]` on by default
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to 1 previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0261`.
diff --git a/tests/ui/methods/method-call-type-binding.stderr b/tests/ui/methods/method-call-type-binding.stderr
index 4b93082ac..54d855d34 100644
--- a/tests/ui/methods/method-call-type-binding.stderr
+++ b/tests/ui/methods/method-call-type-binding.stderr
@@ -4,6 +4,6 @@ error[E0229]: associated type bindings are not allowed here
LL | 0.clone::<T = u8>();
| ^^^^^^ associated type not allowed here
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0229`.
diff --git a/tests/ui/methods/method-macro-backtrace.stderr b/tests/ui/methods/method-macro-backtrace.stderr
index dd616c4a5..f0b111379 100644
--- a/tests/ui/methods/method-macro-backtrace.stderr
+++ b/tests/ui/methods/method-macro-backtrace.stderr
@@ -6,6 +6,6 @@ LL | fn bar(&self) { }
LL | fn bar(&self) { }
| ^^^^^^^^^^^^^ duplicate definitions for `bar`
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0592`.
diff --git a/tests/ui/methods/method-not-found-but-doc-alias.stderr b/tests/ui/methods/method-not-found-but-doc-alias.stderr
index 5102a452f..9746c4040 100644
--- a/tests/ui/methods/method-not-found-but-doc-alias.stderr
+++ b/tests/ui/methods/method-not-found-but-doc-alias.stderr
@@ -7,6 +7,6 @@ LL | struct Foo;
LL | Foo.quux();
| ^^^^ help: there is a method with a similar name: `bar`
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/methods/method-resolvable-path-in-pattern.stderr b/tests/ui/methods/method-resolvable-path-in-pattern.stderr
index 7c454a9a7..070d912d1 100644
--- a/tests/ui/methods/method-resolvable-path-in-pattern.stderr
+++ b/tests/ui/methods/method-resolvable-path-in-pattern.stderr
@@ -4,6 +4,6 @@ error[E0532]: expected unit struct, unit variant or constant, found associated f
LL | <Foo as MyTrait>::trait_bar => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a unit struct, unit variant or constant
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0532`.
diff --git a/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr b/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr
index 9694f80ab..86c2f6431 100644
--- a/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr
+++ b/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr
@@ -10,6 +10,6 @@ LL - let hello = len(vec![]);
LL + let hello = vec![].len();
|
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0425`.