From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- servo/tests/unit/malloc_size_of/Cargo.toml | 13 ++++ servo/tests/unit/malloc_size_of/lib.rs | 109 +++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 servo/tests/unit/malloc_size_of/Cargo.toml create mode 100644 servo/tests/unit/malloc_size_of/lib.rs (limited to 'servo/tests/unit/malloc_size_of') diff --git a/servo/tests/unit/malloc_size_of/Cargo.toml b/servo/tests/unit/malloc_size_of/Cargo.toml new file mode 100644 index 0000000000..80668d5ba6 --- /dev/null +++ b/servo/tests/unit/malloc_size_of/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "malloc_size_of_tests" +version = "0.0.1" +authors = ["The Servo Project Developers"] +license = "MPL-2.0" + +[lib] +path = "lib.rs" +test = false + +[dependencies] +malloc_size_of = {path = "../../../components/malloc_size_of"} +servo_arc = {path = "../../../components/servo_arc"} diff --git a/servo/tests/unit/malloc_size_of/lib.rs b/servo/tests/unit/malloc_size_of/lib.rs new file mode 100644 index 0000000000..75ad4d9413 --- /dev/null +++ b/servo/tests/unit/malloc_size_of/lib.rs @@ -0,0 +1,109 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +/** +``` +extern crate malloc_size_of; +extern crate servo_arc; + +fn sizeable() {} +fn shallow_sizeable() {} +fn cloneable() {} + +fn main() { + cloneable::>(); + cloneable::>(); + cloneable::>(); +} +``` +*/ +pub fn imports_ok() {} + +pub mod does_not_impl_malloc_size_of { + /** + ```compile_fail,E0277 + extern crate malloc_size_of; + extern crate servo_arc; + + fn sizeable() {} + + fn main() { + sizeable::>(); + } + ``` + */ + pub fn servo_arc() {} + + + /** + ```compile_fail,E0277 + extern crate malloc_size_of; + + fn sizeable() {} + + fn main() { + sizeable::>(); + } + ``` + */ + pub fn std_arc() {} + + + /** + ```compile_fail,E0277 + extern crate malloc_size_of; + + fn sizeable() {} + + fn main() { + sizeable::>(); + } + ``` + */ + pub fn rc() {} +} + +pub mod does_not_impl_malloc_shallow_size_of { + /** + ```compile_fail,E0277 + extern crate malloc_size_of; + extern crate servo_arc; + + fn shallow_sizeable() {} + + fn main() { + shallow_sizeable::>(); + } + ``` + */ + pub fn servo_arc() {} + + + /** + ```compile_fail,E0277 + extern crate malloc_size_of; + + fn shallow_sizeable() {} + + fn main() { + shallow_sizeable::>(); + } + ``` + */ + pub fn std_arc() {} + + + /** + ```compile_fail,E0277 + extern crate malloc_size_of; + + fn shallow_sizeable() {} + + fn main() { + shallow_sizeable::>(); + } + ``` + */ + pub fn rc() {} +} -- cgit v1.2.3