Skip to content

Commit ae81c89

Browse files
committed
auto merge of #17742 : alexcrichton/rust/rollup, r=alexcrichton
Trying to get a couple of these into the next snapshot.
2 parents 9a2286d + 39f4bf7 commit ae81c89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+718
-260
lines changed

.travis.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
# downloads a rust/cargo snapshot, which we don't really want for building rust.
44
language: c
55

6-
# Make sure we've got an up-to-date g++ compiler to get past the LLVM configure
7-
# script.
8-
install:
9-
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
10-
- sudo apt-get update -qq
11-
- sudo apt-get install g++-4.7
12-
136
# The test suite is in general way too stressful for travis, especially in
147
# terms of time limit and reliability. In the past we've tried to scale things
158
# back to only build the stage1 compiler and run a subset of tests, but this
@@ -18,7 +11,7 @@ install:
1811
# As a result, we're just using travis to run `make tidy` now. It'll help
1912
# everyone find out about their trailing spaces early on!
2013
before_script:
21-
- ./configure
14+
- ./configure --llvm-root=path/to/nowhere
2215
script:
2316
- make tidy
2417

src/doc/reference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ struct BitsNStrings<'a> {
14121412
mystring: &'a str
14131413
}
14141414
1415-
static bits_n_strings: BitsNStrings<'static> = BitsNStrings {
1415+
static BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
14161416
mybits: BITS,
14171417
mystring: STRING
14181418
};

src/libnum/bigint.rs

+33-30
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ pub mod BigDigit {
8686
use super::DoubleBigDigit;
8787

8888
// `DoubleBigDigit` size dependent
89+
#[allow(non_uppercase_statics)]
8990
pub static bits: uint = 32;
9091

92+
#[allow(non_uppercase_statics)]
9193
pub static base: DoubleBigDigit = 1 << bits;
94+
#[allow(non_uppercase_statics)]
9295
static lo_mask: DoubleBigDigit = (-1 as DoubleBigDigit) >> bits;
9396

9497
#[inline]
@@ -1841,7 +1844,7 @@ mod biguint_tests {
18411844
BigInt::from_biguint(Plus, BigUint::new(vec!(1,2,3))));
18421845
}
18431846

