Skip to content

Commit b1b4bc9

Browse files
committed
Fix warning in liballoc about unused constant MIN_ALIGN when cfg(feature = external_*)
1 parent ea9d5c9 commit b1b4bc9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/liballoc/heap.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,17 @@ unsafe fn exchange_free(ptr: *mut u8, old_size: uint, align: uint) {
115115
// The minimum alignment guaranteed by the architecture. This value is used to
116116
// add fast paths for low alignment values. In practice, the alignment is a
117117
// constant at the call site and the branch will be optimized out.
118-
#[cfg(any(target_arch = "arm",
119-
target_arch = "mips",
120-
target_arch = "mipsel"))]
118+
#[cfg(all(not(feature = "external_funcs"),
119+
not(feature = "external_crate"),
120+
any(target_arch = "arm",
121+
target_arch = "mips",
122+
target_arch = "mipsel")))]
121123
const MIN_ALIGN: uint = 8;
122-
#[cfg(any(target_arch = "x86",
123-
target_arch = "x86_64",
124-
target_arch = "aarch64"))]
124+
#[cfg(all(not(feature = "external_funcs"),
125+
not(feature = "external_crate"),
126+
any(target_arch = "x86",
127+
target_arch = "x86_64",
128+
target_arch = "aarch64"))]
125129
const MIN_ALIGN: uint = 16;
126130

127131
#[cfg(feature = "external_funcs")]

0 commit comments

Comments
 (0)