Skip to content

Rollup of 9 pull requests #30544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 51 commits into from
Dec 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9bff8b0
configure: Enable -C rpath by default
alexcrichton Dec 12, 2015
b9005dd
Book: Fix link anchor in Syntax Index
floftar Dec 15, 2015
51ff171
Modify the Levenshtein-based suggestions to include imports
wafflespeanut Dec 14, 2015
86f5275
Add note when item accessed from module via `m.i` rather than `m::i`.
GuillaumeGomez Dec 10, 2015
6946995
unit test for new error help.
pnkfelix Dec 16, 2015
49dc357
doc: minor format fixes in book/error-handling
lnmx Dec 18, 2015
cb7017c
Made dynamic_lib migration path more explicit
androm3da Dec 18, 2015
04c05c7
Added doc comments for new UnresolvedNameContext enum.
pnkfelix Dec 18, 2015
aacdfb8
Update no-stdlib.md
nwin Dec 19, 2015
2b2f983
Fix GEPs for MIR indexing translation
nagisa Dec 19, 2015
e641896
remove specific code for OpenBSD that define STDCPP_LIBDIR_RUSTFLAGS
semarie Dec 19, 2015
b74359a
openbsd: use specific linker for building
semarie Dec 19, 2015
a8df425
Corrected deprecation reference to appropriate crate
androm3da Dec 20, 2015
143b9d8
Stop re-exporting the ast::BindingMode variants.
Ms2ger Dec 18, 2015
c6079d0
Auto merge of #30486 - nagisa:mir-fix-geps, r=luqmana
bors Dec 21, 2015
29e60ab
Auto merge of #30493 - semarie:openbsd-cc, r=alexcrichton
bors Dec 21, 2015
da4a21e
Auto merge of #30400 - fbergr:master, r=steveklabnik
bors Dec 21, 2015
e2834a2
Auto merge of #30413 - pnkfelix:fsk-span_note, r=Manishearth
bors Dec 21, 2015
f9a8861
unbreak openbsd code
semarie Dec 21, 2015
8cd034d
Auto merge of #30512 - semarie:openbsd-libc, r=alexcrichton
bors Dec 21, 2015
cd1848a
Register new snapshots
alexcrichton Dec 11, 2015
709d00a
Auto merge of #30460 - Ms2ger:BindingMode, r=alexcrichton
bors Dec 21, 2015
9929c24
std: Update jemalloc version
alexcrichton Dec 17, 2015
2343a92
Auto merge of #30352 - alexcrichton:new-snashots, r=nikomatsakis
bors Dec 21, 2015
5d4efcb
Auto merge of #30434 - alexcrichton:update-jemalloc, r=alexcrichton
bors Dec 21, 2015
e77ab57
Fix Universal CRT detection on weird setups
retep998 Dec 22, 2015
439e184
Auto merge of #30516 - retep998:non-universal-crt, r=alexcrichton
bors Dec 22, 2015
b67b5a8
rustc: Add feature-gated cfg(target_thread_local)
alexcrichton Dec 10, 2015
617a7af
syntax: Respect allow_internal_unstable in macros
alexcrichton Dec 16, 2015
cd74364
std: Use cfg(target_thread_local) in thread_local!
alexcrichton Dec 11, 2015
2f42ac4
std: Remove rust_builtin C support library
alexcrichton Dec 2, 2015
5178449
Auto merge of #30175 - alexcrichton:less-c-code, r=brson
bors Dec 22, 2015
00e6667
configure: test $SHELL's permission
nodakai Dec 7, 2015
42c3ef8
Auto merge of #30417 - alexcrichton:better-detect-elf-tls, r=alexcric…
bors Dec 22, 2015
65375fd
std: Remove old android header file
alexcrichton Dec 22, 2015
05780ac
Don't record the root module in the search index
mitaa Dec 21, 2015
45e52da
Auto merge of #30353 - alexcrichton:rpath-by-default, r=brson
bors Dec 23, 2015
3820150
Auto merge of #30504 - mitaa:rdoc_root, r=alexcrichton
bors Dec 23, 2015
4ce1daf
Auto merge of #30377 - Wafflespeanut:levenshtein, r=Manishearth
bors Dec 23, 2015
97547e2
doc: make line visible
tshepang Dec 23, 2015
835bc77
Minor fix to whitespace in libsyntax
erickt Dec 23, 2015
aa219d9
doc: Change Google link to generic top level domain
floftar Dec 23, 2015
8759f1f
Rollup merge of #30251 - nodakai:patch-1, r=pnkfelix
steveklabnik Dec 23, 2015
884021b
Rollup merge of #30461 - lnmx:doc-typo, r=steveklabnik
steveklabnik Dec 23, 2015
1dce223
Rollup merge of #30465 - androm3da:master, r=alexcrichton
steveklabnik Dec 23, 2015
cc27312
Rollup merge of #30473 - nwin:patch-2, r=steveklabnik
steveklabnik Dec 23, 2015
2651b4a
Rollup merge of #30529 - alexcrichton:less-c-code, r=sanxiyn
steveklabnik Dec 23, 2015
1b68a35
Rollup merge of #30537 - tshepang:make-visible, r=Gankro
steveklabnik Dec 23, 2015
2aade14
Rollup merge of #30539 - erickt:whitespace, r=sfackler
steveklabnik Dec 23, 2015
87a8f1f
Rollup merge of #30541 - fbergr:doc, r=luqmana
steveklabnik Dec 23, 2015
944b337
Rollup merge of #30543 - brson:doc, r=steveklabnik
steveklabnik Dec 23, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ are:
* Don't be afraid to ask! The Rust community is friendly and helpful.

