Skip to content

Commit ce7f707

Browse files
committed
---
yaml --- r: 158986 b: refs/heads/auto c: ebc625a h: refs/heads/master v: v3
1 parent 617678e commit ce7f707

Some content is hidden

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

42 files changed

+1363
-839
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 3dbd32854f6bdee94c98c5e3e5da58fb79d79fd9
13+
refs/heads/auto: ebc625ad3eaa2ee630c6c8203106826ad23abc98
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ putvar() {
7676
printf "%-20s := %s\n" $1 "$T" >>config.tmp
7777
}
7878

79+
putpathvar() {
80+
local T
81+
eval T=\$$1
82+
eval TLEN=\${#$1}
83+
if [ $TLEN -gt 35 ]
84+
then
85+
printf "configure: %-20s := %.35s ...\n" $1 "$T"
86+
else
87+
printf "configure: %-20s := %s %s\n" $1 "$T" "$2"
88+
fi
89+
if [ -z "$T" ]
90+
then
91+
printf "%-20s := \n" $1 >>config.tmp
92+
else
93+
printf "%-20s := \"%s\"\n" $1 "$T" >>config.tmp
94+
fi
95+
}
96+
7997
probe() {
8098
local V=$1
8199
shift
@@ -101,7 +119,7 @@ probe() {
101119
fi
102120
done
103121
eval $V=\$T
104-
putvar $V "$VER"
122+
putpathvar $V "$VER"
105123
}
106124

107125
probe_need() {
@@ -638,9 +656,9 @@ probe CFG_ADB adb
638656

639657
if [ ! -z "$CFG_PANDOC" ]
640658
then
641-
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc ' |
659+
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc\(.exe\)\? ' |
642660
# extract the first 2 version fields, ignore everything else
643-
sed 's/pandoc \([0-9]*\)\.\([0-9]*\).*/\1 \2/')
661+
sed 's/pandoc\(.exe\)\? \([0-9]*\)\.\([0-9]*\).*/\2 \3/')
644662

645663
MIN_PV_MAJOR="1"
646664
MIN_PV_MINOR="9"
@@ -1330,8 +1348,7 @@ do
13301348
done
13311349

13321350
# Munge any paths that appear in config.mk back to posix-y
1333-
perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' \
1334-
-e 's@\\@/@go;' config.tmp
1351+
perl -i.bak -p -e 's@ ([a-zA-Z]):[/\\]@ /\1/@go;' config.tmp
13351352
rm -f config.tmp.bak
13361353

13371354
msg

branches/auto/mk/docs.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
2929
guide-tasks guide-container guide-pointers guide-testing \
3030
guide-plugin guide-crates complement-bugreport \
31-
complement-lang-faq complement-design-faq complement-project-faq rust \
31+
complement-lang-faq complement-design-faq complement-project-faq \
3232
rustdoc guide-unsafe guide-strings reference
3333

3434
PDF_DOCS := guide reference
3535

36-
RUSTDOC_DEPS_rust := doc/full-toc.inc
37-
RUSTDOC_FLAGS_rust := --html-in-header=doc/full-toc.inc
36+
RUSTDOC_DEPS_reference := doc/full-toc.inc
37+
RUSTDOC_FLAGS_reference := --html-in-header=doc/full-toc.inc
3838

3939
L10N_LANGS := ja
4040

branches/auto/mk/reconfig.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ifndef CFG_DISABLE_MANAGE_SUBMODULES
1919
# (nothing checked out at all). `./configure --{llvm,jemalloc}-root`
2020
# will explicitly deinitialize the corresponding submodules, and we don't
2121
# want to force constant rebuilds in that case.
22-
NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^+')
22+
NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && $(CFG_GIT) submodule status | grep -c '^+')
2323
else
2424
NEED_GIT_RECONFIG=0
2525
endif

branches/auto/src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
166166
// additional reference of either kind.
167167
if self.inner().strong.load(atomic::SeqCst) != 1 ||
168168
self.inner().weak.load(atomic::SeqCst) != 1 {
169-
*self = Arc::new(self.deref().clone())
169+
*self = Arc::new((**self).clone())
170170
}
171171
// This unsafety is ok because we're guaranteed that the pointer
172172
// returned is the *only* pointer that will ever be returned to T. Our

