Skip to content

Commit f024dc5

Browse files
committed
---
yaml --- r: 235486 b: refs/heads/stable c: cfa8e48 h: refs/heads/master v: v3
1 parent 1dcea1d commit f024dc5

File tree

45 files changed

+796
-1708
lines changed

Some content is hidden

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

45 files changed

+796
-1708
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 69e6dc0444bb62a474c8c5f7490c660f9d88c172
32+
refs/heads/stable: cfa8e48b21fad7748659b6a4d74754fab9020891
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/.travis.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,20 @@
1-
# ccache support is disabled unless your language is a C-derivative. However
2-
# `language: C` unconditionally sets `CC=compiler`. If we just set it in our
3-
# `env` it will be overwritten by the default (gcc 4.6).
1+
# Use something that's not 'ruby' so we don't set up things like
2+
# RVM/bundler/ruby and whatnot. Right now 'rust' as a language actually
3+
# downloads a rust/cargo snapshot, which we don't really want for building rust.
44
language: c
5-
compiler: /usr/bin/gcc-4.7
6-
cache: ccache
75
sudo: false
86

97
# The test suite is in general way too stressful for travis, especially in
108
# terms of time limit and reliability. In the past we've tried to scale things
119
# back to only build the stage1 compiler and run a subset of tests, but this
1210
# didn't end up panning out very well.
1311
#
14-
# As a result, we're just using travis to run `make tidy` and *only* build
15-
# stage1 but *not* test it for now (a strict subset of the bootstrap). This will
16-
# catch "obvious" errors like style or not even compiling.
17-
#
18-
# We need gcc4.7 or higher to build LLVM, and travis (well, Ubuntu 12.04)
19-
# currently ships with 4.6. Gotta download our own.
12+
# As a result, we're just using travis to run `make tidy` now. It'll help
13+
# everyone find out about their trailing spaces early on!
2014
before_script:
21-
- ./configure --enable-ccache
15+
- ./configure --llvm-root=path/to/nowhere
2216
script:
2317
- make tidy
24-
- make rustc-stage1 -j4
25-
26-
env:
27-
- CXX=/usr/bin/g++-4.7
28-
29-
addons:
30-
apt:
31-
sources:
32-
- ubuntu-toolchain-r-test
33-
packages:
34-
- gcc-4.7
35-
- g++-4.7
3618

3719
# Real testing happens on http://buildbot.rust-lang.org/
3820
#

branches/stable/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ Documentation improvements are very welcome. The source of `doc.rust-lang.org`
133133
is located in `src/doc` in the tree, and standard API documentation is generated
134134
from the source code itself.
135135

136-
Documentation pull requests function in the same way as other pull requests,
137-
though you may see a slightly different form of `r+`:
136+
Documentation pull requests function in the same as other pull requests, though
137+
you may see a slightly different form of `r+`:
138138

139139
@bors: r+ 38fe8d2 rollup
140140

branches/stable/RELEASES.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ Breaking Changes
2828
in, and the same value reported by clang's
2929
`alignof`. [`mem::min_align_of`] is deprecated. This is not known to
3030
break real code.
31-
* [The `#[packed]` attribute is no longer silently accepted by the
32-
compiler][packed]. This attribute did nothing and code that
33-
mentioned it likely did not work as intended.
3431

3532
Language
3633
--------
@@ -143,7 +140,7 @@ Misc
143140
[fat]: https://github.com/rust-lang/rust/pull/26411
144141
[dst]: https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md
145142
[parcodegen]: https://github.com/rust-lang/rust/pull/26018
146-
[packed]: https://github.com/rust-lang/rust/pull/25541
143+
147144

148145
Version 1.1.0 (June 2015)
149146
=========================

branches/stable/configure

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,12 +1031,15 @@ fi
10311031

10321032
if [ ! -z "$CFG_ENABLE_CCACHE" ]
10331033
then
1034-
if [ -z "$CFG_CCACHE" ]
1034+
if [ -z "$CC" ]
10351035
then
1036-
err "ccache requested but not found"
1037-
fi
1036+
if [ -z "$CFG_CCACHE" ]
1037+
then
1038+
err "ccache requested but not found"
1039+
fi
10381040

1039-
CFG_CC="ccache $CFG_CC"
1041+
CFG_CC="ccache $CFG_CC"
1042+
fi
10401043
fi
10411044

10421045
if [ -z "$CC" -a -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
@@ -1525,26 +1528,11 @@ do
15251528

15261529
(*)
15271530
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
1528-
if [ ! -z "$CFG_ENABLE_CCACHE" ]
1529-
then
1530-
if [ -z "$CFG_CCACHE" ]
1531-
then
1532-
err "ccache requested but not found"
1533-
fi
1534-
1535-
LLVM_CXX_32="ccache $CXX"
1536-
LLVM_CC_32="ccache $CC"
1537-
1538-
LLVM_CXX_64="ccache $CXX"
1539-
LLVM_CC_64="ccache $CC"
1540-
else
1541-
LLVM_CXX_32="$CXX"
1542-
LLVM_CC_32="$CC"
1543-
1544-
LLVM_CXX_64="$CXX"
1545-
LLVM_CC_64="$CC"
1546-
fi
1531+
LLVM_CXX_32="$CXX"
1532+
LLVM_CC_32="$CC"
15471533

1534+
LLVM_CXX_64="$CXX"
1535+
LLVM_CC_64="$CC"
15481536
;;
15491537
esac
15501538

branches/stable/src/doc/trpl/error-handling.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ is very wrong. Wrong enough that we can't continue with things in the current
5050
state. Another example is using the `unreachable!()` macro:
5151

5252
```rust,ignore
53-
use Event::NewRelease;
54-
5553
enum Event {
5654
NewRelease,
5755
}
@@ -73,7 +71,7 @@ fn descriptive_probability(event: Event) -> &'static str {
7371
}
7472
7573
fn main() {
76-
println!("{}", descriptive_probability(NewRelease));
74+
std::io::println(descriptive_probability(NewRelease));
7775
}
7876
```
7977

branches/stable/src/doc/trpl/the-stack-and-the-heap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ After `bar()` is over, its frame is deallocated, leaving just `foo()` and
176176
| 1 | a | 5 |
177177
| 0 | x | 42 |
178178

179-
And then `foo()` ends, leaving just `main()`:
179+
And then `foo()` ends, leaving just `main()`
180180

181181
| Address | Name | Value |
182182
|---------|------|-------|
@@ -537,7 +537,7 @@ Generally, you should prefer stack allocation, and so, Rust stack-allocates by
537537
default. The LIFO model of the stack is simpler, at a fundamental level. This
538538
has two big impacts: runtime efficiency and semantic impact.
539539

540-
## Runtime Efficiency
540+
## Runtime Efficiency.
541541

542542
Managing the memory for the stack is trivial: The machine just
543543
increments or decrements a single value, the so-called “stack pointer”.

branches/stable/src/libcore/hash/sip.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
//! An implementation of SipHash 2-4.
1212
13+
#![allow(deprecated)] // until the next snapshot for inherent wrapping ops
14+
1315
use prelude::*;
1416
use super::Hasher;
1517

branches/stable/src/libcoretest/hash/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
mod sip;
12-
1311
use std::mem;
1412
use std::hash::{Hash, Hasher};
1513
use std::default::Default;

branches/stable/src/libcoretest/hash/sip.rs

Lines changed: 67 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,28 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010
use test::Bencher;
11+
use std::prelude::*;
12+
use std::fmt;
1113

12-
use core::hash::{Hash, Hasher};
13-
use core::hash::SipHasher;
14+
use str::Str;
15+
use string::String;
16+
use slice::{AsSlice, SlicePrelude};
17+
use vec::Vec;
18+
19+
use core::hash::{Hash, Writer};
20+
use core::hash::sip::{SipState, hash, hash_with_keys};
1421

1522
// Hash just the bytes of the slice, without length prefix
1623
struct Bytes<'a>(&'a [u8]);
1724