[gdfrustc]: http://manishearth.github.io/rust-internals-docs/rustc/
[gsearchdocs]: https://www.google.de/search?q=site:doc.rust-lang.org+your+query+here
[gsearchdocs]: https://www.google.com/search?q=site:doc.rust-lang.org+your+query+here
[rif]: http://internals.rust-lang.org
[rr]: https://doc.rust-lang.org/book/README.html
[tlgba]: http://tomlee.co/2014/04/03/a-more-detailed-tour-of-the-rust-compiler/
Expand Down
21 changes: 12 additions & 9 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,18 @@ then
# if configure is running in an interactive bash shell. /usr/bin/env
# exists *everywhere*.
BIN_TO_PROBE="$SHELL"
if [ -z "$BIN_TO_PROBE" -a -e "/usr/bin/env" ]; then
BIN_TO_PROBE="/usr/bin/env"
if [ ! -r "$BIN_TO_PROBE" ]; then
if [ -r "/usr/bin/env" ]; then
BIN_TO_PROBE="/usr/bin/env"
else
warn "Cannot check if the userland is i686 or x86_64"
fi
fi
file -L "$BIN_TO_PROBE" | grep -q "x86[_-]64"
if [ $? != 0 ]; then
msg "i686 userland on x86_64 Linux kernel"
CFG_CPUTYPE=i686
fi
if [ -n "$BIN_TO_PROBE" ]; then
file -L "$BIN_TO_PROBE" | grep -q "x86[_-]64"
if [ $? != 0 ]; then
CFG_CPUTYPE=i686
fi
fi
fi


Expand Down Expand Up @@ -587,7 +590,7 @@ opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM"
opt rpath 0 "build rpaths into rustc itself"
opt rpath 1 "build rpaths into rustc itself"
opt stage0-landing-pads 1 "enable landing pads during bootstrap with stage0"
# This is used by the automation to produce single-target nightlies
opt dist-host-only 0 "only install bins for the host architecture"
Expand Down
1 change: 1 addition & 0 deletions mk/cfg/x86_64-unknown-openbsd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ CFG_LDPATH_x86_64-unknown-openbsd :=
CFG_RUN_x86_64-unknown-openbsd=$(2)
CFG_RUN_TARG_x86_64-unknown-openbsd=$(call CFG_RUN_x86_64-unknown-openbsd,,$(2))
CFG_GNU_TRIPLE_x86_64-unknown-openbsd := x86_64-unknown-openbsd
RUSTC_FLAGS_x86_64-unknown-openbsd=-C linker=$(call FIND_COMPILER,$(CC))
2 changes: 1 addition & 1 deletion mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ DEPS_rustc_bitflags := core
DEPS_rustc_unicode := core

