Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5c2006b
remove pointless allowed_through_unstable_modules on TryFromSliceError
RalfJung Jan 14, 2025
6103896
rustc-dev-guide: add note about not adding rustc_allowed_through_unst…
RalfJung Jan 14, 2025
0fe555a
Add NuttX support for AArch64 and ARMv7-A targets
no1wudi Jan 7, 2025
6702df1
For E0223, suggest associated functions that are similar to the path,…
zachs18 Jan 22, 2025
221b621
Add test that multiple impls works with E0223 similar-name suggestion.
zachs18 Jan 22, 2025
7e1a8bd
Also check for associated fns on primitives in E0223 similar-path check.
zachs18 Jan 22, 2025
ed7cc34
Implement `VecDeque::pop_front_if` & `VecDeque::pop_back_if`
GrigorenkoPV Jan 22, 2025
9c0e32b
rustdoc-json: Rename `Path::name` to `path`, and give it path (again).
aDotInTheVoid Jan 20, 2025
11067c4
Remove query normalize from normalize type op
compiler-errors Jan 23, 2025
00a0ef4
Remove query normalize from dropck outlives type op
compiler-errors Jan 23, 2025
b88dea2
fix reify-intrinsic test
RalfJung Jan 23, 2025
2c58212
Give E0223 similar-item suggestion test more descriptive name.
zachs18 Jan 23, 2025
c27a6bf
Add extensive set of drop order tests
traviscross Nov 29, 2024
a7922db
Rollup merge of #133605 - traviscross:TC/add-2024-drop-order-tests, r…
matthiaskrgr Jan 24, 2025
a3fb2a0
Rollup merge of #135489 - RalfJung:TryFromSliceError, r=tgross35
matthiaskrgr Jan 24, 2025
042da35
Rollup merge of #135757 - no1wudi:master, r=compiler-errors
matthiaskrgr Jan 24, 2025
40e2858
Rollup merge of #135799 - aDotInTheVoid:skrrt-skrrt-revrrt, r=Guillau…
matthiaskrgr Jan 24, 2025
efb8084
Rollup merge of #135865 - zachs18:maybe_report_similar_assoc_fn_more,…
matthiaskrgr Jan 24, 2025
be15391
Rollup merge of #135890 - GrigorenkoPV:deque-pop-if, r=thomcc
matthiaskrgr Jan 24, 2025
556d901
Rollup merge of #135914 - compiler-errors:vanquish-query-norm, r=jack…
matthiaskrgr Jan 24, 2025
109def5
Rollup merge of #135936 - RalfJung:reify-intrinsic, r=oli-obk
matthiaskrgr Jan 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test that multiple impls works with E0223 similar-name suggestion.
  • Loading branch information
zachs18 committed Jan 22, 2025
commit 221b6214c05bae34f6814177bb26f2a88b358ca3
19 changes: 19 additions & 0 deletions tests/ui/suggestions/issue-109195.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
struct Foo;

impl Foo {
fn bar_baz() {}
}

impl Foo {
fn bar_quux() {}
}

fn main() {
String::from::utf8;
//~^ ERROR ambiguous associated type [E0223]
Expand All @@ -17,4 +27,13 @@ fn main() {
str::from::utf8_mut();
//~^ ERROR ambiguous associated type [E0223]
//~| HELP if there were a trait named `Example` with associated type `from`
Foo::bar::baz;
//~^ ERROR ambiguous associated type [E0223]
//~| HELP there is an associated function with a similar name: `bar_baz`
Foo::bar::quux;
//~^ ERROR ambiguous associated type [E0223]
//~| HELP there is an associated function with a similar name: `bar_quux`
Foo::bar::fizz;
//~^ ERROR ambiguous associated type [E0223]
//~| HELP if there were a trait named `Example` with associated type `bar`
}
47 changes: 40 additions & 7 deletions tests/ui/suggestions/issue-109195.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0223]: ambiguous associated type
--> $DIR/issue-109195.rs:2:5
--> $DIR/issue-109195.rs:12:5
|
LL | String::from::utf8;
| ^^^^^^^^^^^^
Expand All @@ -10,7 +10,7 @@ LL | String::from_utf8;
| ~~~~~~~~~

error[E0223]: ambiguous associated type
--> $DIR/issue-109195.rs:5:5
--> $DIR/issue-109195.rs:15:5
|
LL | String::from::utf8();
| ^^^^^^^^^^^^
Expand All @@ -21,7 +21,7 @@ LL | String::from_utf8();
| ~~~~~~~~~

error[E0223]: ambiguous associated type
--> $DIR/issue-109195.rs:8:5
--> $DIR/issue-109195.rs:18:5
|
LL | String::from::utf16();
| ^^^^^^^^^^^^
Expand All @@ -32,7 +32,7 @@ LL | String::from_utf16();
| ~~~~~~~~~~

error[E0223]: ambiguous associated type
--> $DIR/issue-109195.rs:11:5
--> $DIR/issue-109195.rs:21:5
|
LL | String::from::method_that_doesnt_exist();
| ^^^^^^^^^^^^
Expand All @@ -43,7 +43,7 @@ LL | <String as Example>::from::method_that_doesnt_exist();
| ~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0223]: ambiguous associated type
--> $DIR/issue-109195.rs:14:5
--> $DIR/issue-109195.rs:24:5
|
LL | str::from::utf8();
| ^^^^^^^^^
Expand All @@ -54,7 +54,7 @@ LL | <str as Example>::from::utf8();
| ~~~~~~~~~~~~~~~~~~~~~~

error[E0223]: ambiguous associated type
--> $DIR/issue-109195.rs:17:5
--> $DIR/issue-109195.rs:27:5
|
LL | str::from::utf8_mut();
| ^^^^^^^^^
Expand All @@ -64,6 +64,39 @@ help: if there were a trait named `Example` with associated type `from` implemen
LL | <str as Example>::from::utf8_mut();
| ~~~~~~~~~~~~~~~~~~~~~~

error: aborting due to 6 previous errors
error[E0223]: ambiguous associated type
--> $DIR/issue-109195.rs:30:5
|
LL | Foo::bar::baz;
| ^^^^^^^^
|
help: there is an associated function with a similar name: `bar_baz`
|
LL | Foo::bar_baz;
| ~~~~~~~

error[E0223]: ambiguous associated type
--> $DIR/issue-109195.rs:33:5
|
LL | Foo::bar::quux;
| ^^^^^^^^
|
help: there is an associated function with a similar name: `bar_quux`
|
LL | Foo::bar_quux;
| ~~~~~~~~

error[E0223]: ambiguous associated type
--> $DIR/issue-109195.rs:36:5
|
LL | Foo::bar::fizz;
| ^^^^^^^^
|
help: if there were a trait named `Example` with associated type `bar` implemented for `Foo`, you could use the fully-qualified path
|
LL | <Foo as Example>::bar::fizz;
| ~~~~~~~~~~~~~~~~~~~~~

error: aborting due to 9 previous errors

For more information about this error, try `rustc --explain E0223`.