mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
Replace compiletest suite by doc-tests with compile_fail
compiletest-rs use internal rustc APIs and is broken in today’s Nightly. rustdoc however is maintained with rustc and so much less fragile.
This commit is contained in:
parent
d96f0ff6a7
commit
b1ce298d4b
18 changed files with 266 additions and 239 deletions
13
tests/unit/malloc_size_of/Cargo.toml
Normal file
13
tests/unit/malloc_size_of/Cargo.toml
Normal file
|
@ -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"}
|
109
tests/unit/malloc_size_of/lib.rs
Normal file
109
tests/unit/malloc_size_of/lib.rs
Normal file
|
@ -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 http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
```
|
||||
extern crate malloc_size_of;
|
||||
extern crate servo_arc;
|
||||
|
||||
fn sizeable<T: malloc_size_of::MallocSizeOf>() {}
|
||||
fn shallow_sizeable<T: malloc_size_of::MallocShallowSizeOf>() {}
|
||||
fn cloneable<T: Clone>() {}
|
||||
|
||||
fn main() {
|
||||
cloneable::<servo_arc::Arc<i32>>();
|
||||
cloneable::<std::sync::Arc<i32>>();
|
||||
cloneable::<std::rc::Rc<i32>>();
|
||||
}
|
||||
```
|
||||
*/
|
||||
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<T: malloc_size_of::MallocSizeOf>() {}
|
||||
|
||||
fn main() {
|
||||
sizeable::<servo_arc::Arc<i32>>();
|
||||
}
|
||||
```
|
||||
*/
|
||||
pub fn servo_arc() {}
|
||||
|
||||
|
||||
/**
|
||||
```compile_fail,E0277
|
||||
extern crate malloc_size_of;
|
||||
|
||||
fn sizeable<T: malloc_size_of::MallocSizeOf>() {}
|
||||
|
||||
fn main() {
|
||||
sizeable::<std::sync::Arc<i32>>();
|
||||
}
|
||||
```
|
||||
*/
|
||||
pub fn std_arc() {}
|
||||
|
||||
|
||||
/**
|
||||
```compile_fail,E0277
|
||||
extern crate malloc_size_of;
|
||||
|
||||
fn sizeable<T: malloc_size_of::MallocSizeOf>() {}
|
||||
|
||||
fn main() {
|
||||
sizeable::<std::rc::Rc<i32>>();
|
||||
}
|
||||
```
|
||||
*/
|
||||
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<T: malloc_size_of::MallocShallowSizeOf>() {}
|
||||
|
||||
fn main() {
|
||||
shallow_sizeable::<servo_arc::Arc<i32>>();
|
||||
}
|
||||
```
|
||||
*/
|
||||
pub fn servo_arc() {}
|
||||
|
||||
|
||||
/**
|
||||
```compile_fail,E0277
|
||||
extern crate malloc_size_of;
|
||||
|
||||
fn shallow_sizeable<T: malloc_size_of::MallocShallowSizeOf>() {}
|
||||
|
||||
fn main() {
|
||||
shallow_sizeable::<std::sync::Arc<i32>>();
|
||||
}
|
||||
```
|
||||
*/
|
||||
pub fn std_arc() {}
|
||||
|
||||
|
||||
/**
|
||||
```compile_fail,E0277
|
||||
extern crate malloc_size_of;
|
||||
|
||||
fn shallow_sizeable<T: malloc_size_of::MallocShallowSizeOf>() {}
|
||||
|
||||
fn main() {
|
||||
shallow_sizeable::<std::rc::Rc<i32>>();
|
||||
}
|
||||
```
|
||||
*/
|
||||
pub fn rc() {}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue