From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- servo/tests/unit/malloc_size_of/Cargo.toml | 13 ++++ servo/tests/unit/malloc_size_of/lib.rs | 105 +++++++++++++++++++++++++++++ 2 files changed, 118 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..1280d0a8f2 --- /dev/null +++ b/servo/tests/unit/malloc_size_of/lib.rs @@ -0,0 +1,105 @@ +/* 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