From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- .../tests/ui-msrv/transmute-mut-dst-generic.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 third_party/rust/zerocopy/tests/ui-msrv/transmute-mut-dst-generic.rs (limited to 'third_party/rust/zerocopy/tests/ui-msrv/transmute-mut-dst-generic.rs') diff --git a/third_party/rust/zerocopy/tests/ui-msrv/transmute-mut-dst-generic.rs b/third_party/rust/zerocopy/tests/ui-msrv/transmute-mut-dst-generic.rs new file mode 100644 index 0000000000..7068f1026d --- /dev/null +++ b/third_party/rust/zerocopy/tests/ui-msrv/transmute-mut-dst-generic.rs @@ -0,0 +1,18 @@ +// Copyright 2023 The Fuchsia Authors +// +// Licensed under a BSD-style license , Apache License, Version 2.0 +// , or the MIT +// license , at your option. +// This file may not be copied, modified, or distributed except according to +// those terms. + +extern crate zerocopy; + +use zerocopy::{transmute_mut, AsBytes, FromBytes}; + +fn main() {} + +fn transmute_mut(u: &mut u8) -> &mut T { + // `transmute_mut!` requires the destination type to be concrete. + transmute_mut!(u) +} -- cgit v1.2.3