Skip to content

Commit

Permalink
Removed useless cmp::{min, max} reexports from the integer modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimundi committed Nov 29, 2013
1 parent 90f9eb3 commit 0d8ace8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
25 changes: 12 additions & 13 deletions src/librustc/middle/trans/foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,31 @@


use back::{link};
use std::libc::c_uint;
use lib::llvm::{ValueRef, CallConv, StructRetAttribute};
use lib::llvm::llvm;
use lib::llvm::{ValueRef, CallConv, StructRetAttribute};
use lib;
use middle::trans::machine;
use middle::trans::base;
use middle::trans::base::push_ctxt;
use middle::trans::cabi;
use middle::trans::base;
use middle::trans::build::*;
use middle::trans::builder::noname;
use middle::trans::cabi;
use middle::trans::common::*;
use middle::trans::machine;
use middle::trans::type_::Type;
use middle::trans::type_of::*;
use middle::trans::type_of;
use middle::ty;
use middle::ty::FnSig;

use std::uint;
use middle::ty;
use std::cmp;
use std::libc::c_uint;
use std::vec;
use syntax::abi::{Cdecl, Aapcs, C, AbiSet, Win64};
use syntax::abi::{RustIntrinsic, Rust, Stdcall, Fastcall, System};
use syntax::codemap::Span;
use syntax::parse::token::special_idents;
use syntax::{ast};
use syntax::{attr, ast_map};
use syntax::parse::token::special_idents;
use syntax::abi::{RustIntrinsic, Rust, Stdcall, Fastcall, System,
Cdecl, Aapcs, C, AbiSet, Win64};
use util::ppaux::{Repr, UserString};
use middle::trans::type_::Type;

///////////////////////////////////////////////////////////////////////////
// Type definitions
Expand Down Expand Up @@ -332,7 +331,7 @@ pub fn trans_native_call(bcx: @mut Block,
let llrust_size = machine::llsize_of_store(ccx, llrust_ret_ty);
let llforeign_align = machine::llalign_of_min(ccx, llforeign_ret_ty);
let llrust_align = machine::llalign_of_min(ccx, llrust_ret_ty);
let llalign = uint::min(llforeign_align, llrust_align);
let llalign = cmp::min(llforeign_align, llrust_align);
debug!("llrust_size={:?}", llrust_size);
base::call_memcpy(bcx, llretptr_i8, llscratch_i8,
C_uint(ccx, llrust_size), llalign as u32);
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ impl<'self> Formatter<'self> {
// case where the maximum length will matter.
let char_len = s.char_len();
if char_len >= max {
let nchars = ::uint::min(max, char_len);
let nchars = ::cmp::min(max, char_len);
self.buf.write(s.slice_chars(0, nchars).as_bytes());
return
}
Expand Down
2 changes: 0 additions & 2 deletions src/libstd/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ use num::{CheckedDiv, Zero, One, strconv};
use prelude::*;
use str;

pub use cmp::{min, max};

pub static bits : uint = $bits;
pub static bytes : uint = ($bits / 8);

Expand Down
2 changes: 0 additions & 2 deletions src/libstd/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ use num::{CheckedDiv, Zero, One, strconv};
use prelude::*;
use str;

pub use cmp::{min, max};

pub static bits : uint = $bits;
pub static bytes : uint = ($bits / 8);

Expand Down
3 changes: 1 addition & 2 deletions src/libstd/rt/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use io::stdio::StdWriter;
use io::buffered::LineBufferedWriter;
use rt::crate_map::{ModEntry, CrateMap, iter_crate_map, get_crate_map};
use str::StrSlice;
use u32;
use vec::ImmutableVector;
#[cfg(test)] use cast::transmute;

Expand Down Expand Up @@ -46,7 +45,7 @@ fn parse_log_level(level: &str) -> Option<u32> {
let position = log_level_names.iter().position(|&name| name == level);
match position {
Some(position) => {
log_level = Some(u32::min(MAX_LOG_LEVEL, (position + 1) as u32))
log_level = Some(::cmp::min(MAX_LOG_LEVEL, (position + 1) as u32))
},
_ => {
log_level = None;
Expand Down

0 comments on commit 0d8ace8

Please sign in to comment.