1844-
static sum_triples: &'static [(&'static [BigDigit],
1847+
static SUM_TRIPLES: &'static [(&'static [BigDigit],
18451848
&'static [BigDigit],
18461849
&'static [BigDigit])] = &[
18471850
(&[], &[], &[]),
@@ -1857,7 +1860,7 @@ mod biguint_tests {
18571860

18581861
#[test]
18591862
fn test_add() {
1860-
for elm in sum_triples.iter() {
1863+
for elm in SUM_TRIPLES.iter() {
18611864
let (a_vec, b_vec, c_vec) = *elm;
18621865
let a = BigUint::from_slice(a_vec);
18631866
let b = BigUint::from_slice(b_vec);
@@ -1870,7 +1873,7 @@ mod biguint_tests {
18701873

18711874
#[test]
18721875
fn test_sub() {
1873-
for elm in sum_triples.iter() {
1876+
for elm in SUM_TRIPLES.iter() {
18741877
let (a_vec, b_vec, c_vec) = *elm;
18751878
let a = BigUint::from_slice(a_vec);
18761879
let b = BigUint::from_slice(b_vec);
@@ -1888,7 +1891,7 @@ mod biguint_tests {
18881891
a - b;
18891892
}
18901893

1891-
static mul_triples: &'static [(&'static [BigDigit],
1894+
static MUL_TRIPLES: &'static [(&'static [BigDigit],
18921895
&'static [BigDigit],
18931896
&'static [BigDigit])] = &[
18941897
(&[], &[], &[]),
@@ -1914,7 +1917,7 @@ mod biguint_tests {
19141917
(&[ 0, 0, 1], &[ 0, 0, 0, 1], &[0, 0, 0, 0, 0, 1])
19151918
];
19161919

1917-
static div_rem_quadruples: &'static [(&'static [BigDigit],
1920+
static DIV_REM_QUADRUPLES: &'static [(&'static [BigDigit],
19181921
&'static [BigDigit],
19191922
&'static [BigDigit],
19201923
&'static [BigDigit])]
@@ -1928,7 +1931,7 @@ mod biguint_tests {
19281931

19291932
#[test]
19301933
fn test_mul() {
1931-
for elm in mul_triples.iter() {
1934+
for elm in MUL_TRIPLES.iter() {
19321935
let (a_vec, b_vec, c_vec) = *elm;
19331936
let a = BigUint::from_slice(a_vec);
19341937
let b = BigUint::from_slice(b_vec);
@@ -1938,7 +1941,7 @@ mod biguint_tests {
19381941
assert!(b * a == c);
19391942
}
19401943

1941-
for elm in div_rem_quadruples.iter() {
1944+
for elm in DIV_REM_QUADRUPLES.iter() {
19421945
let (a_vec, b_vec, c_vec, d_vec) = *elm;
19431946
let a = BigUint::from_slice(a_vec);
19441947
let b = BigUint::from_slice(b_vec);
@@ -1952,7 +1955,7 @@ mod biguint_tests {
19521955

19531956
#[test]
19541957
fn test_div_rem() {
1955-
for elm in mul_triples.iter() {
1958+
for elm in MUL_TRIPLES.iter() {
19561959
let (a_vec, b_vec, c_vec) = *elm;
19571960
let a = BigUint::from_slice(a_vec);
19581961
let b = BigUint::from_slice(b_vec);
@@ -1966,7 +1969,7 @@ mod biguint_tests {
19661969
}
19671970
}
19681971

1969-
for elm in div_rem_quadruples.iter() {
1972+
for elm in DIV_REM_QUADRUPLES.iter() {
19701973
let (a_vec, b_vec, c_vec, d_vec) = *elm;
19711974
let a = BigUint::from_slice(a_vec);
19721975
let b = BigUint::from_slice(b_vec);
@@ -1979,7 +1982,7 @@ mod biguint_tests {
19791982

19801983
#[test]
19811984
fn test_checked_add() {
1982-
for elm in sum_triples.iter() {
1985+
for elm in SUM_TRIPLES.iter() {
19831986
let (a_vec, b_vec, c_vec) = *elm;
19841987
let a = BigUint::from_slice(a_vec);
19851988
let b = BigUint::from_slice(b_vec);
@@ -1992,7 +1995,7 @@ mod biguint_tests {
19921995

19931996
#[test]
19941997
fn test_checked_sub() {
1995-
for elm in sum_triples.iter() {
1998+
for elm in SUM_TRIPLES.iter() {
19961999
let (a_vec, b_vec, c_vec) = *elm;
19972000
let a = BigUint::from_slice(a_vec);
19982001
let b = BigUint::from_slice(b_vec);
@@ -2012,7 +2015,7 @@ mod biguint_tests {
20122015

20132016
#[test]
20142017
fn test_checked_mul() {
2015-
for elm in mul_triples.iter() {
2018+
for elm in MUL_TRIPLES.iter() {
20162019
let (a_vec, b_vec, c_vec) = *elm;
20172020
let a = BigUint::from_slice(a_vec);
20182021
let b = BigUint::from_slice(b_vec);
@@ -2022,7 +2025,7 @@ mod biguint_tests {
20222025
assert!(b.checked_mul(&a).unwrap() == c);
20232026
}
20242027

2025-
for elm in div_rem_quadruples.iter() {
2028+
for elm in DIV_REM_QUADRUPLES.iter() {
20262029
let (a_vec, b_vec, c_vec, d_vec) = *elm;
20272030
let a = BigUint::from_slice(a_vec);
20282031
let b = BigUint::from_slice(b_vec);
@@ -2036,7 +2039,7 @@ mod biguint_tests {
20362039

20372040
#[test]
20382041
fn test_checked_div() {
2039-
for elm in mul_triples.iter() {
2042+
for elm in MUL_TRIPLES.iter() {
20402043
let (a_vec, b_vec, c_vec) = *elm;
20412044
let a = BigUint::from_slice(a_vec);
20422045
let b = BigUint::from_slice(b_vec);
@@ -2440,7 +2443,7 @@ mod bigint_tests {
24402443
assert_eq!(negative.to_biguint(), None);
24412444
}
24422445

2443-
static sum_triples: &'static [(&'static [BigDigit],
2446+
static SUM_TRIPLES: &'static [(&'static [BigDigit],
24442447
&'static [BigDigit],
24452448
&'static [BigDigit])] = &[
24462449
(&[], &[], &[]),
@@ -2456,7 +2459,7 @@ mod bigint_tests {
24562459

24572460
#[test]
24582461
fn test_add() {
2459-
for elm in sum_triples.iter() {
2462+
for elm in SUM_TRIPLES.iter() {
24602463
let (a_vec, b_vec, c_vec) = *elm;
24612464
let a = BigInt::from_slice(Plus, a_vec);
24622465
let b = BigInt::from_slice(Plus, b_vec);
@@ -2475,7 +2478,7 @@ mod bigint_tests {
24752478

24762479
#[test]
24772480
fn test_sub() {
2478-
for elm in sum_triples.iter() {
2481+
for elm in SUM_TRIPLES.iter() {
24792482
let (a_vec, b_vec, c_vec) = *elm;
24802483
let a = BigInt::from_slice(Plus, a_vec);
24812484
let b = BigInt::from_slice(Plus, b_vec);
@@ -2492,7 +2495,7 @@ mod bigint_tests {
24922495
}
24932496
}
24942497

2495-
static mul_triples: &'static [(&'static [BigDigit],
2498+
static MUL_TRIPLES: &'static [(&'static [BigDigit],
24962499
&'static [BigDigit],
24972500
&'static [BigDigit])] = &[
24982501
(&[], &[], &[]),
@@ -2518,7 +2521,7 @@ mod bigint_tests {
25182521
(&[ 0, 0, 1], &[ 0, 0, 0, 1], &[0, 0, 0, 0, 0, 1])
25192522
];
25202523

2521-
static div_rem_quadruples: &'static [(&'static [BigDigit],
2524+
static DIV_REM_QUADRUPLES: &'static [(&'static [BigDigit],
25222525
&'static [BigDigit],
25232526
&'static [BigDigit],
25242527
&'static [BigDigit])]
@@ -2532,7 +2535,7 @@ mod bigint_tests {
25322535

25332536
#[test]
25342537
fn test_mul() {
2535-
for elm in mul_triples.iter() {
2538+
for elm in MUL_TRIPLES.iter() {
25362539
let (a_vec, b_vec, c_vec) = *elm;
25372540
let a = BigInt::from_slice(Plus, a_vec);
25382541
let b = BigInt::from_slice(Plus, b_vec);
@@ -2545,7 +2548,7 @@ mod bigint_tests {
25452548
assert!((-b) * a == -c);
25462549
}
25472550

2548-
for elm in div_rem_quadruples.iter() {
2551+
for elm in DIV_REM_QUADRUPLES.iter() {
25492552
let (a_vec, b_vec, c_vec, d_vec) = *elm;
25502553
let a = BigInt::from_slice(Plus, a_vec);
25512554
let b = BigInt::from_slice(Plus, b_vec);
@@ -2584,7 +2587,7 @@ mod bigint_tests {
25842587
}
25852588
}
25862589

2587-
for elm in mul_triples.iter() {
2590+
for elm in MUL_TRIPLES.iter() {
25882591
let (a_vec, b_vec, c_vec) = *elm;
25892592
let a = BigInt::from_slice(Plus, a_vec);
25902593
let b = BigInt::from_slice(Plus, b_vec);
@@ -2594,7 +2597,7 @@ mod bigint_tests {
25942597
if !b.is_zero() { check(&c, &b, &a, &Zero::zero()); }
25952598
}
25962599

2597-
for elm in div_rem_quadruples.iter() {
2600+
for elm in DIV_REM_QUADRUPLES.iter() {
25982601
let (a_vec, b_vec, c_vec, d_vec) = *elm;
25992602
let a = BigInt::from_slice(Plus, a_vec);
26002603
let b = BigInt::from_slice(Plus, b_vec);
@@ -2627,7 +2630,7 @@ mod bigint_tests {
26272630
check_sub(&a.neg(), b, &q.neg(), &r.neg());
26282631
check_sub(&a.neg(), &b.neg(), q, &r.neg());
26292632
}
2630-
for elm in mul_triples.iter() {
2633+
for elm in MUL_TRIPLES.iter() {
26312634
let (a_vec, b_vec, c_vec) = *elm;
26322635
let a = BigInt::from_slice(Plus, a_vec);
26332636
let b = BigInt::from_slice(Plus, b_vec);
@@ -2637,7 +2640,7 @@ mod bigint_tests {
26372640
if !b.is_zero() { check(&c, &b, &a, &Zero::zero()); }
26382641
}
26392642

2640-
for elm in div_rem_quadruples.iter() {
2643+
for elm in DIV_REM_QUADRUPLES.iter() {
26412644
let (a_vec, b_vec, c_vec, d_vec) = *elm;
26422645
let a = BigInt::from_slice(Plus, a_vec);
26432646
let b = BigInt::from_slice(Plus, b_vec);
@@ -2652,7 +2655,7 @@ mod bigint_tests {
26522655

26532656
#[test]
26542657
fn test_checked_add() {
2655-
for elm in sum_triples.iter() {
2658+
for elm in SUM_TRIPLES.iter() {
26562659
let (a_vec, b_vec, c_vec) = *elm;
26572660
let a = BigInt::from_slice(Plus, a_vec);
26582661
let b = BigInt::from_slice(Plus, b_vec);
@@ -2671,7 +2674,7 @@ mod bigint_tests {
26712674

26722675
#[test]
26732676
fn test_checked_sub() {
2674-
for elm in sum_triples.iter() {
2677+
for elm in SUM_TRIPLES.iter() {
26752678
let (a_vec, b_vec, c_vec) = *elm;
26762679
let a = BigInt::from_slice(Plus, a_vec);
26772680
let b = BigInt::from_slice(Plus, b_vec);
@@ -2690,7 +2693,7 @@ mod bigint_tests {
26902693

26912694
#[test]
26922695
fn test_checked_mul() {
2693-
for elm in mul_triples.iter() {
2696+
for elm in MUL_TRIPLES.iter() {
26942697
let (a_vec, b_vec, c_vec) = *elm;
26952698
let a = BigInt::from_slice(Plus, a_vec);
26962699
let b = BigInt::from_slice(Plus, b_vec);
@@ -2703,7 +2706,7 @@ mod bigint_tests {
27032706
assert!((-b).checked_mul(&a).unwrap() == -c);
27042707
}
27052708

2706-
for elm in div_rem_quadruples.iter() {
2709+
for elm in DIV_REM_QUADRUPLES.iter() {
27072710
let (a_vec, b_vec, c_vec, d_vec) = *elm;
27082711
let a = BigInt::from_slice(Plus, a_vec);
27092712
let b = BigInt::from_slice(Plus, b_vec);
@@ -2716,7 +2719,7 @@ mod bigint_tests {
27162719
}
27172720
#[test]
27182721
fn test_checked_div() {
2719-
for elm in mul_triples.iter() {
2722+
for elm in MUL_TRIPLES.iter() {
27202723
let (a_vec, b_vec, c_vec) = *elm;
27212724
let a = BigInt::from_slice(Plus, a_vec);
27222725
let b = BigInt::from_slice(Plus, b_vec);

src/libnum/rational.rs

+3
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,13 @@ mod test {
406406
pub static _2: Rational = Ratio { numer: 2, denom: 1};
407407
pub static _1_2: Rational = Ratio { numer: 1, denom: 2};
408408
pub static _3_2: Rational = Ratio { numer: 3, denom: 2};
409+
#[allow(non_uppercase_statics)]
409410
pub static _neg1_2: Rational = Ratio { numer: -1, denom: 2};
410411
pub static _1_3: Rational = Ratio { numer: 1, denom: 3};
412+
#[allow(non_uppercase_statics)]
411413
pub static _neg1_3: Rational = Ratio { numer: -1, denom: 3};
412414
pub static _2_3: Rational = Ratio { numer: 2, denom: 3};
415+
#[allow(non_uppercase_statics)]
413416
pub static _neg2_3: Rational = Ratio { numer: -2, denom: 3};
414417

415418
pub fn to_big(n: Rational) -> BigRational {

0 commit comments

Comments
 (0)