diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-04-27 12:34:00 -0700 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-05-22 13:34:41 -0700 |
| commit | 8ea828be2f1266578121a2dfe76693115e8f03ff (patch) | |
| tree | 6868c8a0ad727d6c6d11fdd923fd15531df33c5f | |
| parent | 730c6f3e57a4068547d2d08e7a84efea215cd1ee (diff) | |
| download | rust-8ea828be2f1266578121a2dfe76693115e8f03ff.tar.gz rust-8ea828be2f1266578121a2dfe76693115e8f03ff.zip | |
Add regression test for #71394
| -rw-r--r-- | src/test/ui/suggestions/issue-71394-no-from-impl.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/suggestions/issue-71394-no-from-impl.stderr | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/issue-71394-no-from-impl.rs b/src/test/ui/suggestions/issue-71394-no-from-impl.rs new file mode 100644 index 00000000000..9ffcc3f7bc1 --- /dev/null +++ b/src/test/ui/suggestions/issue-71394-no-from-impl.rs @@ -0,0 +1,5 @@ +fn main() { + let data: &[u8] = &[0; 10]; + let _: &[i8] = data.into(); + //~^ ERROR the trait bound `&[i8]: std::convert::From<&[u8]>` is not satisfied +} diff --git a/src/test/ui/suggestions/issue-71394-no-from-impl.stderr b/src/test/ui/suggestions/issue-71394-no-from-impl.stderr new file mode 100644 index 00000000000..84c73c2f67e --- /dev/null +++ b/src/test/ui/suggestions/issue-71394-no-from-impl.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `&[i8]: std::convert::From<&[u8]>` is not satisfied + --> $DIR/issue-71394-no-from-impl.rs:3:25 + | +LL | let _: &[i8] = data.into(); + | ^^^^ the trait `std::convert::From<&[u8]>` is not implemented for `&[i8]` + | + = note: required because of the requirements on the impl of `std::convert::Into<&[i8]>` for `&[u8]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. |
