Skip to content

Commit e61330a

Browse files
committed
---
yaml --- r: 145904 b: refs/heads/try2 c: 4b4b213 h: refs/heads/master v: v3
1 parent a4a91df commit e61330a

File tree

3 files changed

+7
-20
lines changed

3 files changed

+7
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0bad7e1a37c21668ff4f4d4f4b629218b9f47538
8+
refs/heads/try2: 4b4b2136e048c39c60c8289f4cd1c870d4aaaeb0
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/adt.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,12 @@ pub fn trans_const(ccx: &mut CrateContext, r: &Repr, discr: Disr,
505505
}
506506
Univariant(ref st, _dro) => {
507507
assert_eq!(discr, 0);
508-
C_struct(build_const_struct(ccx, st, vals))
508+
let contents = build_const_struct(ccx, st, vals);
509+
if st.packed {
510+
C_packed_struct(contents)
511+
} else {
512+
C_struct(contents)
513+
}
509514
}
510515
General(ref cases) => {
511516
let case = &cases[discr];

branches/try2/src/libstd/vec.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,6 @@ pub trait ImmutableVector<'self, T> {
840840
fn window_iter(self, size: uint) -> WindowIter<'self, T>;
841841
fn chunk_iter(self, size: uint) -> ChunkIter<'self, T>;
842842

843-
fn get_opt(&self, index: uint) -> Option<&'self T>;
844843
fn head(&self) -> &'self T;
845844
fn head_opt(&self) -> Option<&'self T>;
846845
fn tail(&self) -> &'self [T];
@@ -1020,13 +1019,6 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
10201019
ChunkIter { v: self, size: size }
10211020
}
10221021

1023-
/// Returns the element of a vector at the given index, or `None` if the
1024-
/// index is out of bounds
1025-
#[inline]
1026-
fn get_opt(&self, index: uint) -> Option<&'self T> {
1027-
if index < self.len() { Some(&self[index]) } else { None }
1028-
}
1029-
10301022
/// Returns the first element of a vector, failing if the vector is empty.
10311023
#[inline]
10321024
fn head(&self) -> &'self T {
@@ -2582,16 +2574,6 @@ mod tests {
25822574
assert_eq!(v2.len(), 2);
25832575
}
25842576

2585-
#[test]
2586-
fn test_get_opt() {
2587-
let mut a = ~[11];
2588-
assert_eq!(a.get_opt(1), None);
2589-
a = ~[11, 12];
2590-
assert_eq!(a.get_opt(1).unwrap(), &12);
2591-
a = ~[11, 12, 13];
2592-
assert_eq!(a.get_opt(1).unwrap(), &12);
2593-
}
2594-
25952577
#[test]
25962578
fn test_head() {
25972579
let mut a = ~[11];

0 commit comments

Comments
 (0)