forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Method resolution constrains hidden types instead of rejecting method…
… candidates
- Loading branch information
Showing
22 changed files
with
87 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0599]: no method named `foo` found for struct `Bar` in the current scope | ||
--> $DIR/method-resolution.rs:22:11 | ||
| | ||
LL | struct Bar<T>(T); | ||
| ------------- method `foo` not found for this struct | ||
... | ||
LL | x.foo(); | ||
| ^^^ method not found in `Bar<_>` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0599`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
error[E0034]: multiple applicable items in scope | ||
error[E0599]: no method named `foo` found for struct `Bar` in the current scope | ||
--> $DIR/method-resolution3.rs:22:11 | ||
| | ||
LL | x.bar(); | ||
| ^^^ multiple `bar` found | ||
| | ||
note: candidate #1 is defined in an impl for the type `Bar<i32>` | ||
--> $DIR/method-resolution3.rs:15:5 | ||
| | ||
LL | fn bar(self) {} | ||
| ^^^^^^^^^^^^ | ||
note: candidate #2 is defined in an impl for the type `Bar<u32>` | ||
--> $DIR/method-resolution3.rs:11:5 | ||
| | ||
LL | fn bar(self) {} | ||
| ^^^^^^^^^^^^ | ||
LL | struct Bar<T>(T); | ||
| ------------- method `foo` not found for this struct | ||
... | ||
LL | x.foo(); | ||
| ^^^ method not found in `Bar<_>` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0034`. | ||
For more information about this error, try `rustc --explain E0599`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/method-resolution4.rs:15:5 | ||
| | ||
LL | std::iter::empty() | ||
| ^^^^^^^^^^^^^^^^^^ expected `&mut _`, found `Empty<_>` | ||
| | ||
= note: expected mutable reference `&mut _` | ||
found struct `std::iter::Empty<_>` | ||
help: consider mutably borrowing here | ||
| | ||
LL | &mut std::iter::empty() | ||
| ++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
tests/ui/type-alias-impl-trait/method_resolution2.current.stderr
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.current.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0284]: type annotations needed | ||
--> $DIR/method_resolution_trait_method_from_opaque.rs:25:18 | ||
| | ||
LL | self.bar.next().unwrap(); | ||
| ^^^^ | ||
| | ||
= note: cannot satisfy `<_ as Iterator>::Item == _` | ||
help: try using a fully qualified path to specify the expected types | ||
| | ||
LL | <_ as Iterator>::next(self.bar).unwrap(); | ||
| ++++++++++++++++++++++ ~ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0284`. |
2 changes: 1 addition & 1 deletion
2
tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.next.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.