]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/allocator-dylib-is-system.rs
Auto merge of #31052 - bluss:split-at-mut-str, r=alexcrichton
[rust.git] / src / test / compile-fail / allocator-dylib-is-system.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // ignore-windows everything is the system allocator on windows
12 // ignore-musl no dylibs on musl yet
13 // ignore-bitrig no jemalloc on bitrig
14 // ignore-openbsd no jemalloc on openbsd
15 // aux-build:allocator-dylib.rs
16 // no-prefer-dynamic
17 // error-pattern: cannot link together two allocators
18
19 // Verify that the allocator for statically linked dynamic libraries is the
20 // system allocator. Do this by linking in jemalloc and making sure that we get
21 // an error.
22
23 #![feature(alloc_jemalloc)]
24
25 extern crate allocator_dylib;
26 extern crate alloc_jemalloc;
27
28 fn main() {
29     allocator_dylib::foo();
30 }