Skip to content

Commit

Permalink
Merge #21
Browse files Browse the repository at this point in the history
21: Add libgc_internal crate to core library r=ltratt a=jacob-hughes



Co-authored-by: Jacob Hughes <jh@jakehughes.uk>
  • Loading branch information
bors[bot] and jacob-hughes authored Dec 24, 2020
2 parents af48320 + b944eac commit 66211d9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ version = "0.0.0"
dependencies = [
"compiler_builtins",
"core",
"libgc_internal",
"rand",
"rand_xorshift",
]
Expand Down Expand Up @@ -1719,6 +1720,15 @@ dependencies = [
"rustc-std-workspace-core",
]

[[package]]
name = "libgc_internal"
version = "0.1.0"
source = "git+https://github.com/softdevteam/libgc_internal#cbf33df99760b284fd8fbd8d00afbf35044808da"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-core",
]

[[package]]
name = "libgit2-sys"
version = "0.12.14+1.1.0"
Expand Down Expand Up @@ -4685,6 +4695,7 @@ dependencies = [
"hashbrown",
"hermit-abi",
"libc",
"libgc_internal",
"miniz_oxide",
"object",
"panic_abort",
Expand Down
1 change: 1 addition & 0 deletions library/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edition = "2018"

[dependencies]
core = { path = "../core" }
libgc_internal = { git = "https://github.com/softdevteam/libgc_internal", features = ['rustgc'] }
compiler_builtins = { version = "0.1.10", features = ['rustc-dep-of-std'] }

[dev-dependencies]
Expand Down
3 changes: 3 additions & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ extern crate std;
#[cfg(test)]
extern crate test;

#[allow(unused_extern_crates)]
extern crate libgc_internal;

// Module with internal macros used by other modules (needs to be included before other modules).
#[macro_use]
mod macros;
Expand Down
1 change: 1 addition & 0 deletions library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ crate-type = ["dylib", "rlib"]

[dependencies]
alloc = { path = "../alloc" }
libgc_internal = { git = "https://github.com/softdevteam/libgc_internal", features = ['rustgc'] }
cfg-if = { version = "0.1.8", features = ['rustc-dep-of-std'] }
panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" }
Expand Down
1 change: 1 addition & 0 deletions src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const PERMITTED_DEPENDENCIES: &[&str] = &[
"kernel32-sys",
"lazy_static",
"libc",
"libgc_internal",
"libz-sys",
"lock_api",
"log",
Expand Down
6 changes: 6 additions & 0 deletions src/tools/tidy/src/extdeps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ pub fn check(root: &Path, bad: &mut bool) {
// Extract source value.
let source = line.split_once('=').unwrap().1.trim();

// rustc only permits crates from crates.io so for now libgc_internal is
// hardcoded to pass the tidy checker.
if source.contains("softdevteam/libgc_internal") {
continue;
}

// Ensure source is allowed.
if !ALLOWED_SOURCES.contains(&&*source) {
println!("invalid source: {}", source);
Expand Down

0 comments on commit 66211d9

Please sign in to comment.