Skip to content

Commit 1e9ffb8

Browse files
committed
Merge github.com:rust-lang/rust
2 parents 112463a + 241a9d0 commit 1e9ffb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1689
-932
lines changed

mk/rt.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
157157
# If the test suite passes, however, without symbol prefixes then we should be
158158
# good to go!
159159
JEMALLOC_ARGS_$(1) := --disable-tls --with-jemalloc-prefix=je_
160+
else ifeq ($(findstring dragonfly, $(OSTYPE_$(1))), dragonfly)
161+
JEMALLOC_ARGS_$(1) := --with-jemalloc-prefix=je_
160162
endif
161163

162164
ifdef CFG_ENABLE_DEBUG_JEMALLOC

src/liballoc_jemalloc/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ fn main() {
8686
// should be good to go!
8787
cmd.arg("--with-jemalloc-prefix=je_");
8888
cmd.arg("--disable-tls");
89+
} else if target.contains("dragonfly") {
90+
cmd.arg("--with-jemalloc-prefix=je_");
8991
}
9092

9193
if cfg!(feature = "debug-jemalloc") {

src/liballoc_jemalloc/lib.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,27 @@ use libc::{c_int, c_void, size_t};
4242
extern {}
4343

4444
// Note that the symbols here are prefixed by default on OSX (we don't
45-
// explicitly request it), and on Android we explicitly request it as
46-
// unprefixing cause segfaults (mismatches in allocators).
45+
// explicitly request it), and on Android and DragonFly we explicitly request
46+
// it as unprefixing cause segfaults (mismatches in allocators).
4747
extern {
48-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
48+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
49+
target_os = "dragonfly"),
4950
link_name = "je_mallocx")]
5051
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
51-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
52+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
53+
target_os = "dragonfly"),
5254
link_name = "je_rallocx")]
5355
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
54-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
56+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
57+
target_os = "dragonfly"),
5558
link_name = "je_xallocx")]
5659
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
57-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
60+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
61+
target_os = "dragonfly"),
5862
link_name = "je_sdallocx")]
5963
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
60-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
64+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
65+
target_os = "dragonfly"),
6166
link_name = "je_nallocx")]
6267
fn nallocx(size: size_t, flags: c_int) -> size_t;
6368
}

src/librustc/infer/combine.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use super::equate::Equate;
3737
use super::glb::Glb;
3838
use super::lub::Lub;
3939
use super::sub::Sub;
40-
use super::{InferCtxt};
40+
use super::InferCtxt;
4141
use super::{MiscVariable, TypeTrace};
4242
use super::type_variable::{RelationDir, BiTo, EqTo, SubtypeOf, SupertypeOf};
4343

@@ -46,6 +46,7 @@ use ty::{self, Ty, TyCtxt};
4646
use ty::error::TypeError;
4747
use ty::fold::{TypeFolder, TypeFoldable};
4848
use ty::relate::{Relate, RelateResult, TypeRelation};
49+
use traits::PredicateObligations;
4950

5051
use syntax::ast;
5152
use syntax::codemap::Span;
@@ -56,6 +57,7 @@ pub struct CombineFields<'a, 'tcx: 'a> {
5657
pub a_is_expected: bool,
5758
pub trace: TypeTrace<'tcx>,
5859
pub cause: Option<ty::relate::Cause>,
60+
pub obligations: PredicateObligations<'tcx>,
5961
}
6062

6163
pub fn super_combine_tys<'a,'tcx:'a,R>(infcx: &InferCtxt<'a, 'tcx>,

src/librustc/infer/equate.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use super::type_variable::{EqTo};
1616
use ty::{self, Ty, TyCtxt};
1717
use ty::TyVar;
1818
use ty::relate::{Relate, RelateResult, TypeRelation};
19+
use traits::PredicateObligations;
1920

2021
/// Ensures `a` is made equal to `b`. Returns `a` on success.
2122
pub struct Equate<'a, 'tcx: 'a> {
@@ -26,6 +27,10 @@ impl<'a, 'tcx> Equate<'a, 'tcx> {
2627
pub fn new(fields: CombineFields<'a, 'tcx>) -> Equate<'a, 'tcx> {
2728
Equate { fields: fields }
2829
}
30+
31+
pub fn obligations(self) -> PredicateObligations<'tcx> {
32+
self.fields.obligations
33+
}
2934
}
3035

3136
impl<'a, 'tcx> TypeRelation<'a,'tcx> for Equate<'a, 'tcx> {

src/librustc/infer/glb.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use super::Subtype;
1616

1717
use ty::{self, Ty, TyCtxt};
1818
use ty::relate::{Relate, RelateResult, TypeRelation};
19+
use traits::PredicateObligations;
1920

2021
/// "Greatest lower bound" (common subtype)
2122
pub struct Glb<'a, 'tcx: 'a> {
@@ -26,6 +27,10 @@ impl<'a, 'tcx> Glb<'a, 'tcx> {
2627
pub fn new(fields: CombineFields<'a, 'tcx>) -> Glb<'a, 'tcx> {
2728
Glb { fields: fields }
2829
}
30+
31+
pub fn obligations(self) -> PredicateObligations<'tcx> {
32+
self.fields.obligations
33+
}
2934
}
3035

3136
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Glb<'a, 'tcx> {

src/librustc/infer/lub.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use super::Subtype;
1616

1717
use ty::{self, Ty, TyCtxt};
1818
use ty::relate::{Relate, RelateResult, TypeRelation};
19+
use traits::PredicateObligations;
1920

2021
/// "Least upper bound" (common supertype)
2122
pub struct Lub<'a, 'tcx: 'a> {
@@ -26,6 +27,10 @@ impl<'a, 'tcx> Lub<'a, 'tcx> {
2627
pub fn new(fields: CombineFields<'a, 'tcx>) -> Lub<'a, 'tcx> {
2728
Lub { fields: fields }
2829
}
30+
31+
pub fn obligations(self) -> PredicateObligations<'tcx> {
32+
self.fields.obligations
33+
}
2934
}
3035

3136
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Lub<'a, 'tcx> {

0 commit comments

Comments
 (0)