Skip to content

Commit a41b631

Browse files
committed
---
yaml --- r: 55171 b: refs/heads/snap-stage3 c: 8408012 h: refs/heads/master i: 55169: 285f2e4 55167: 65ba145 v: v3
1 parent 13db650 commit a41b631

File tree

5 files changed

+19
-97
lines changed

5 files changed

+19
-97
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: a6eaa3bbb490b01c21864adc41e12eafb98a3c32
4+
refs/heads/snap-stage3: 8408012ca4ed6e8e0aa2aa85e24eb53b4b17308d
55
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libcore/char.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
//! Utilities for manipulating the char type
1212
13-
#[cfg(notest)]
1413
use cmp::Ord;
1514
use option::{None, Option, Some};
1615
use str;

branches/snap-stage3/src/libcore/iter.rs

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ much easier to implement.
4141
4242
*/
4343

44-
use cmp::Ord;
45-
use option::{Option, Some, None};
46-
4744
pub trait Times {
4845
fn times(&self, it: &fn() -> bool);
4946
}
@@ -107,78 +104,6 @@ pub fn all<T>(predicate: &fn(T) -> bool, iter: &fn(f: &fn(T) -> bool)) -> bool {
107104
true
108105
}
109106

110-
/**
111-
* Return the first element where `predicate` returns `true`. Return `None` if no element is found.
112-
*
113-
* # Example:
114-
*
115-
* ~~~~
116-
* let xs = ~[1u, 2, 3, 4, 5, 6];
117-
* assert_eq!(*find(|& &x: & &uint| x > 3, |f| xs.each(f)).unwrap(), 4);
118-
* ~~~~
119-
*/
120-
#[inline(always)]
121-
pub fn find<T>(predicate: &fn(&T) -> bool, iter: &fn(f: &fn(T) -> bool)) -> Option<T> {
122-
for iter |x| {
123-
if predicate(&x) {
124-
return Some(x);
125-
}
126-
}
127-
None
128-
}
129-
130-
/**
131-
* Return the largest item yielded by an iterator. Return `None` if the iterator is empty.
132-
*
133-
* # Example:
134-
*
135-
* ~~~~
136-
* let xs = ~[8, 2, 3, 1, -5, 9, 11, 15];
137-
* assert_eq!(max(|f| xs.each(f)).unwrap(), &15);
138-
* ~~~~
139-
*/
140-
#[inline]
141-
pub fn max<T: Ord>(iter: &fn(f: &fn(T) -> bool)) -> Option<T> {
142-
let mut result = None;
143-
for iter |x| {
144-
match result {
145-
Some(ref mut y) => {
146-
if x > *y {
147-
*y = x;
148-
}
149-
}
150-
None => result = Some(x)
151-
}
152-
}
153-
result
154-
}
155-
156-
/**
157-
* Return the smallest item yielded by an iterator. Return `None` if the iterator is empty.
158-
*
159-
* # Example:
160-
*
161-
* ~~~~
162-
* let xs = ~[8, 2, 3, 1, -5, 9, 11, 15];
163-
* assert_eq!(max(|f| xs.each(f)).unwrap(), &-5);
164-
* ~~~~
165-
*/
166-
#[inline]
167-
pub fn min<T: Ord>(iter: &fn(f: &fn(T) -> bool)) -> Option<T> {
168-
let mut result = None;
169-
for iter |x| {
170-
match result {
171-
Some(ref mut y) => {
172-
if x < *y {
173-
*y = x;
174-
}
175-
}
176-
None => result = Some(x)
177-
}
178-
}
179-
result
180-
}
181-
182107
#[cfg(test)]
183108
mod tests {
184109
use super::*;
@@ -203,22 +128,4 @@ mod tests {
203128
assert!(all(|x: uint| x < 6, |f| uint::range(1, 6, f)));
204129
assert!(!all(|x: uint| x < 5, |f| uint::range(1, 6, f)));
205130
}
206-
207-
#[test]
208-
fn test_find() {
209-
let xs = ~[1u, 2, 3, 4, 5, 6];
210-
assert_eq!(*find(|& &x: & &uint| x > 3, |f| xs.each(f)).unwrap(), 4);
211-
}
212-
213-
#[test]
214-
fn test_max() {
215-
let xs = ~[8, 2, 3, 1, -5, 9, 11, 15];
216-
assert_eq!(max(|f| xs.each(f)).unwrap(), &15);
217-
}
218-
219-
#[test]
220-
fn test_min() {
221-
let xs = ~[8, 2, 3, 1, -5, 9, 11, 15];
222-
assert_eq!(min(|f| xs.each(f)).unwrap(), &-5);
223-
}
224131
}

branches/snap-stage3/src/librustc/middle/trans/adt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ pub fn num_args(r: &Repr, discr: int) -> uint {
409409
st.fields.len() - (if dtor { 1 } else { 0 })
410410
}
411411
General(ref cases) => cases[discr as uint].fields.len() - 1,
412-
NullablePointer{ nonnull: ref nonnull, nndiscr, _ } => {
413-
if discr == nndiscr { nonnull.fields.len() } else { 0 }
412+
NullablePointer{ nonnull: ref nonnull, nndiscr, nullfields: ref nullfields, _ } => {
413+
if discr == nndiscr { nonnull.fields.len() } else { nullfields.len() }
414414
}
415415
}
416416
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub fn main() {
12+
match Left(@17) {
13+
Right(()) => {}
14+
_ => {}
15+
}
16+
}

0 commit comments

Comments
 (0)