| // 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 |
| //! This crate is used as a test input for `cc_bindings_from_rs` and the |
| //! generated C++ bindings are then tested via `default_test.cc`. |
| /// Test of an explicit impl of a trait: `impl Default for SomeStruct`. |
| pub struct SomeStruct(i32); |
| impl Clone for SomeStruct { |
| fn clone(&self) -> Self { |
| impl Copy for SomeStruct {} |
| pub fn create_struct(i: i32) -> SomeStruct { |
| pub fn extract_int(s: SomeStruct) -> i32 { |
| /// Test of a derived impl of a trait: `#[derive(Default)]`. |
| pub struct SomeStruct(i32); |
| pub fn create_struct(i: i32) -> SomeStruct { |
| pub fn extract_int(s: SomeStruct) -> i32 { |
| /// Test of a missing impl of a trait. |
| pub struct SomeStruct(i32); |