-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't continue probing for method if in suggestion and autoderef hits…
… ambiguity
- Loading branch information
1 parent
5baee04
commit 4bc41b9
Showing
3 changed files
with
34 additions
and
2 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
16 changes: 16 additions & 0 deletions
16
tests/ui/methods/suggest-method-on-call-for-ambig-receiver.rs
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 @@ | ||
// Fix for <https://github.com/rust-lang/rust/issues/125432>. | ||
|
||
fn separate_arms() { | ||
let mut x = None; | ||
match x { | ||
None => { | ||
x = Some(0); | ||
} | ||
Some(right) => { | ||
consume(right); | ||
//~^ ERROR cannot find function `consume` in this scope | ||
} | ||
} | ||
} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
tests/ui/methods/suggest-method-on-call-for-ambig-receiver.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,9 @@ | ||
error[E0425]: cannot find function `consume` in this scope | ||
--> $DIR/suggest-method-on-call-for-ambig-receiver.rs:10:13 | ||
| | ||
LL | consume(right); | ||
| ^^^^^^^ not found in this scope | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0425`. |