-
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.
Rollup merge of #109472 - MU001999:patch-3, r=eholk
Add parentheses properly for method calls Fixes #109436
- Loading branch information
Showing
3 changed files
with
53 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
struct Foo; | ||
struct Bar; | ||
|
||
impl From<&Foo> for Bar { | ||
fn from(foo: &Foo) -> Bar { | ||
Bar | ||
} | ||
} | ||
|
||
fn main() { | ||
let foo = Foo; | ||
let b: Bar = foo.into(); //~ ERROR E0277 | ||
} |
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[E0277]: the trait bound `Foo: Into<_>` is not satisfied | ||
--> $DIR/issue-109436.rs:12:22 | ||
| | ||
LL | let b: Bar = foo.into(); | ||
| ^^^^ the trait `~const Into<_>` is not implemented for `Foo` | ||
| | ||
= note: required for `Foo` to implement `Into<Bar>` | ||
help: consider borrowing here | ||
| | ||
LL | let b: Bar = (&foo).into(); | ||
| ++ + | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |