Skip to content

Commit a1bd911

Browse files
committed
---
yaml --- r: 72172 b: refs/heads/dist-snap c: e67f1c0 h: refs/heads/master v: v3
1 parent 3718498 commit a1bd911

File tree

4 files changed

+6
-59
lines changed

4 files changed

+6
-59
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: 5c2e9b29f10694ad76dcb6b88e95243a44813c05
10+
refs/heads/dist-snap: e67f1c0fd229ab9f106c17f3b690dc6059eaeef0
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ do spawn {
16701670
~~~~
16711671

16721672
If you want to see the output of `debug!` statements, you will need to turn on `debug!` logging.
1673-
To enable `debug!` logging, set the RUST_LOG environment variable to `debug` (e.g., with bash, `export RUST_LOG=debug`)
1673+
To enable `debug!` logging, set the RUST_LOG environment variable to the name of your crate, which, for a file named `foo.rs`, will be `foo` (e.g., with bash, `export RUST_LOG=foo`).
16741674

16751675
## For loops
16761676

branches/dist-snap/src/libcore/sys.rs

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,12 @@ pub fn get_type_desc<T>() -> *TypeDesc {
8383
unsafe { rusti::get_tydesc::<T>() as *TypeDesc }
8484
}
8585

86-
/// Returns a pointer to a type descriptor.
87-
#[inline(always)]
88-
pub fn get_type_desc_val<T>(_val: &T) -> *TypeDesc {
89-
get_type_desc::<T>()
90-
}
91-
9286
/// Returns the size of a type
9387
#[inline(always)]
9488
pub fn size_of<T>() -> uint {
9589
unsafe { rusti::size_of::<T>() }
9690
}
9791

98-
/// Returns the size of the type that `_val` points to
99-
#[inline(always)]
100-
pub fn size_of_val<T>(_val: &T) -> uint {
101-
size_of::<T>()
102-
}
103-
10492
/**
10593
* Returns the size of a type, or 1 if the actual size is zero.
10694
*
@@ -112,13 +100,6 @@ pub fn nonzero_size_of<T>() -> uint {
112100
if s == 0 { 1 } else { s }
113101
}
114102

115-
/// Returns the size of the type of the value that `_val` points to
116-
#[inline(always)]
117-
pub fn nonzero_size_of_val<T>(_val: &T) -> uint {
118-
nonzero_size_of::<T>()
119-
}
120-
121-
122103
/**
123104
* Returns the ABI-required minimum alignment of a type
124105
*
@@ -130,26 +111,12 @@ pub fn min_align_of<T>() -> uint {
130111
unsafe { rusti::min_align_of::<T>() }
131112
}
132113

133-
/// Returns the ABI-required minimum alignment of the type of the value that
134-
/// `_val` points to
135-
#[inline(always)]
136-
pub fn min_align_of_val<T>(_val: &T) -> uint {
137-
min_align_of::<T>()
138-
}
139-
140114
/// Returns the preferred alignment of a type
141115
#[inline(always)]
142116
pub fn pref_align_of<T>() -> uint {
143117
unsafe { rusti::pref_align_of::<T>() }
144118
}
145119

146-
/// Returns the preferred alignment of the type of the value that
147-
/// `_val` points to
148-
#[inline(always)]
149-
pub fn pref_align_of_val<T>(_val: &T) -> uint {
150-
pref_align_of::<T>()
151-
}
152-
153120
/// Returns the refcount of a shared box (as just before calling this)
154121
#[inline(always)]
155122
pub fn refcount<T>(t: @T) -> uint {
@@ -195,7 +162,7 @@ pub fn fail_assert(msg: &str, file: &str, line: uint) -> ! {
195162
#[cfg(test)]
196163
mod tests {
197164
use cast;
198-
use sys::*;
165+
use sys::{Closure, pref_align_of, size_of, nonzero_size_of};
199166
200167
#[test]
201168
fn size_of_basic() {
@@ -221,14 +188,6 @@ mod tests {
221188
assert!(size_of::<*uint>() == 8u);
222189
}
223190

224-
#[test]
225-
fn size_of_val_basic() {
226-
assert_eq!(size_of_val(&1u8), 1);
227-
assert_eq!(size_of_val(&1u16), 2);
228-
assert_eq!(size_of_val(&1u32), 4);
229-
assert_eq!(size_of_val(&1u64), 8);
230-
}
231-
232191
#[test]
233192
fn nonzero_size_of_basic() {
234193
type Z = [i8, ..0];
@@ -237,14 +196,6 @@ mod tests {
237196
assert!(nonzero_size_of::<uint>() == size_of::<uint>());
238197
}
239198

240-
#[test]
241-
fn nonzero_size_of_val_basic() {
242-
let z = [0u8, ..0];
243-
assert_eq!(size_of_val(&z), 0u);
244-
assert_eq!(nonzero_size_of_val(&z), 1u);
245-
assert_eq!(nonzero_size_of_val(&1u), size_of_val(&1u));
246-
}
247-
248199
#[test]
249200
fn align_of_basic() {
250201
assert!(pref_align_of::<u8>() == 1u);
@@ -268,13 +219,6 @@ mod tests {
268219
assert!(pref_align_of::<*uint>() == 8u);
269220
}
270221

271-
#[test]
272-
fn align_of_val_basic() {
273-
assert_eq!(pref_align_of_val(&1u8), 1u);
274-
assert_eq!(pref_align_of_val(&1u16), 2u);
275-
assert_eq!(pref_align_of_val(&1u32), 4u);
276-
}
277-
278222
#[test]
279223
fn synthesize_closure() {
280224
unsafe {

branches/dist-snap/src/libcore/vec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,7 @@ pub fn each_permutation<T:Copy>(v: &[T], put: &fn(ts: &[T]) -> bool) {
15421542
#[cfg(stage0)] // XXX: lifetimes!
15431543
pub fn windowed<T>(n: uint, v: &[T], it: &fn(&[T]) -> bool) {
15441544
assert!(1u <= n);
1545+
if n > v.len() { return; }
15451546
for uint::range(0, v.len() - n + 1) |i| {
15461547
if !it(v.slice(i, i+n)) { return }
15471548
}
@@ -1551,6 +1552,7 @@ pub fn windowed<T>(n: uint, v: &[T], it: &fn(&[T]) -> bool) {
15511552
#[cfg(stage3)]
15521553
pub fn windowed<'r, T>(n: uint, v: &'r [T], it: &fn(&'r [T]) -> bool) {
15531554
assert!(1u <= n);
1555+
if n > v.len() { return; }
15541556
for uint::range(0, v.len() - n + 1) |i| {
15551557
if !it(v.slice(i, i + n)) { return }
15561558
}
@@ -3910,6 +3912,7 @@ mod tests {
39103912
t(3, &[&[1,2,3],&[2,3,4],&[3,4,5],&[4,5,6]]);
39113913
t(4, &[&[1,2,3,4],&[2,3,4,5],&[3,4,5,6]]);
39123914
t(7, &[]);
3915+
t(8, &[]);
39133916
}
39143917

39153918
#[test]

0 commit comments

Comments
 (0)