DEPS_std := core libc rand alloc collections rustc_unicode \
native:rust_builtin native:backtrace \
native:backtrace \
alloc_system
DEPS_arena := std
DEPS_glob := std
Expand Down
6 changes: 1 addition & 5 deletions mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,7 @@ endif

ifdef CFG_ENABLE_DEBUGINFO
$(info cfg: enabling debuginfo (CFG_ENABLE_DEBUGINFO))
# FIXME: Re-enable -g in stage0 after new snapshot
#CFG_RUSTC_FLAGS += -g
RUSTFLAGS_STAGE1 += -g
RUSTFLAGS_STAGE2 += -g
RUSTFLAGS_STAGE3 += -g
CFG_RUSTC_FLAGS += -g
endif

ifdef SAVE_TEMPS
Expand Down
10 changes: 0 additions & 10 deletions mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,6 @@ define CFG_MAKE_TOOLCHAIN

ifeq ($$(findstring $(HOST_$(1)),arm aarch64 mips mipsel powerpc),)

# On OpenBSD, we need to pass the path of libstdc++.so to the linker
# (use path of libstdc++.a which is a known name for the same path)
ifeq ($(OSTYPE_$(1)),unknown-openbsd)
STDCPP_LIBDIR_RUSTFLAGS_$(1)= \
-L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
-print-file-name=lib$(CFG_STDCPP_NAME).a))"
else
STDCPP_LIBDIR_RUSTFLAGS_$(1)=
endif

# On Bitrig, we need the relocation model to be PIC for everything
ifeq (,$(filter $(OSTYPE_$(1)),bitrig))
LLVM_MC_RELOCATION_MODEL="pic"
Expand Down
27 changes: 19 additions & 8 deletions mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# that's per-target so you're allowed to conditionally add files based on the
# target.
################################################################################
NATIVE_LIBS := rust_builtin hoedown miniz rust_test_helpers
NATIVE_LIBS := hoedown miniz rust_test_helpers

# $(1) is the target triple
define NATIVE_LIBRARIES
Expand All @@ -50,8 +50,6 @@ NATIVE_DEPS_hoedown_$(1) := hoedown/src/autolink.c \
hoedown/src/stack.c \
hoedown/src/version.c
NATIVE_DEPS_miniz_$(1) = miniz.c
NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
rust_android_dummy.c
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c

################################################################################
Expand Down Expand Up @@ -128,12 +126,25 @@ define DEF_THIRD_PARTY_TARGETS

# $(1) is the target triple

ifeq ($$(CFG_WINDOWSY_$(1)), 1)
# This isn't necessarily a desired option, but it's harmless and works around
# what appears to be a mingw-w64 bug.
ifeq ($$(CFG_WINDOWSY_$(1)),1)
# A bit of history here, this used to be --enable-lazy-lock added in #14006
# which was filed with jemalloc in jemalloc/jemalloc#83 which was also
# reported to MinGW: http://sourceforge.net/p/mingw-w64/bugs/395/
#
# When updating jemalloc to 4.0, however, it was found that binaries would
# exit with the status code STATUS_RESOURCE_NOT_OWNED indicating that a thread
# was unlocking a mutex it never locked. Disabling this "lazy lock" option
# seems to fix the issue, but it was enabled by default for MinGW targets in
# 13473c7 for jemalloc.
#
# As a result of all that, force disabling lazy lock on Windows, and after
# reading some code it at least *appears* that the initialization of mutexes
# is otherwise ok in jemalloc, so shouldn't cause problems hopefully...
#
# https://sourceforge.net/p/mingw-w64/bugs/395/
JEMALLOC_ARGS_$(1) := --enable-lazy-lock
# tl;dr: make windows behave like other platforms by disabling lazy locking,
# but requires passing an option due to a historical default with
# jemalloc.
JEMALLOC_ARGS_$(1) := --disable-lazy-lock
else ifeq ($(OSTYPE_$(1)), apple-ios)
JEMALLOC_ARGS_$(1) := --disable-tls
else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
Expand Down
2 changes: 0 additions & 2 deletions mk/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
$$(RUSTFLAGS_$(4)) \
$$(RUSTFLAGS$(1)_$(4)) \
$$(RUSTFLAGS$(1)_$(4)_T_$(2)) \
$$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) \
--out-dir $$(@D) \
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \
$$<
Expand Down Expand Up @@ -130,7 +129,6 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
| $$(TBIN$(1)_T_$(2)_H_$(3))/
@$$(call E, rustc: $$@)
$$(STAGE$(1)_T_$(2)_H_$(3)) \
$$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) \
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
-o $$@ $$< --cfg $(4)

