-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't give method suggestions when method probe fails due to bad impl…
… of Deref
- Loading branch information
1 parent
d194948
commit e8b6ad8
Showing
5 changed files
with
54 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use std::clone::Clone; | ||
use std::ops::Deref; | ||
|
||
#[derive(Clone)] | ||
pub struct Foo {} | ||
|
||
impl Deref for Foo {} | ||
//~^ ERROR not all trait items implemented | ||
|
||
pub fn main() { | ||
let f = Foo {}; | ||
let _ = f.clone(); | ||
} |
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[E0046]: not all trait items implemented, missing: `Target`, `deref` | ||
--> $DIR/dont-suggest-import-on-deref-err.rs:7:1 | ||
| | ||
LL | impl Deref for Foo {} | ||
| ^^^^^^^^^^^^^^^^^^ missing `Target`, `deref` in implementation | ||
| | ||
= help: implement the missing item: `type Target = /* Type */;` | ||
= help: implement the missing item: `fn deref(&self) -> &<Self as Deref>::Target { todo!() }` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0046`. |