diff options
| author | bors <bors@rust-lang.org> | 2023-05-31 13:47:36 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-31 13:47:36 +0000 |
| commit | ad8304a0d5280de30856b39c19df7b306957e878 (patch) | |
| tree | 4c5167ddcf79cb528d67dcee35082adb7e38f980 /tests | |
| parent | e4f7ad8e68206fa54372535b5c04d7ddbaea43be (diff) | |
| parent | 52bd82f522c4f3d9bd0dc534c06169285afbc23b (diff) | |
| download | rust-ad8304a0d5280de30856b39c19df7b306957e878.tar.gz rust-ad8304a0d5280de30856b39c19df7b306957e878.zip | |
Auto merge of #111076 - notriddle:notriddle/silence-private-dep-trait-impl-suggestions, r=cjgillot
diagnostics: exclude indirect private deps from trait impl suggest Fixes #88696
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/suggestions/issue-88696.rs | 14 | ||||
| -rw-r--r-- | tests/ui/suggestions/issue-88696.stderr | 11 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/suggestions/issue-88696.rs b/tests/ui/suggestions/issue-88696.rs new file mode 100644 index 00000000000..745fdef1546 --- /dev/null +++ b/tests/ui/suggestions/issue-88696.rs @@ -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()); +} diff --git a/tests/ui/suggestions/issue-88696.stderr b/tests/ui/suggestions/issue-88696.stderr new file mode 100644 index 00000000000..4947269d759 --- /dev/null +++ b/tests/ui/suggestions/issue-88696.stderr @@ -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`. |