Expand Down
7 changes: 3 additions & 4 deletions mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
-L "$$(RT_OUTPUT_DIR_$(2))" \
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
$$(RUSTFLAGS_$(4)) \
$$(STDCPP_LIBDIR_RUSTFLAGS_$(2))
$$(RUSTFLAGS_$(4))

endef

Expand Down Expand Up @@ -664,9 +663,9 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
--adb-path=$(CFG_ADB) \
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3)) $$(STDCPP_LIBDIR_RUSTFLAGS_$(3))" \
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
--lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
--target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2)) $$(STDCPP_LIBDIR_RUSTFLAGS_$(2))" \
--target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
$$(CTEST_TESTARGS)

ifdef CFG_VALGRIND_RPASS
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ analysis is the only way to get at the value stored inside an `Option<T>`. This
means that you, as the programmer, must handle the case when an `Option<T>` is
`None` instead of `Some(t)`.

But wait, what about `unwrap`,which we used [`previously`](#code-unwrap-double)?
But wait, what about `unwrap`, which we used [previously](#code-unwrap-double)?
There was no case analysis there! Instead, the case analysis was put inside the
`unwrap` method for you. You could define it yourself if you want:

Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/no-stdlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ extern fn panic_fmt(args: &core::fmt::Arguments,
# fn main() {}
```

Note that there is one extra lang item here which differs from the examples
Note that there is one lang item here whose signature differs from the examples
above, `panic_fmt`. This must be defined by consumers of libcore because the
core library declares panics, but it does not define it. The `panic_fmt`
lang item is this crate's definition of panic, and it must be guaranteed to
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/syntax-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,5 @@
[Traits (Multiple Trait Bounds)]: traits.html#multiple-trait-bounds
[Traits]: traits.html
[Unsafe]: unsafe.html
[Unsized Types (`?Sized`)]: unsized-types.html#?sized
[Unsized Types (`?Sized`)]: unsized-types.html#sized
[Variable Bindings]: variable-bindings.html
2 changes: 1 addition & 1 deletion src/jemalloc
Submodule jemalloc updated 102 files
6 changes: 0 additions & 6 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@ use core::mem::{align_of_val, size_of_val};
use core::intrinsics::abort;
use core::mem;
use core::ops::Deref;
#[cfg(not(stage0))]
use core::ops::CoerceUnsized;
use core::ptr::{self, Shared};
#[cfg(not(stage0))]
use core::marker::Unsize;
use core::hash::{Hash, Hasher};
use core::{usize, isize};
Expand Down Expand Up @@ -135,8 +133,6 @@ unsafe impl<T: ?Sized + Sync + Send> Send for Arc<T> {}
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<T: ?Sized + Sync + Send> Sync for Arc<T> {}

// remove cfg after new snapshot
#[cfg(not(stage0))]
#[unstable(feature = "coerce_unsized", issue = "27732")]
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}

Expand All @@ -157,8 +153,6 @@ unsafe impl<T: ?Sized + Sync + Send> Send for Weak<T> {}
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<T: ?Sized + Sync + Send> Sync for Weak<T> {}

// remove cfg after new snapshot
#[cfg(not(stage0))]
#[unstable(feature = "coerce_unsized", issue = "27732")]
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {}

Expand Down
19 changes: 2 additions & 17 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,8 @@
//! The [`heap`](heap/index.html) module defines the low-level interface to the
//! default global allocator. It is not compatible with the libc allocator API.

// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "alloc"]
#![crate_type = "rlib"]
#![cfg_attr(stage0, staged_api)]
#![allow(unused_attributes)]
#![unstable(feature = "alloc",
reason = "this library is unlikely to be stabilized in its current \
Expand All @@ -72,19 +69,15 @@
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
#![no_std]
#![cfg_attr(not(stage0), needs_allocator)]
#![needs_allocator]

#![cfg_attr(stage0, feature(rustc_attrs))]
#![cfg_attr(stage0, feature(no_std))]
#![cfg_attr(stage0, allow(unused_attributes))]
#![feature(allocator)]
#![feature(box_syntax)]
#![feature(coerce_unsized)]
#![feature(core_intrinsics)]
#![feature(custom_attribute)]
#![feature(fundamental)]
#![feature(lang_items)]
#![feature(nonzero)]
#![feature(num_bits_bytes)]
#![feature(optin_builtin_traits)]
#![feature(placement_in_syntax)]
Expand All @@ -95,23 +88,15 @@
#![feature(unboxed_closures)]
#![feature(unique)]
#![feature(unsafe_no_drop_flag, filling_drop)]
// SNAP 1af31d4
#![allow(unused_features)]
// SNAP 1af31d4
#![allow(unused_attributes)]
#![feature(dropck_parametricity)]
#![feature(unsize)]
#![feature(drop_in_place)]
#![feature(fn_traits)]

#![cfg_attr(stage0, feature(alloc_system))]
#![cfg_attr(not(stage0), feature(needs_allocator))]
#![feature(needs_allocator)]

#![cfg_attr(test, feature(test, rustc_private, box_heap))]

#[cfg(stage0)]
extern crate alloc_system;

// Allow testing this library

#[cfg(test)]
Expand Down
6 changes: 0 additions & 6 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,9 @@ use core::fmt;
use core::hash::{Hasher, Hash};
use core::intrinsics::{assume, abort};
use core::marker;
#[cfg(not(stage0))]
use core::marker::Unsize;
use core::mem::{self, align_of_val, size_of_val, forget};
use core::ops::Deref;
#[cfg(not(stage0))]
use core::ops::CoerceUnsized;
use core::ptr::{self, Shared};
use core::convert::From;
Expand Down Expand Up @@ -196,8 +194,6 @@ impl<T: ?Sized> !marker::Send for Rc<T> {}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> !marker::Sync for Rc<T> {}

// remove cfg after new snapshot
#[cfg(not(stage0))]
#[unstable(feature = "coerce_unsized", issue = "27732")]
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Rc<U>> for Rc<T> {}

Expand Down Expand Up @@ -723,8 +719,6 @@ impl<T: ?Sized> !marker::Send for Weak<T> {}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> !marker::Sync for Weak<T> {}

// remove cfg after new snapshot
#[cfg(not(stage0))]
#[unstable(feature = "coerce_unsized", issue = "27732")]
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {}

Expand Down
17 changes: 12 additions & 5 deletions src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "alloc_jemalloc"]
#![crate_type = "rlib"]
#![cfg_attr(stage0, staged_api)]
#![no_std]
#![cfg_attr(not(stage0), allocator)]
#![cfg_attr(stage0, allow(improper_ctypes))]
#![allocator]
#![unstable(feature = "alloc_jemalloc",
reason = "this library is unlikely to be stabilized in its current \
form or name",
issue = "27783")]
#![feature(allocator)]
#![feature(libc)]
#![feature(staged_api)]
#![cfg_attr(stage0, feature(no_std))]

extern crate libc;

Expand Down Expand Up @@ -112,3 +108,14 @@ pub extern "C" fn __rust_usable_size(size: usize, align: usize) -> usize {
let flags = align_to_flags(align);
unsafe { je_nallocx(size as size_t, flags) as usize }
}

// These symbols are used by jemalloc on android but the really old android
// we're building on doesn't have them defined, so just make sure the symbols
// are available.
#[no_mangle]
#[cfg(target_os = "android")]
pub extern fn pthread_atfork(_prefork: *mut u8,
_postfork_parent: *mut u8,
_postfork_child: *mut u8) -> i32 {
0
}
6 changes: 1 addition & 5 deletions src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "alloc_system"]
#![crate_type = "rlib"]
#![cfg_attr(stage0, staged_api)]
#![no_std]
#![cfg_attr(not(stage0), allocator)]
#![cfg_attr(stage0, allow(improper_ctypes))]
#![allocator]
#![unstable(feature = "alloc_system",
reason = "this library is unlikely to be stabilized in its current \
form or name",
issue = "27783")]
#![feature(allocator)]
#![feature(libc)]
#![feature(staged_api)]
#![cfg_attr(stage0, feature(no_std))]

extern crate libc;

Expand Down
Loading