Skip to content

Commit

Permalink
Merge #37
Browse files Browse the repository at this point in the history
37: Borsify rustgc r=ltratt a=jacob-hughes

This adds test coverage for `--feature rustgc`. It can be merged once #21 lands.

Co-authored-by: Jacob Hughes <jh@jakehughes.uk>
  • Loading branch information
bors[bot] and jacob-hughes authored Dec 23, 2020
2 parents dbf5687 + 264e7cd commit 73aafc1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .buildbot.config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Config file for continuous integration.

[rust]
codegen-units = 0 # Use many compilation units.
debug-assertions = true # Turn on assertions in rustc.

[build]
docs = false
extended = false

[llvm]
assertions = true # Turn on assertions in LLVM.
use-linker = "gold" # Uses less memory than ld.

[install]
prefix = "build/rustc_boehm"
sysconfdir = "etc"
11 changes: 11 additions & 0 deletions .buildbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,14 @@ cargo check

rustup toolchain install nightly --allow-downgrade --component rustfmt
cargo +nightly fmt --all -- --check

# Build and test with rustgc
git clone https://github.com/softdevteam/rustgc
mkdir -p rustgc/build/rustgc
(cd rustgc && ./x.py build --config ../.buildbot.config.toml)

rustup toolchain link rustgc rustgc/build/x86_64-unknown-linux-gnu/stage1

cargo clean

cargo +rustgc test --features "rustgc"
4 changes: 2 additions & 2 deletions src/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ impl Gc<dyn Any> {
}
}

#[cfg(not(feature = "rustc_boehm"))]
#[cfg(not(feature = "rustgc"))]
pub fn needs_finalizer<T>() -> bool {
std::mem::needs_drop::<T>()
}

#[cfg(feature = "rustc_boehm")]
#[cfg(feature = "rustgc")]
pub fn needs_finalizer<T>() -> bool {
std::mem::needs_finalizer::<T>()
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(feature = "rustc_boehm", feature(gc))]
#![cfg_attr(feature = "rustgc", feature(gc))]
#![feature(core_intrinsics)]
#![feature(allocator_api)]
#![feature(alloc_layout_extra)]
Expand Down

0 comments on commit 73aafc1

Please sign in to comment.