blob: 4401d018539a7d9f0cae3d6c5bb1edddf43189ac [file]
// Part of the Crubit project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// Automatically @generated Rust bindings for the following C++ target:
// //examples/cpp/method:example_lib
#![rustfmt::skip]
#![feature(cfi_encoding, custom_inner_attributes, negative_impls)]
#![allow(stable_features)]
#![allow(improper_ctypes)]
#![allow(nonstandard_style)]
#![allow(unused)]
#![allow(deprecated)]
#![allow(unknown_lints, suspicious_runtime_symbol_definitions)]
#![deny(warnings)]
pub mod foo {
#[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)]
#[cfi_encoding = "N3foo3BarE"]
#[repr(C)]
///CRUBIT_ANNOTATE: cpp_type=foo :: Bar
///CRUBIT_ANNOTATE: cpp_move_constructible=
pub struct Bar {
pub x: ::ffi_11::c_int,
}
impl !Send for Bar {}
impl !Sync for Bar {}
unsafe impl ::cxx::ExternType for Bar {
type Id = ::cxx::type_id!("foo :: Bar");
type Kind = ::cxx::kind::Trivial;
}
forward_declare::unsafe_define!(forward_declare::symbol!("foo :: Bar"), crate::foo::Bar);
impl Bar {
#[inline(always)]
pub fn MyMethod<'__this>(&'__this mut self) {
unsafe { self::bar::MyMethod(self) }
}
}
impl Default for Bar {
#[inline(always)]
fn default() -> Self {
let mut tmp = ::core::mem::MaybeUninit::<Self>::zeroed();
unsafe {
crate::detail::__rust_thunk___ZN3foo3BarC1Ev(&raw mut tmp as *mut _);
tmp.assume_init()
}
}
}
pub mod bar {
#[inline(always)]
pub(crate) fn MyMethod<'__this>(__this: &'__this mut crate::foo::Bar) {
unsafe { crate::detail::__rust_thunk___ZN3foo3Bar8MyMethodEv(__this) }
}
}
}
// namespace foo
mod detail {
#[allow(unused_imports)]
use super::*;
unsafe extern "C" {
pub(crate) unsafe fn __rust_thunk___ZN3foo3BarC1Ev(__this: *mut ::core::ffi::c_void);
pub(crate) unsafe fn __rust_thunk___ZN3foo3Bar8MyMethodEv<'__this>(
__this: &'__this mut crate::foo::Bar,
);
}
}
const _: () = {
assert!(::core::mem::size_of::<crate::foo::Bar>() == 4);
assert!(::core::mem::align_of::<crate::foo::Bar>() == 4);
static_assertions::assert_impl_all!(crate::foo::Bar: Copy,Clone);
static_assertions::assert_not_impl_any!(crate::foo::Bar: Drop);
assert!(::core::mem::offset_of!(crate::foo::Bar, x) == 0);
};