forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diagnostics: exclude indirect private deps from trait impl suggest
Fixes rust-lang#88696
- Loading branch information
Showing
4 changed files
with
48 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// This test case should ensure that miniz_oxide isn't | ||
// suggested, since it's not a direct dependency. | ||
|
||
fn a() -> Result<u64, i32> { | ||
Err(1) | ||
} | ||
|
||
fn b() -> Result<u32, i32> { | ||
a().into() //~ERROR [E0277] | ||
} | ||
|
||
fn main() { | ||
let _ = dbg!(b()); | ||
} |
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,11 @@ | ||
error[E0277]: the trait bound `Result<u32, i32>: From<Result<u64, i32>>` is not satisfied | ||
--> $DIR/issue-88696.rs:9:9 | ||
| | ||
LL | a().into() | ||
| ^^^^ the trait `From<Result<u64, i32>>` is not implemented for `Result<u32, i32>` | ||
| | ||
= note: required for `Result<u64, i32>` to implement `Into<Result<u32, i32>>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |