Skip to content

Commit fd44247

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

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/liballoc/heap.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,16 @@ 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+
#[cfg(all(not(feature = "external_funcs"),
125+
not(feature = "external_crate"),
126+
any(target_arch = "x86",
127+
target_arch = "x86_64")))]
124128
const MIN_ALIGN: uint = 16;
125129

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

0 commit comments

Comments
 (0)