branches/auto/src/libcollections/enum_set.rs

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,27 @@ impl<E:CLike+fmt::Show> fmt::Show for EnumSet<E> {
4343
}
4444
}
4545

46-
/// An interface for casting C-like enum to uint and back.
46+
/**
47+
An interface for casting C-like enum to uint and back.
48+
A typically implementation is as below.
49+
50+
```{rust,ignore}
51+
#[repr(uint)]
52+
enum Foo {
53+
A, B, C
54+
}
55+
56+
impl CLike for Foo {
57+
fn to_uint(&self) -> uint {
58+
*self as uint
59+
}
60+
61+
fn from_uint(v: uint) -> Foo {
62+
unsafe { mem::transmute(v) }
63+
}
64+
}
65+
```
66+
*/
4767
pub trait CLike {
4868
/// Converts a C-like enum to a `uint`.
4969
fn to_uint(&self) -> uint;
@@ -52,7 +72,11 @@ pub trait CLike {
5272
}
5373

5474
fn bit<E:CLike>(e: &E) -> uint {
55-
1 << e.to_uint()
75+
use core::uint;
76+
let value = e.to_uint();
77+
assert!(value < uint::BITS,
78+
"EnumSet only supports up to {} variants.", uint::BITS - 1);
79+
1 << value
5680
}
5781

5882
impl<E:CLike> EnumSet<E> {
@@ -378,4 +402,31 @@ mod test {
378402
let elems = e_subtract.iter().collect();
379403
assert_eq!(vec![A], elems)
380404
}
405+
406+
#[test]
407+
#[should_fail]
408+
fn test_overflow() {
409+
#[allow(dead_code)]
410+
#[repr(uint)]
411+
enum Bar {
412+
V00, V01, V02, V03, V04, V05, V06, V07, V08, V09,
413+
V10, V11, V12, V13, V14, V15, V16, V17, V18, V19,
414+
V20, V21, V22, V23, V24, V25, V26, V27, V28, V29,
415+
V30, V31, V32, V33, V34, V35, V36, V37, V38, V39,
416+
V40, V41, V42, V43, V44, V45, V46, V47, V48, V49,
417+
V50, V51, V52, V53, V54, V55, V56, V57, V58, V59,
418+
V60, V61, V62, V63, V64, V65, V66, V67, V68, V69,
419+
}
420+
impl CLike for Bar {
421+
fn to_uint(&self) -> uint {
422+
*self as uint
423+
}
424+
425+
fn from_uint(v: uint) -> Bar {
426+
unsafe { mem::transmute(v) }
427+
}
428+
}
429+
let mut set = EnumSet::empty();
430+
set.add(V64);
431+
}
381432
}

branches/auto/src/libcore/atomic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -717,15 +717,15 @@ unsafe fn atomic_xor<T>(dst: *mut T, val: T, order: Ordering) -> T {
717717
/// A fence 'A' which has `Release` ordering semantics, synchronizes with a
718718
/// fence 'B' with (at least) `Acquire` semantics, if and only if there exists
719719
/// atomic operations X and Y, both operating on some atomic object 'M' such
720-
/// that A is sequenced before X, Y is synchronized before B and Y observers
720+
/// that A is sequenced before X, Y is synchronized before B and Y observes
721721
/// the change to M. This provides a happens-before dependence between A and B.
722722
///
723723
/// Atomic operations with `Release` or `Acquire` semantics can also synchronize
724724
/// with a fence.
725725
///
726-
/// A fence with has `SeqCst` ordering, in addition to having both `Acquire` and
727-
/// `Release` semantics, participates in the global program order of the other
728-
/// `SeqCst` operations and/or fences.
726+
/// A fence which has `SeqCst` ordering, in addition to having both `Acquire`
727+
/// and `Release` semantics, participates in the global program order of the
728+
/// other `SeqCst` operations and/or fences.
729729
///
730730
/// Accepts `Acquire`, `Release`, `AcqRel` and `SeqCst` orderings.
731731
///

branches/auto/src/libcore/ops.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ shr_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64)
638638
* ```
639639
*/
640640
#[lang="index"]
641-
pub trait Index<Index, Sized? Result> {
641+
pub trait Index<Index, Sized? Result> for Sized? {
642642
/// The method for the indexing (`Foo[Bar]`) operation
643643
fn index<'a>(&'a self, index: &Index) -> &'a Result;
644644
}
@@ -669,7 +669,7 @@ pub trait Index<Index, Sized? Result> {
669669
* ```
670670
*/
671671
#[lang="index_mut"]
672-
pub trait IndexMut<Index, Result> {
672+
pub trait IndexMut<Index, Result> for Sized? {
673673
/// The method for the indexing (`Foo[Bar]`) operation
674674
fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result;
675675
}
@@ -805,6 +805,16 @@ pub trait Deref<Sized? Result> {
805805
fn deref<'a>(&'a self) -> &'a Result;
806806
}
807807

808+
#[cfg(not(stage0))]
809+
impl<'a, Sized? T> Deref<T> for &'a T {
810+
fn deref(&self) -> &T { *self }
811+
}
812+
813+
#[cfg(not(stage0))]
814+
impl<'a, Sized? T> Deref<T> for &'a mut T {
815+
fn deref(&self) -> &T { *self }
816+
}
817+
808818
/**
809819
*
810820
* The `DerefMut` trait is used to specify the functionality of dereferencing
@@ -845,6 +855,11 @@ pub trait DerefMut<Sized? Result>: Deref<Result> {
845855
fn deref_mut<'a>(&'a mut self) -> &'a mut Result;
846856
}
847857

858+
#[cfg(not(stage0))]
859+
impl<'a, Sized? T> DerefMut<T> for &'a mut T {
860+
fn deref_mut(&mut self) -> &mut T { *self }
861+
}
862+
848863
/// A version of the call operator that takes an immutable receiver.
849864
#[lang="fn"]
850865
pub trait Fn<Args,Result> {

branches/auto/src/libcore/slice.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ pub trait SlicePrelude<T> for Sized? {
256256
#[inline]
257257
#[experimental = "not triaged yet"]
258258
fn is_empty(&self) -> bool { self.len() == 0 }
259-
260259
/// Returns a mutable reference to the element at the given index,
261260
/// or `None` if the index is out of bounds
262261
#[unstable = "waiting on final error conventions"]
@@ -698,6 +697,22 @@ impl<T> SlicePrelude<T> for [T] {
698697
}
699698
}
700699

700+
impl<T> ops::Index<uint, T> for [T] {
701+
fn index(&self, &index: &uint) -> &T {
702+
assert!(index < self.len());
703+
704+
unsafe { mem::transmute(self.repr().data.offset(index as int)) }
705+
}
706+
}
707+
708+
impl<T> ops::IndexMut<uint, T> for [T] {
709+
fn index_mut(&mut self, &index: &uint) -> &mut T {
710+
assert!(index < self.len());
711+
712+
unsafe { mem::transmute(self.repr().data.offset(index as int)) }
713+
}
714+
}
715+
701716
impl<T> ops::Slice<uint, [T]> for [T] {
702717
#[inline]
703718
fn as_slice_<'a>(&'a self) -> &'a [T] {

branches/auto/src/librustc/middle/cfg/construct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
448448
}
449449

450450
ast::ExprStruct(_, ref fields, ref base) => {
451-
let base_exit = self.opt_expr(base, pred);
452-
self.straightline(expr, base_exit, fields.iter().map(|f| &*f.expr))
451+
let field_cfg = self.straightline(expr, pred, fields.iter().map(|f| &*f.expr));
452+
self.opt_expr(base, field_cfg)
453453
}
454454

455455
ast::ExprRepeat(ref elem, ref count) => {

branches/auto/src/librustc/middle/expr_use_visitor.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,10 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,TYPER> {
672672
}
673673
}
674674

675+
// walk the with expression so that complex expressions
676+
// are properly handled.
677+
self.walk_expr(with_expr);
678+
675679
fn contains_field_named(field: &ty::field,
676680
fields: &Vec<ast::Field>)
677681
-> bool

branches/auto/src/librustc/middle/traits/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub enum Vtable<N> {
176176
/// ID is the ID of the closure expression. This is a `VtableImpl`
177177
/// in spirit, but the impl is generated by the compiler and does
178178
/// not appear in the source.
179-
VtableUnboxedClosure(ast::DefId),
179+
VtableUnboxedClosure(ast::DefId, subst::Substs),
180180

181181
/// Successful resolution to an obligation provided by the caller
182182
/// for some type parameter.
@@ -338,7 +338,7 @@ impl<N> Vtable<N> {
338338
pub fn iter_nested(&self) -> Items<N> {
339339
match *self {
340340
VtableImpl(ref i) => i.iter_nested(),
341-
VtableUnboxedClosure(_) => (&[]).iter(),
341+
VtableUnboxedClosure(..) => (&[]).iter(),
342342
VtableParam(_) => (&[]).iter(),
343343
VtableBuiltin(ref i) => i.iter_nested(),
344344
}
@@ -347,7 +347,7 @@ impl<N> Vtable<N> {
347347
pub fn map_nested<M>(&self, op: |&N| -> M) -> Vtable<M> {
348348
match *self {
349349
VtableImpl(ref i) => VtableImpl(i.map_nested(op)),
350-
VtableUnboxedClosure(d) => VtableUnboxedClosure(d),
350+
VtableUnboxedClosure(d, ref s) => VtableUnboxedClosure(d, s.clone()),
351351
VtableParam(ref p) => VtableParam((*p).clone()),
352352
VtableBuiltin(ref i) => VtableBuiltin(i.map_nested(op)),
353353
}
@@ -356,7 +356,7 @@ impl<N> Vtable<N> {
356356
pub fn map_move_nested<M>(self, op: |N| -> M) -> Vtable<M> {
357357
match self {
358358
VtableImpl(i) => VtableImpl(i.map_move_nested(op)),
359-
VtableUnboxedClosure(d) => VtableUnboxedClosure(d),
359+
VtableUnboxedClosure(d, s) => VtableUnboxedClosure(d, s),
360360
VtableParam(p) => VtableParam(p),
361361
VtableBuiltin(i) => VtableBuiltin(i.map_move_nested(op)),
362362
}

branches/auto/src/librustc/middle/traits/select.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,9 +1582,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
15821582
Ok(VtableImpl(vtable_impl))
15831583
}
15841584

1585-
UnboxedClosureCandidate(closure_def_id, ref substs) => {
1586-
try!(self.confirm_unboxed_closure_candidate(obligation, closure_def_id, substs));
1587-
Ok(VtableUnboxedClosure(closure_def_id))
1585+
UnboxedClosureCandidate(closure_def_id, substs) => {
1586+
try!(self.confirm_unboxed_closure_candidate(obligation, closure_def_id, &substs));
1587+
Ok(VtableUnboxedClosure(closure_def_id, substs))
15881588
}
15891589
}
15901590
}

branches/auto/src/librustc/middle/traits/util.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,10 @@ impl<N:Repr> Repr for super::Vtable<N> {
311311
super::VtableImpl(ref v) =>
312312
v.repr(tcx),
313313

314-
super::VtableUnboxedClosure(ref d) =>
315-
format!("VtableUnboxedClosure({})",
316-
d.repr(tcx)),
314+
super::VtableUnboxedClosure(ref d, ref s) =>
315+
format!("VtableUnboxedClosure({},{})",
316+
d.repr(tcx),
317+
s.repr(tcx)),
317318

318319
super::VtableParam(ref v) =>
319320
format!("VtableParam({})", v.repr(tcx)),

branches/auto/src/librustc/middle/trans/callee.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,9 @@ pub fn trans_fn_ref_with_substs(
490490
};
491491

492492
// If this is an unboxed closure, redirect to it.
493-
match closure::get_or_create_declaration_if_unboxed_closure(bcx, def_id) {
493+
match closure::get_or_create_declaration_if_unboxed_closure(bcx,
494+
def_id,
495+
&substs) {
494496
None => {}
495497
Some(llfn) => return llfn,
496498
}

0 commit comments

Comments
 (0)