Skip to content

Remove the #[merge] attribute #6722

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 18 additions & 28 deletions src/libstd/core.rc
Original file line number Diff line number Diff line change
Expand Up @@ -88,34 +88,24 @@ pub mod prelude;

/* Primitive types */

#[path = "num/int-template.rs"] #[merge = "num/int-template/int.rs"]
pub mod int;
#[path = "num/int-template.rs"] #[merge = "num/int-template/i8.rs"]
pub mod i8;
#[path = "num/int-template.rs"] #[merge = "num/int-template/i16.rs"]
pub mod i16;
#[path = "num/int-template.rs"] #[merge = "num/int-template/i32.rs"]
pub mod i32;
#[path = "num/int-template.rs"] #[merge = "num/int-template/i64.rs"]
pub mod i64;
#[path = "num/uint-template.rs"] #[merge = "num/uint-template/uint.rs"]
pub mod uint;

#[path = "num/uint-template.rs"] #[merge = "num/uint-template/u8.rs"]
pub mod u8;
#[path = "num/uint-template.rs"] #[merge = "num/uint-template/u16.rs"]
pub mod u16;
#[path = "num/uint-template.rs"] #[merge = "num/uint-template/u32.rs"]
pub mod u32;
#[path = "num/uint-template.rs"] #[merge = "num/uint-template/u64.rs"]
pub mod u64;

#[path = "num/float.rs"]
pub mod float;
#[path = "num/f32.rs"]
pub mod f32;
#[path = "num/f64.rs"]
pub mod f64;
#[path = "num/int_macros.rs"] mod int_macros;
#[path = "num/uint_macros.rs"] mod uint_macros;

#[path = "num/int.rs"] pub mod int;
#[path = "num/i8.rs"] pub mod i8;
#[path = "num/i16.rs"] pub mod i16;
#[path = "num/i32.rs"] pub mod i32;
#[path = "num/i64.rs"] pub mod i64;

#[path = "num/uint.rs"] pub mod uint;
#[path = "num/u8.rs"] pub mod u8;
#[path = "num/u16.rs"] pub mod u16;
#[path = "num/u32.rs"] pub mod u32;
#[path = "num/u64.rs"] pub mod u64;

#[path = "num/float.rs"] pub mod float;
#[path = "num/f32.rs"] pub mod f32;
#[path = "num/f64.rs"] pub mod f64;

pub mod nil;
pub mod bool;
Expand Down
32 changes: 32 additions & 0 deletions src/libstd/num/i16.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Operations and constants for `i16`

use num::BitCount;
use unstable::intrinsics;

pub use self::generated::*;

int_module!(i16, 16)

impl BitCount for i16 {
/// Counts the number of bits set. Wraps LLVM's `ctpop` intrinsic.
#[inline(always)]
fn population_count(&self) -> i16 { unsafe { intrinsics::ctpop16(*self) } }

/// Counts the number of leading zeros. Wraps LLVM's `ctlz` intrinsic.
#[inline(always)]
fn leading_zeros(&self) -> i16 { unsafe { intrinsics::ctlz16(*self) } }

/// Counts the number of trailing zeros. Wraps LLVM's `cttz` intrinsic.
#[inline(always)]
fn trailing_zeros(&self) -> i16 { unsafe { intrinsics::cttz16(*self) } }
}
32 changes: 32 additions & 0 deletions src/libstd/num/i32.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Operations and constants for `i32`

use num::BitCount;
use unstable::intrinsics;

pub use self::generated::*;

int_module!(i32, 32)

impl BitCount for i32 {
/// Counts the number of bits set. Wraps LLVM's `ctpop` intrinsic.
#[inline(always)]
fn population_count(&self) -> i32 { unsafe { intrinsics::ctpop32(*self) } }

/// Counts the number of leading zeros. Wraps LLVM's `ctlz` intrinsic.
#[inline(always)]
fn leading_zeros(&self) -> i32 { unsafe { intrinsics::ctlz32(*self) } }

/// Counts the number of trailing zeros. Wraps LLVM's `cttz` intrinsic.
#[inline(always)]
fn trailing_zeros(&self) -> i32 { unsafe { intrinsics::cttz32(*self) } }
}
32 changes: 32 additions & 0 deletions src/libstd/num/i64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Operations and constants for `i64`

use num::BitCount;
use unstable::intrinsics;

pub use self::generated::*;

int_module!(i64, 64)

impl BitCount for i64 {
/// Counts the number of bits set. Wraps LLVM's `ctpop` intrinsic.
#[inline(always)]
fn population_count(&self) -> i64 { unsafe { intrinsics::ctpop64(*self) } }

/// Counts the number of leading zeros. Wraps LLVM's `ctlz` intrinsic.
#[inline(always)]
fn leading_zeros(&self) -> i64 { unsafe { intrinsics::ctlz64(*self) } }

/// Counts the number of trailing zeros. Wraps LLVM's `cttz` intrinsic.
#[inline(always)]
fn trailing_zeros(&self) -> i64 { unsafe { intrinsics::cttz64(*self) } }
}
32 changes: 32 additions & 0 deletions src/libstd/num/i8.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Operations and constants for `i8`

use num::BitCount;
use unstable::intrinsics;

pub use self::generated::*;

int_module!(i8, 8)

impl BitCount for i8 {
/// Counts the number of bits set. Wraps LLVM's `ctpop` intrinsic.
#[inline(always)]
fn population_count(&self) -> i8 { unsafe { intrinsics::ctpop8(*self) } }

/// Counts the number of leading zeros. Wraps LLVM's `ctlz` intrinsic.
#[inline(always)]
fn leading_zeros(&self) -> i8 { unsafe { intrinsics::ctlz8(*self) } }

/// Counts the number of trailing zeros. Wraps LLVM's `cttz` intrinsic.
#[inline(always)]
fn trailing_zeros(&self) -> i8 { unsafe { intrinsics::cttz8(*self) } }
}
41 changes: 0 additions & 41 deletions src/libstd/num/int-template/i16.rs

This file was deleted.

41 changes: 0 additions & 41 deletions src/libstd/num/int-template/i32.rs

This file was deleted.

41 changes: 0 additions & 41 deletions src/libstd/num/int-template/i64.rs

This file was deleted.

41 changes: 0 additions & 41 deletions src/libstd/num/int-template/i8.rs

This file was deleted.

Loading