From 0d8ace823b33489284cc60aaab3945d764ab3394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20L=C3=B6bel?= Date: Fri, 29 Nov 2013 20:19:22 +0100 Subject: [PATCH] Removed useless cmp::{min, max} reexports from the integer modules --- src/librustc/middle/trans/foreign.rs | 25 ++++++++++++------------- src/libstd/fmt/mod.rs | 2 +- src/libstd/num/int_macros.rs | 2 -- src/libstd/num/uint_macros.rs | 2 -- src/libstd/rt/logging.rs | 3 +-- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/librustc/middle/trans/foreign.rs b/src/librustc/middle/trans/foreign.rs index ac65719f02e86..2a0840a0ef8ad 100644 --- a/src/librustc/middle/trans/foreign.rs +++ b/src/librustc/middle/trans/foreign.rs @@ -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 @@ -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); diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs index 2d37d82e172c6..c74a9bc905176 100644 --- a/src/libstd/fmt/mod.rs +++ b/src/libstd/fmt/mod.rs @@ -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 } diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs index 42f0ed95d1e0f..07893087628c1 100644 --- a/src/libstd/num/int_macros.rs +++ b/src/libstd/num/int_macros.rs @@ -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); diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index 0a21aa9fcc8a8..31f1b75e02e82 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -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); diff --git a/src/libstd/rt/logging.rs b/src/libstd/rt/logging.rs index 13e18f7d9b75e..3f169b511df9a 100644 --- a/src/libstd/rt/logging.rs +++ b/src/libstd/rt/logging.rs @@ -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; @@ -46,7 +45,7 @@ fn parse_log_level(level: &str) -> Option { 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;