18-
impl<'a> Hash for Bytes<'a> {
25+
impl<'a, S: Writer> Hash<S> for Bytes<'a> {
1926
#[allow(unused_must_use)]
20-
fn hash<H: Hasher>(&self, state: &mut H) {
27+
fn hash(&self, state: &mut S) {
2128
let Bytes(v) = *self;
2229
state.write(v);
2330
}
2431
}
2532

26-
macro_rules! u8to64_le {
27-
($buf:expr, $i:expr) =>
28-
($buf[0+$i] as u64 |
29-
($buf[1+$i] as u64) << 8 |
30-
($buf[2+$i] as u64) << 16 |
31-
($buf[3+$i] as u64) << 24 |
32-
($buf[4+$i] as u64) << 32 |
33-
($buf[5+$i] as u64) << 40 |
34-
($buf[6+$i] as u64) << 48 |
35-
($buf[7+$i] as u64) << 56);
36-
($buf:expr, $i:expr, $len:expr) =>
37-
({
38-
let mut t = 0;
39-
let mut out = 0;
40-
while t < $len {
41-
out |= ($buf[t+$i] as u64) << t*8;
42-
t += 1;
43-
}
44-
out
45-
});
46-
}
47-
48-
fn hash<T: Hash>(x: &T) -> u64 {
49-
let mut st = SipHasher::new();
50-
x.hash(&mut st);
51-
st.finish()
52-
}
53-
54-
fn hash_with_keys<T: Hash>(k1: u64, k2: u64, x: &T) -> u64 {
55-
let mut st = SipHasher::new_with_keys(k1, k2);
56-
x.hash(&mut st);
57-
st.finish()
58-
}
59-
6033
#[test]
6134
#[allow(unused_must_use)]
6235
fn test_siphash() {
@@ -131,43 +104,79 @@ fn test_siphash() {
131104
let k1 = 0x_0f_0e_0d_0c_0b_0a_09_08;
132105
let mut buf = Vec::new();
133106
let mut t = 0;
134-
let mut state_inc = SipHasher::new_with_keys(k0, k1);
107+
let mut state_inc = SipState::new_with_keys(k0, k1);
108+
let mut state_full = SipState::new_with_keys(k0, k1);
109+
110+
fn to_hex_str(r: &[u8; 8]) -> String {
111+
let mut s = String::new();
112+
for b in r {
113+
s.push_str(format!("{}", fmt::radix(*b, 16)));
114+
}
115+
s
116+
}
117+
118+
fn result_bytes(h: u64) -> Vec<u8> {
119+
vec![(h >> 0) as u8,
120+
(h >> 8) as u8,
121+
(h >> 16) as u8,
122+
(h >> 24) as u8,
123+
(h >> 32) as u8,
124+
(h >> 40) as u8,
125+
(h >> 48) as u8,
126+
(h >> 56) as u8,
127+
]
128+
}
129+
130+
fn result_str(h: u64) -> String {
131+
let r = result_bytes(h);
132+
let mut s = String::new();
133+
for b in &r {
134+
s.push_str(format!("{}", fmt::radix(*b, 16)));
135+
}
136+
s
137+
}
135138

136139
while t < 64 {
140+
debug!("siphash test {}: {}", t, buf);
137141
let vec = u8to64_le!(vecs[t], 0);
138-
let out = hash_with_keys(k0, k1, &Bytes(&buf));
142+
let out = hash_with_keys(k0, k1, &Bytes(buf));
143+
debug!("got {}, expected {}", out, vec);
139144
assert_eq!(vec, out);
140145

141-
let full = hash_with_keys(k0, k1, &Bytes(&buf));
142-
let i = state_inc.finish();
146+
state_full.reset();
147+
state_full.write(buf);
148+
let f = result_str(state_full.result());
149+
let i = result_str(state_inc.result());
150+
let v = to_hex_str(&vecs[t]);
151+
debug!("{}: ({}) => inc={} full={}", t, v, i, f);
143152

144-
assert_eq!(full, i);
145-
assert_eq!(full, vec);
153+
assert_eq!(f, i);
154+
assert_eq!(f, v);
146155

147156
buf.push(t as u8);
148-
Hasher::write(&mut state_inc, &[t as u8]);
157+
state_inc.write(&[t as u8]);
149158

150159
t += 1;
151160
}
152161
}
153162

154163
#[test] #[cfg(target_arch = "arm")]
155-
fn test_hash_usize() {
164+
fn test_hash_uint() {
156165
let val = 0xdeadbeef_deadbeef_u64;
157-
assert!(hash(&(val as u64)) != hash(&(val as usize)));
158-
assert_eq!(hash(&(val as u32)), hash(&(val as usize)));
166+
assert!(hash(&(val as u64)) != hash(&(val as uint)));
167+
assert_eq!(hash(&(val as u32)), hash(&(val as uint)));
159168
}
160169
#[test] #[cfg(target_arch = "x86_64")]
161-
fn test_hash_usize() {
170+
fn test_hash_uint() {
162171
let val = 0xdeadbeef_deadbeef_u64;
163-
assert_eq!(hash(&(val as u64)), hash(&(val as usize)));
164-
assert!(hash(&(val as u32)) != hash(&(val as usize)));
172+
assert_eq!(hash(&(val as u64)), hash(&(val as uint)));
173+
assert!(hash(&(val as u32)) != hash(&(val as uint)));
165174
}
166175
#[test] #[cfg(target_arch = "x86")]
167-
fn test_hash_usize() {
176+
fn test_hash_uint() {
168177
let val = 0xdeadbeef_deadbeef_u64;
169-
assert!(hash(&(val as u64)) != hash(&(val as usize)));
170-
assert_eq!(hash(&(val as u32)), hash(&(val as usize)));
178+
assert!(hash(&(val as u64)) != hash(&(val as uint)));
179+
assert_eq!(hash(&(val as u32)), hash(&(val as uint)));
171180
}
172181

173182
#[test]
@@ -191,7 +200,7 @@ fn test_hash_no_bytes_dropped_64() {
191200
assert!(hash(&val) != hash(&zero_byte(val, 6)));
192201
assert!(hash(&val) != hash(&zero_byte(val, 7)));
193202

194-
fn zero_byte(val: u64, byte: usize) -> u64 {
203+
fn zero_byte(val: u64, byte: uint) -> u64 {
195204
assert!(byte < 8);
196205
val & !(0xff << (byte * 8))
197206
}
@@ -206,7 +215,7 @@ fn test_hash_no_bytes_dropped_32() {
206215
assert!(hash(&val) != hash(&zero_byte(val, 2)));
207216
assert!(hash(&val) != hash(&zero_byte(val, 3)));
208217

209-
fn zero_byte(val: u32, byte: usize) -> u32 {
218+
fn zero_byte(val: u32, byte: uint) -> u32 {
210219
assert!(byte < 4);
211220
val & !(0xff << (byte * 8))
212221
}
@@ -221,9 +230,8 @@ fn test_hash_no_concat_alias() {
221230
assert!(s != t && t != u);
222231
assert!(hash(&s) != hash(&t) && hash(&s) != hash(&u));
223232

224-
let u = [1, 0, 0, 0];
225-
let v = (&u[..1], &u[1..3], &u[3..]);
226-
let w = (&u[..], &u[4..4], &u[4..4]);
233+
let v: (&[u8], &[u8], &[u8]) = (&[1], &[0, 0], &[0]);
234+
let w: (&[u8], &[u8], &[u8]) = (&[1, 0, 0, 0], &[], &[]);
227235

228236
assert!(v != w);
229237
assert!(hash(&v) != hash(&w));

branches/stable/src/librustc/ast_map/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,6 @@ impl<'ast> Map<'ast> {
411411
}
412412
}
413413

414-
pub fn expect_trait_item(&self, id: NodeId) -> &'ast TraitItem {
415-
match self.find(id) {
416-
Some(NodeTraitItem(item)) => item,
417-
_ => panic!("expected trait item, found {}", self.node_to_string(id))
418-
}
419-
}
420-
421414
pub fn expect_struct(&self, id: NodeId) -> &'ast StructDef {
422415
match self.find(id) {
423416
Some(NodeItem(i)) => {

0 commit comments

Comments
 (0)