From 2d8878987386c93cb232e7883ae28027cf8e5166 Mon Sep 17 00:00:00 2001 From: Adrian Taylor Date: Tue, 7 May 2024 08:12:14 +0100 Subject: [PATCH 1/2] Fix transmute message. --- src/reference_wrapper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reference_wrapper.rs b/src/reference_wrapper.rs index 041bd7277..529f070be 100644 --- a/src/reference_wrapper.rs +++ b/src/reference_wrapper.rs @@ -412,7 +412,7 @@ impl CppPin { // to // Box> // is safe. - let contents = unsafe { std::mem::transmute(item) }; + let contents = unsafe { std::mem::transmute::, Box>>(item) }; Self(contents) } From 78cbeee6677d26dbfa30717a449abe47c3284525 Mon Sep 17 00:00:00 2001 From: Adrian Taylor Date: Tue, 7 May 2024 08:16:51 +0100 Subject: [PATCH 2/2] Fixes for cfg flags. --- Cargo.toml | 3 +++ build.rs | 1 + integration-tests/build.rs | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 integration-tests/build.rs diff --git a/Cargo.toml b/Cargo.toml index b256777cc..6ef637988 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,9 @@ exclude = [ ".github", "book", "tools" ] # where we are depending on such features. resolver = "2" +[features] +arbitrary_self_types = [] + [dependencies] autocxx-macro = { path="macro", version="0.26.0" } cxx = "1.0.78" # ... also needed because expansion of type_id refers to ::cxx diff --git a/build.rs b/build.rs index b2de2dc86..637daf464 100644 --- a/build.rs +++ b/build.rs @@ -9,6 +9,7 @@ // It would be nice to use the rustversion crate here instead, // but that doesn't work with inner attributes. fn main() { + println!("cargo::rustc-check-cfg=cfg(nightly)"); if let Some(ver) = rustc_version() { if ver.contains("nightly") { println!("cargo:rustc-cfg=nightly") diff --git a/integration-tests/build.rs b/integration-tests/build.rs new file mode 100644 index 000000000..e912ac14f --- /dev/null +++ b/integration-tests/build.rs @@ -0,0 +1,12 @@ +// Copyright 2024 Google LLC +// +// Licensed under the 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. + +fn main() { + println!("cargo::rustc-check-cfg=cfg(skip_windows_gnu_failing_tests)"); + println!("cargo::rustc-check-cfg=cfg(skip_windows_msvc_failing_tests)"); +}