Skip to content

Commit be510db

Browse files
committed
Adjust tests for method disambiguation help
1 parent bd8813e commit be510db

8 files changed

+16
-0
lines changed

src/test/ui/associated-const/associated-const-ambiguity-report.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ note: candidate #1 is defined in an impl of the trait `Foo` for the type `i32`
99
|
1010
LL | const ID: i32 = 1;
1111
| ^^^^^^^^^^^^^^^^^^
12+
= help: to disambiguate the method call, write `Foo::ID(...)` instead
1213
note: candidate #2 is defined in an impl of the trait `Bar` for the type `i32`
1314
--> $DIR/associated-const-ambiguity-report.rs:14:5
1415
|
1516
LL | const ID: i32 = 3;
1617
| ^^^^^^^^^^^^^^^^^^
18+
= help: to disambiguate the method call, write `Bar::ID(...)` instead
1719

1820
error: aborting due to previous error
1921

src/test/ui/error-codes/E0034.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ note: candidate #1 is defined in an impl of the trait `Trait1` for the type `Tes
99
|
1010
LL | fn foo() {}
1111
| ^^^^^^^^
12+
= help: to disambiguate the method call, write `Trait1::foo(...)` instead
1213
note: candidate #2 is defined in an impl of the trait `Trait2` for the type `Test`
1314
--> $DIR/E0034.rs:16:5
1415
|
1516
LL | fn foo() {}
1617
| ^^^^^^^^
18+
= help: to disambiguate the method call, write `Trait2::foo(...)` instead
1719

1820
error: aborting due to previous error
1921

src/test/ui/inference/inference_unstable_featured.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ LL | assert_eq!('x'.ipu_flatten(), 0);
55
| ^^^^^^^^^^^ multiple `ipu_flatten` found
66
|
77
= note: candidate #1 is defined in an impl of the trait `inference_unstable_iterator::IpuIterator` for the type `char`
8+
= help: to disambiguate the method call, write `inference_unstable_iterator::IpuIterator::ipu_flatten('x')` instead
89
= note: candidate #2 is defined in an impl of the trait `inference_unstable_itertools::IpuItertools` for the type `char`
10+
= help: to disambiguate the method call, write `inference_unstable_itertools::IpuItertools::ipu_flatten('x')` instead
911

1012
error: aborting due to previous error
1113

src/test/ui/issues/issue-3702-2.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ note: candidate #1 is defined in an impl of the trait `ToPrimitive` for the type
99
|
1010
LL | fn to_int(&self) -> isize { 0 }
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^
12+
= help: to disambiguate the method call, write `ToPrimitive::to_int(&self)` instead
1213
note: candidate #2 is defined in an impl of the trait `Add` for the type `isize`
1314
--> $DIR/issue-3702-2.rs:14:5
1415
|
1516
LL | fn to_int(&self) -> isize { *self }
1617
| ^^^^^^^^^^^^^^^^^^^^^^^^^
18+
= help: to disambiguate the method call, write `Add::to_int(&self)` instead
1719

1820
error: aborting due to previous error
1921

src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ note: candidate #1 is defined in an impl of the trait `Me2` for the type `usize`
99
|
1010
LL | impl Me2 for usize { fn me(&self) -> usize { *self } }
1111
| ^^^^^^^^^^^^^^^^^^^^^
12+
= help: to disambiguate the method call, write `Me2::me(1_usize)` instead
1213
= note: candidate #2 is defined in an impl of the trait `ambig_impl_2_lib::Me` for the type `usize`
14+
= help: to disambiguate the method call, write `ambig_impl_2_lib::Me::me(1_usize)` instead
1315

1416
error: aborting due to previous error
1517

src/test/ui/methods/method-ambig-two-traits-with-default-method.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ note: candidate #1 is defined in an impl of the trait `Foo` for the type `usize`
99
|
1010
LL | trait Foo { fn method(&self) {} }
1111
| ^^^^^^^^^^^^^^^^
12+
= help: to disambiguate the method call, write `Foo::method(1_usize)` instead
1213
note: candidate #2 is defined in an impl of the trait `Bar` for the type `usize`
1314
--> $DIR/method-ambig-two-traits-with-default-method.rs:6:13
1415
|
1516
LL | trait Bar { fn method(&self) {} }
1617
| ^^^^^^^^^^^^^^^^
18+
= help: to disambiguate the method call, write `Bar::method(1_usize)` instead
1719

1820
error: aborting due to previous error
1921

src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ note: candidate #1 is defined in an impl of the trait `internal::X` for the type
2727
|
2828
LL | fn foo(self: Smaht<Self, u64>) -> u64 {
2929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
= help: to disambiguate the method call, write `internal::X::foo(x)` instead
3031
note: candidate #2 is defined in an impl of the trait `nuisance_foo::NuisanceFoo` for the type `_`
3132
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:70:9
3233
|
3334
LL | fn foo(self) {}
3435
| ^^^^^^^^^^^^
36+
= help: to disambiguate the method call, write `nuisance_foo::NuisanceFoo::foo(x)` instead
3537
note: candidate #3 is defined in the trait `FinalFoo`
3638
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:57:5
3739
|

src/test/ui/traits/trait-alias-ambiguous.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ note: candidate #1 is defined in an impl of the trait `inner::A` for the type `u
99
|
1010
LL | fn foo(&self) {}
1111
| ^^^^^^^^^^^^^
12+
= help: to disambiguate the method call, write `inner::A::foo(t)` instead
1213
note: candidate #2 is defined in an impl of the trait `inner::B` for the type `u8`
1314
--> $DIR/trait-alias-ambiguous.rs:11:9
1415
|
1516
LL | fn foo(&self) {}
1617
| ^^^^^^^^^^^^^
18+
= help: to disambiguate the method call, write `inner::B::foo(t)` instead
1719

1820
error: aborting due to previous error
1921

0 commit comments

Comments
 (0)