Skip to content

Add lint for variables whose names contain uppercase characters #12300

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

Merged
merged 5 commits into from
Mar 5, 2014
Merged
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
160 changes: 80 additions & 80 deletions src/compiletest/runtest.rs

Large diffs are not rendered by default.

134 changes: 67 additions & 67 deletions src/libnum/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,14 @@ impl Mul<BigUint, BigUint> for BigUint {
// (a1*b1 + a0*b0 - (a1-b0)*(b1-a0)) * base +
// a0*b0
let half_len = cmp::max(s_len, o_len) / 2;
let (sHi, sLo) = cut_at(self, half_len);
let (oHi, oLo) = cut_at(other, half_len);
let (s_hi, s_lo) = cut_at(self, half_len);
let (o_hi, o_lo) = cut_at(other, half_len);

let ll = sLo * oLo;
let hh = sHi * oHi;
let ll = s_lo * o_lo;
let hh = s_hi * o_hi;
let mm = {
let (s1, n1) = sub_sign(sHi, sLo);
let (s2, n2) = sub_sign(oHi, oLo);
let (s1, n1) = sub_sign(s_hi, s_lo);
let (s2, n2) = sub_sign(o_hi, o_lo);
match (s1, s2) {
(Equal, _) | (_, Equal) => hh + ll,
(Less, Greater) | (Greater, Less) => hh + ll + (n1 * n2),
Expand Down Expand Up @@ -1778,10 +1778,10 @@ mod biguint_tests {
#[test]
fn test_add() {
for elm in sum_triples.iter() {
let (aVec, bVec, cVec) = *elm;
let a = BigUint::from_slice(aVec);
let b = BigUint::from_slice(bVec);
let c = BigUint::from_slice(cVec);
let (a_vec, b_vec, c_vec) = *elm;
let a = BigUint::from_slice(a_vec);
let b = BigUint::from_slice(b_vec);
let c = BigUint::from_slice(c_vec);

assert!(a + b == c);
assert!(b + a == c);
Expand All @@ -1791,10 +1791,10 @@ mod biguint_tests {
#[test]
fn test_sub() {
for elm in sum_triples.iter() {
let (aVec, bVec, cVec) = *elm;
let a = BigUint::from_slice(aVec);
let b = BigUint::from_slice(bVec);
let c = BigUint::from_slice(cVec);
let (a_vec, b_vec, c_vec) = *elm;
let a = BigUint::from_slice(a_vec);
let b = BigUint::from_slice(b_vec);
let c = BigUint::from_slice(c_vec);

assert!(c - a == b);
assert!(c - b == a);
Expand Down Expand Up @@ -1842,21 +1842,21 @@ mod biguint_tests {
#[test]
fn test_mul() {
for elm in mul_triples.iter() {
let (aVec, bVec, cVec) = *elm;
let a = BigUint::from_slice(aVec);
let b = BigUint::from_slice(bVec);
let c = BigUint::from_slice(cVec);
let (a_vec, b_vec, c_vec) = *elm;
let a = BigUint::from_slice(a_vec);
let b = BigUint::from_slice(b_vec);
let c = BigUint::from_slice(c_vec);

assert!(a * b == c);
assert!(b * a == c);
}

for elm in div_rem_quadruples.iter() {
let (aVec, bVec, cVec, dVec) = *elm;
let a = BigUint::from_slice(aVec);
let b = BigUint::from_slice(bVec);
let c = BigUint::from_slice(cVec);
let d = BigUint::from_slice(dVec);
let (a_vec, b_vec, c_vec, d_vec) = *elm;
let a = BigUint::from_slice(a_vec);
let b = BigUint::from_slice(b_vec);
let c = BigUint::from_slice(c_vec);
let d = BigUint::from_slice(d_vec);

assert!(a == b * c + d);
assert!(a == c * b + d);
Expand All @@ -1866,10 +1866,10 @@ mod biguint_tests {
#[test]
fn test_div_rem() {
for elm in mul_triples.iter() {
let (aVec, bVec, cVec) = *elm;
let a = BigUint::from_slice(aVec);
let b = BigUint::from_slice(bVec);
let c = BigUint::from_slice(cVec);
let (a_vec, b_vec, c_vec) = *elm;
let a = BigUint::from_slice(a_vec);
let b = BigUint::from_slice(b_vec);
let c = BigUint::from_slice(c_vec);

if !a.is_zero() {
assert_eq!(c.div_rem(&a), (b.clone(), Zero::zero()));
Expand All @@ -1880,11 +1880,11 @@ mod biguint_tests {
}

for elm in div_rem_quadruples.iter() {
let (aVec, bVec, cVec, dVec) = *elm;
let a = BigUint::from_slice(aVec);
let b = BigUint::from_slice(bVec);
let c = BigUint::from_slice(cVec);
let d = BigUint::from_slice(dVec);
let (a_vec, b_vec, c_vec, d_vec) = *elm;
let a = BigUint::from_slice(a_vec);
let b = BigUint::from_slice(b_vec);
let c = BigUint::from_slice(c_vec);
let d = BigUint::from_slice(d_vec);

if !b.is_zero() { assert!(a.div_rem(&b) == (c, d)); }
}
Expand Down Expand Up @@ -2351,10 +2351,10 @@ mod bigint_tests {
#[test]
fn test_add() {
for elm in sum_triples.iter() {
let (aVec, bVec, cVec) = *elm;
let a = BigInt::from_slice(Plus, aVec);
let b = BigInt::from_slice(Plus, bVec);
let c = BigInt::from_slice(Plus, cVec);
let (a_vec, b_vec, c_vec) = *elm;
let a = BigInt::from_slice(Plus, a_vec);
let b = BigInt::from_slice(Plus, b_vec);
let c = BigInt::from_slice(Plus, c_vec);

assert!(a + b == c);
assert!(b + a == c);
Expand All @@ -2370,10 +2370,10 @@ mod bigint_tests {
#[test]
fn test_sub() {
for elm in sum_triples.iter() {
let (aVec, bVec, cVec) = *elm;
let a = BigInt::from_slice(Plus, aVec);
let b = BigInt::from_slice(Plus, bVec);
let c = BigInt::from_slice(Plus, cVec);
let (a_vec, b_vec, c_vec) = *elm;
let a = BigInt::from_slice(Plus, a_vec);
let b = BigInt::from_slice(Plus, b_vec);
let c = BigInt::from_slice(Plus, c_vec);

assert!(c - a == b);
assert!(c - b == a);
Expand Down Expand Up @@ -2427,10 +2427,10 @@ mod bigint_tests {
#[test]
fn test_mul() {
for elm in mul_triples.iter() {
let (aVec, bVec, cVec) = *elm;
let a = BigInt::from_slice(Plus, aVec);
let b = BigInt::from_slice(Plus, bVec);
let c = BigInt::from_slice(Plus, cVec);
let (a_vec, b_vec, c_vec) = *elm;
let a = BigInt::from_slice(Plus, a_vec);
let b = BigInt::from_slice(Plus, b_vec);
let c = BigInt::from_slice(Plus, c_vec);

assert!(a * b == c);
assert!(b * a == c);
Expand All @@ -2440,11 +2440,11 @@ mod bigint_tests {
}

for elm in div_rem_quadruples.iter() {
let (aVec, bVec, cVec, dVec) = *elm;
let a = BigInt::from_slice(Plus, aVec);
let b = BigInt::from_slice(Plus, bVec);
let c = BigInt::from_slice(Plus, cVec);
let d = BigInt::from_slice(Plus, dVec);
let (a_vec, b_vec, c_vec, d_vec) = *elm;
let a = BigInt::from_slice(Plus, a_vec);
let b = BigInt::from_slice(Plus, b_vec);
let c = BigInt::from_slice(Plus, c_vec);
let d = BigInt::from_slice(Plus, d_vec);

assert!(a == b * c + d);
assert!(a == c * b + d);
Expand Down Expand Up @@ -2479,21 +2479,21 @@ mod bigint_tests {
}

for elm in mul_triples.iter() {
let (aVec, bVec, cVec) = *elm;
let a = BigInt::from_slice(Plus, aVec);
let b = BigInt::from_slice(Plus, bVec);
let c = BigInt::from_slice(Plus, cVec);
let (a_vec, b_vec, c_vec) = *elm;
let a = BigInt::from_slice(Plus, a_vec);
let b = BigInt::from_slice(Plus, b_vec);
let c = BigInt::from_slice(Plus, c_vec);

if !a.is_zero() { check(&c, &a, &b, &Zero::zero()); }
if !b.is_zero() { check(&c, &b, &a, &Zero::zero()); }
}

for elm in div_rem_quadruples.iter() {
let (aVec, bVec, cVec, dVec) = *elm;
let a = BigInt::from_slice(Plus, aVec);
let b = BigInt::from_slice(Plus, bVec);
let c = BigInt::from_slice(Plus, cVec);
let d = BigInt::from_slice(Plus, dVec);
let (a_vec, b_vec, c_vec, d_vec) = *elm;
let a = BigInt::from_slice(Plus, a_vec);
let b = BigInt::from_slice(Plus, b_vec);
let c = BigInt::from_slice(Plus, c_vec);
let d = BigInt::from_slice(Plus, d_vec);

if !b.is_zero() {
check(&a, &b, &c, &d);
Expand Down Expand Up @@ -2522,21 +2522,21 @@ mod bigint_tests {
check_sub(&a.neg(), &b.neg(), q, &r.neg());
}
for elm in mul_triples.iter() {
let (aVec, bVec, cVec) = *elm;
let a = BigInt::from_slice(Plus, aVec);
let b = BigInt::from_slice(Plus, bVec);
let c = BigInt::from_slice(Plus, cVec);
let (a_vec, b_vec, c_vec) = *elm;
let a = BigInt::from_slice(Plus, a_vec);
let b = BigInt::from_slice(Plus, b_vec);
let c = BigInt::from_slice(Plus, c_vec);

if !a.is_zero() { check(&c, &a, &b, &Zero::zero()); }
if !b.is_zero() { check(&c, &b, &a, &Zero::zero()); }
}

for elm in div_rem_quadruples.iter() {
let (aVec, bVec, cVec, dVec) = *elm;
let a = BigInt::from_slice(Plus, aVec);
let b = BigInt::from_slice(Plus, bVec);
let c = BigInt::from_slice(Plus, cVec);
let d = BigInt::from_slice(Plus, dVec);
let (a_vec, b_vec, c_vec, d_vec) = *elm;
let a = BigInt::from_slice(Plus, a_vec);
let b = BigInt::from_slice(Plus, b_vec);
let c = BigInt::from_slice(Plus, c_vec);
let d = BigInt::from_slice(Plus, d_vec);

if !b.is_zero() {
check(&a, &b, &c, &d);
Expand Down
28 changes: 14 additions & 14 deletions src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ pub fn llvm_err(sess: Session, msg: ~str) -> ! {

pub fn WriteOutputFile(
sess: Session,
Target: lib::llvm::TargetMachineRef,
PM: lib::llvm::PassManagerRef,
M: ModuleRef,
Output: &Path,
FileType: lib::llvm::FileType) {
target: lib::llvm::TargetMachineRef,
pm: lib::llvm::PassManagerRef,
m: ModuleRef,
output: &Path,
file_type: lib::llvm::FileType) {
unsafe {
Output.with_c_str(|Output| {
output.with_c_str(|output| {
let result = llvm::LLVMRustWriteOutputFile(
Target, PM, M, Output, FileType);
target, pm, m, output, file_type);
if !result {
llvm_err(sess, ~"could not write output");
}
Expand Down Expand Up @@ -138,7 +138,7 @@ pub mod write {
})
}

let OptLevel = match sess.opts.optimize {
let opt_level = match sess.opts.optimize {
session::No => lib::llvm::CodeGenLevelNone,
session::Less => lib::llvm::CodeGenLevelLess,
session::Default => lib::llvm::CodeGenLevelDefault,
Expand All @@ -152,14 +152,14 @@ pub mod write {
(sess.targ_cfg.os == abi::OsMacos &&
sess.targ_cfg.arch == abi::X86_64);

let tm = sess.targ_cfg.target_strs.target_triple.with_c_str(|T| {
sess.opts.cg.target_cpu.with_c_str(|CPU| {
target_feature(&sess).with_c_str(|Features| {
let tm = sess.targ_cfg.target_strs.target_triple.with_c_str(|t| {
sess.opts.cg.target_cpu.with_c_str(|cpu| {
target_feature(&sess).with_c_str(|features| {
llvm::LLVMRustCreateTargetMachine(
T, CPU, Features,
t, cpu, features,
lib::llvm::CodeModelDefault,
lib::llvm::RelocPIC,
OptLevel,
opt_level,
true,
use_softfp,
no_fp_elim
Expand All @@ -185,7 +185,7 @@ pub mod write {
if !sess.opts.cg.no_prepopulate_passes {
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
populate_llvm_passes(fpm, mpm, llmod, OptLevel);
populate_llvm_passes(fpm, mpm, llmod, opt_level);
}

for pass in sess.opts.cg.passes.iter() {
Expand Down
Loading