summaryrefslogtreecommitdiff
path: root/tests/ui/std
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2023-08-14 16:48:39 -0700
committerJosh Stone <jistone@redhat.com>2023-08-14 16:57:51 -0700
commit677afb4b4571cc32154f340c26908baa9e1a2540 (patch)
treeb270ffd670eb5389a7dbacde7da20c756b5d312f /tests/ui/std
parent180dffba142c47240ca0d93096ce90b9fd97c8d7 (diff)
Add a regression test for #113238
Diffstat (limited to 'tests/ui/std')
-rw-r--r--tests/ui/std/slice-from-array-issue-113238.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/std/slice-from-array-issue-113238.rs b/tests/ui/std/slice-from-array-issue-113238.rs
new file mode 100644
index 00000000000..e9e1bfb8db3
--- /dev/null
+++ b/tests/ui/std/slice-from-array-issue-113238.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+// This intends to use the unsizing coercion from array to slice, but it only
+// works if we resolve `<&[u8]>::from` as the reflexive `From<T> for T`. In
+// #113238, we found that gimli had added its own `From<EndianSlice> for &[u8]`
+// that affected all `std/backtrace` users.
+fn main() {
+ let _ = <&[u8]>::from(&[]);
+}