Skip to content

Commit 7cc56af

Browse files
committed
---
yaml --- r: 172655 b: refs/heads/auto c: ee1ca88 h: refs/heads/master i: 172653: d9e68f0 172651: 631a030 172647: ecf6832 172639: 58a3bf1 v: v3
1 parent 04aa18c commit 7cc56af

File tree

22 files changed

+157
-442
lines changed

22 files changed

+157
-442
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: e94a9f033eb79b3b4fb037722366644650e8e16c
13+
refs/heads/auto: ee1ca88213133a58f0a9d234f03babbebeb7c5d8
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/metadata/filesearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'a> FileSearch<'a> {
5454

5555
debug!("filesearch: searching lib path");
5656
let tlib_path = make_target_lib_path(self.sysroot,
57-
self.triple);
57+
self.triple);
5858
if !visited_dirs.contains(tlib_path.as_vec()) {
5959
match f(&tlib_path) {
6060
FileMatches => found = true,

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,14 +1186,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11861186
.is_ok()
11871187
})
11881188
}
1189-
(&BuiltinCandidate(_), &ParamCandidate(_)) => {
1190-
// If we have a where-clause like `Option<K> : Send`,
1191-
// then we wind up in a situation where there is a
1192-
// default rule (`Option<K>:Send if K:Send) and the
1193-
// where-clause that both seem applicable. Just take
1194-
// the where-clause in that case.
1195-
true
1196-
}
11971189
(&ProjectionCandidate, &ParamCandidate(_)) => {
11981190
// FIXME(#20297) -- this gives where clauses precedent
11991191
// over projections. Really these are just two means

branches/auto/src/librustc/session/search_paths.rs

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

1111
use std::slice;
1212

13-
#[derive(Clone, Show)]
13+
#[derive(Clone)]
1414
pub struct SearchPaths {
1515
paths: Vec<(PathKind, Path)>,
1616
}
@@ -20,7 +20,7 @@ pub struct Iter<'a> {
2020
iter: slice::Iter<'a, (PathKind, Path)>,
2121
}
2222

23-
#[derive(Eq, PartialEq, Clone, Copy, Show)]
23+
#[derive(Eq, PartialEq, Clone, Copy)]
2424
pub enum PathKind {
2525
Native,
2626
Crate,

branches/auto/src/librustc_driver/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn run_compiler(args: &[String]) {
186186
list_metadata(&sess, &(*ifile), &mut stdout).unwrap();
187187
}
188188
Input::Str(_) => {
189-
early_error("cannot list metadata for stdin");
189+
early_error("can not list metadata for stdin");
190190
}
191191
}
192192
return;

branches/auto/src/librustc_trans/trans/base.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,9 @@ pub fn iter_structural_ty<'blk, 'tcx, F>(cx: Block<'blk, 'tcx>,
702702
let mut cx = cx;
703703

704704
for (i, &arg) in variant.args.iter().enumerate() {
705-
let arg = monomorphize::apply_param_substs(tcx, substs, &arg);
706-
cx = f(cx, adt::trans_field_ptr(cx, repr, av, variant.disr_val, i), arg);
705+
cx = (*f)(cx,
706+
adt::trans_field_ptr(cx, repr, av, variant.disr_val, i),
707+
arg.subst(tcx, substs));
707708
}
708709
return cx;
709710
}

branches/auto/src/librustc_trans/trans/debuginfo.rs

Lines changed: 22 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -323,28 +323,26 @@ impl<'tcx> TypeMap<'tcx> {
323323
fn get_unique_type_id_of_type<'a>(&mut self, cx: &CrateContext<'a, 'tcx>,
324324
type_: Ty<'tcx>) -> UniqueTypeId {
325325

326-
// basic type -> {:name of the type:}
327-
// tuple -> {tuple_(:param-uid:)*}
328-
// struct -> {struct_:svh: / :node-id:_<(:param-uid:),*> }
329-
// enum -> {enum_:svh: / :node-id:_<(:param-uid:),*> }
330-
// enum variant -> {variant_:variant-name:_:enum-uid:}
331-
// reference (&) -> {& :pointee-uid:}
332-
// mut reference (&mut) -> {&mut :pointee-uid:}
333-
// ptr (*) -> {* :pointee-uid:}
334-
// mut ptr (*mut) -> {*mut :pointee-uid:}
335-
// unique ptr (~) -> {~ :pointee-uid:}
336-
// @-ptr (@) -> {@ :pointee-uid:}
337-
// sized vec ([T; x]) -> {[:size:] :element-uid:}
338-
// unsized vec ([T]) -> {[] :element-uid:}
339-
// trait (T) -> {trait_:svh: / :node-id:_<(:param-uid:),*> }
340-
// closure -> {<unsafe_> <once_> :store-sigil:
341-
// |(:param-uid:),* <,_...>| -> \
342-
// :return-type-uid: : (:bounds:)*}
343-
// function -> {<unsafe_> <abi_> fn( (:param-uid:)* <,_...> ) -> \
344-
// :return-type-uid:}
345-
// unique vec box (~[]) -> {HEAP_VEC_BOX<:pointee-uid:>}
346-
// gc box -> {GC_BOX<:pointee-uid:>}
347-
// projection (<T as U>::V) -> {<:ty-uid: as :trait-uid:> :: :name-uid: }
326+
// basic type -> {:name of the type:}
327+
// tuple -> {tuple_(:param-uid:)*}
328+
// struct -> {struct_:svh: / :node-id:_<(:param-uid:),*> }
329+
// enum -> {enum_:svh: / :node-id:_<(:param-uid:),*> }
330+
// enum variant -> {variant_:variant-name:_:enum-uid:}
331+
// reference (&) -> {& :pointee-uid:}
332+
// mut reference (&mut) -> {&mut :pointee-uid:}
333+
// ptr (*) -> {* :pointee-uid:}
334+
// mut ptr (*mut) -> {*mut :pointee-uid:}
335+
// unique ptr (~) -> {~ :pointee-uid:}
336+
// @-ptr (@) -> {@ :pointee-uid:}
337+
// sized vec ([T; x]) -> {[:size:] :element-uid:}
338+
// unsized vec ([T]) -> {[] :element-uid:}
339+
// trait (T) -> {trait_:svh: / :node-id:_<(:param-uid:),*> }
340+
// closure -> {<unsafe_> <once_> :store-sigil: |(:param-uid:),* <,_...>| -> \
341+
// :return-type-uid: : (:bounds:)*}
342+
// function -> {<unsafe_> <abi_> fn( (:param-uid:)* <,_...> ) -> \
343+
// :return-type-uid:}
344+
// unique vec box (~[]) -> {HEAP_VEC_BOX<:pointee-uid:>}
345+
// gc box -> {GC_BOX<:pointee-uid:>}
348346

349347
match self.type_to_unique_id.get(&type_).cloned() {
350348
Some(unique_type_id) => return unique_type_id,
@@ -437,25 +435,6 @@ impl<'tcx> TypeMap<'tcx> {
437435
principal.substs,
438436
&mut unique_type_id);
439437
},
440-
ty::ty_projection(ref projection) => {
441-
unique_type_id.push_str("<");
442-
443-
let self_ty = projection.trait_ref.self_ty();
444-
let self_type_id = self.get_unique_type_id_of_type(cx, self_ty);
445-
let self_type_id = self.get_unique_type_id_as_string(self_type_id);
446-
unique_type_id.push_str(&self_type_id[]);
447-
448-
unique_type_id.push_str(" as ");
449-
450-
from_def_id_and_substs(self,
451-
cx,
452-
projection.trait_ref.def_id,
453-
projection.trait_ref.substs,
454-
&mut unique_type_id);
455-
456-
unique_type_id.push_str(">::");
457-
unique_type_id.push_str(token::get_name(projection.item_name).get());
458-
},
459438
ty::ty_bare_fn(_, &ty::BareFnTy{ unsafety, abi, ref sig } ) => {
460439
if unsafety == ast::Unsafety::Unsafe {
461440
unique_type_id.push_str("unsafe ");
@@ -499,10 +478,7 @@ impl<'tcx> TypeMap<'tcx> {
499478
closure_ty,
500479
&mut unique_type_id);
501480
},
502-
ty::ty_err |
503-
ty::ty_infer(_) |
504-
ty::ty_open(_) |
505-
ty::ty_param(_) => {
481+
_ => {
506482
cx.sess().bug(&format!("get_unique_type_id_of_type() - unexpected type: {}, {:?}",
507483
&ppaux::ty_to_string(cx.tcx(), type_)[],
508484
type_.sty)[])
@@ -3879,22 +3855,10 @@ fn push_debuginfo_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
38793855
ty::ty_unboxed_closure(..) => {
38803856
output.push_str("closure");
38813857
}
3882-
ty::ty_projection(ref projection) => {
3883-
output.push_str("<");
3884-
let self_ty = projection.trait_ref.self_ty();
3885-
push_debuginfo_type_name(cx, self_ty, true, output);
3886-
3887-
output.push_str(" as ");
3888-
3889-
push_item_name(cx, projection.trait_ref.def_id, false, output);
3890-
push_type_params(cx, projection.trait_ref.substs, output);
3891-
3892-
output.push_str(">::");
3893-
output.push_str(token::get_name(projection.item_name).get());
3894-
}
38953858
ty::ty_err |
38963859
ty::ty_infer(_) |
38973860
ty::ty_open(_) |
3861+
ty::ty_projection(..) |
38983862
ty::ty_param(_) => {
38993863
cx.sess().bug(&format!("debuginfo: Trying to create type name for \
39003864
unexpected type: {}", ppaux::ty_to_string(cx.tcx(), t))[]);

branches/auto/src/librustc_trans/trans/monomorphize.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ pub fn monomorphic_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
274274
ast_map::NodeArg(..) |
275275
ast_map::NodeBlock(..) |
276276
ast_map::NodePat(..) |
277-
ast_map::NodeViewItem(..) |
278277
ast_map::NodeLocal(..) => {
279278
ccx.sess().bug(&format!("can't monomorphize a {:?}",
280279
map_node)[])

branches/auto/src/librustc_typeck/check/_match.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,6 @@ pub fn check_struct_pat_fields<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>,
619619
}
620620
};
621621

622-
let field_type = pcx.fcx.normalize_associated_types_in(span, &field_type);
623-
624622
check_pat(pcx, &*field.pat, field_type);
625623
}
626624

branches/auto/src/librustc_typeck/check/mod.rs

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,34 +2289,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
22892289

22902290
obligations.map_move(|o| self.register_predicate(o));
22912291
}
2292-
2293-
// Only for fields! Returns <none> for methods>
2294-
// Indifferent to privacy flags
2295-
pub fn lookup_field_ty(&self,
2296-
span: Span,
2297-
class_id: ast::DefId,
2298-
items: &[ty::field_ty],
2299-
fieldname: ast::Name,
2300-
substs: &subst::Substs<'tcx>)
2301-
-> Option<Ty<'tcx>>
2302-
{
2303-
let o_field = items.iter().find(|f| f.name == fieldname);
2304-
o_field.map(|f| ty::lookup_field_type(self.tcx(), class_id, f.id, substs))
2305-
.map(|t| self.normalize_associated_types_in(span, &t))
2306-
}
2307-
2308-
pub fn lookup_tup_field_ty(&self,
2309-
span: Span,
2310-
class_id: ast::DefId,
2311-
items: &[ty::field_ty],
2312-
idx: uint,
2313-
substs: &subst::Substs<'tcx>)
2314-
-> Option<Ty<'tcx>>
2315-
{
2316-
let o_field = if idx < items.len() { Some(&items[idx]) } else { None };
2317-
o_field.map(|f| ty::lookup_field_type(self.tcx(), class_id, f.id, substs))
2318-
.map(|t| self.normalize_associated_types_in(span, &t))
2319-
}
23202292
}
23212293

23222294
impl<'a, 'tcx> RegionScope for FnCtxt<'a, 'tcx> {
@@ -3071,6 +3043,30 @@ pub fn impl_self_ty<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
30713043
TypeAndSubsts { substs: substs, ty: substd_ty }
30723044
}
30733045

3046+
// Only for fields! Returns <none> for methods>
3047+
// Indifferent to privacy flags
3048+
pub fn lookup_field_ty<'tcx>(tcx: &ty::ctxt<'tcx>,
3049+
class_id: ast::DefId,
3050+
items: &[ty::field_ty],
3051+
fieldname: ast::Name,
3052+
substs: &subst::Substs<'tcx>)
3053+
-> Option<Ty<'tcx>> {
3054+
3055+
let o_field = items.iter().find(|f| f.name == fieldname);
3056+
o_field.map(|f| ty::lookup_field_type(tcx, class_id, f.id, substs))
3057+
}
3058+
3059+
pub fn lookup_tup_field_ty<'tcx>(tcx: &ty::ctxt<'tcx>,
3060+
class_id: ast::DefId,
3061+
items: &[ty::field_ty],
3062+
idx: uint,
3063+
substs: &subst::Substs<'tcx>)
3064+
-> Option<Ty<'tcx>> {
3065+
3066+
let o_field = if idx < items.len() { Some(&items[idx]) } else { None };
3067+
o_field.map(|f| ty::lookup_field_type(tcx, class_id, f.id, substs))
3068+
}
3069+
30743070
// Controls whether the arguments are automatically referenced. This is useful
30753071
// for overloaded binary and unary operators.
30763072
#[derive(Copy, PartialEq)]
@@ -3534,8 +3530,8 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
35343530
ty::ty_struct(base_id, substs) => {
35353531
debug!("struct named {}", ppaux::ty_to_string(tcx, base_t));
35363532
let fields = ty::lookup_struct_fields(tcx, base_id);
3537-
fcx.lookup_field_ty(expr.span, base_id, &fields[],
3538-
field.node.name, &(*substs))
3533+
lookup_field_ty(tcx, base_id, &fields[],
3534+
field.node.name, &(*substs))
35393535
}
35403536
_ => None
35413537
}
@@ -3597,8 +3593,8 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
35973593
if tuple_like {
35983594
debug!("tuple struct named {}", ppaux::ty_to_string(tcx, base_t));
35993595
let fields = ty::lookup_struct_fields(tcx, base_id);
3600-
fcx.lookup_tup_field_ty(expr.span, base_id, &fields[],
3601-
idx.node, &(*substs))
3596+
lookup_tup_field_ty(tcx, base_id, &fields[],
3597+
idx.node, &(*substs))
36023598
} else {
36033599
None
36043600
}

branches/auto/src/libstd/rt/util.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,56 @@ pub fn abort(args: fmt::Arguments) -> ! {
144144
let _ = write!(&mut w, "{}", args);
145145
let msg = str::from_utf8(&w.buf[0..w.pos]).unwrap_or("aborted");
146146
let msg = if msg.is_empty() {"aborted"} else {msg};
147+
148+
// Give some context to the message
149+
let hash = msg.bytes().fold(0, |accum, val| accum + (val as uint) );
150+
let quote = match hash % 10 {
151+
0 => "
152+
It was from the artists and poets that the pertinent answers came, and I
153+
know that panic would have broken loose had they been able to compare notes.
154+
As it was, lacking their original letters, I half suspected the compiler of
155+
having asked leading questions, or of having edited the correspondence in
156+
corroboration of what he had latently resolved to see.",
157+
1 => "
158+
There are not many persons who know what wonders are opened to them in the
159+
stories and visions of their youth; for when as children we listen and dream,
160+
we think but half-formed thoughts, and when as men we try to remember, we are
161+
dulled and prosaic with the poison of life. But some of us awake in the night
162+
with strange phantasms of enchanted hills and gardens, of fountains that sing
163+
in the sun, of golden cliffs overhanging murmuring seas, of plains that stretch
164+
down to sleeping cities of bronze and stone, and of shadowy companies of heroes
165+
that ride caparisoned white horses along the edges of thick forests; and then
166+
we know that we have looked back through the ivory gates into that world of
167+
wonder which was ours before we were wise and unhappy.",
168+
2 => "
169+
Instead of the poems I had hoped for, there came only a shuddering blackness
170+
and ineffable loneliness; and I saw at last a fearful truth which no one had
171+
ever dared to breathe before — the unwhisperable secret of secrets — The fact
172+
that this city of stone and stridor is not a sentient perpetuation of Old New
173+
York as London is of Old London and Paris of Old Paris, but that it is in fact
174+
quite dead, its sprawling body imperfectly embalmed and infested with queer
175+
animate things which have nothing to do with it as it was in life.",
176+
3 => "
177+
The ocean ate the last of the land and poured into the smoking gulf, thereby
178+
giving up all it had ever conquered. From the new-flooded lands it flowed
179+
again, uncovering death and decay; and from its ancient and immemorial bed it
180+
trickled loathsomely, uncovering nighted secrets of the years when Time was
181+
young and the gods unborn. Above the waves rose weedy remembered spires. The
182+
moon laid pale lilies of light on dead London, and Paris stood up from its damp
183+
grave to be sanctified with star-dust. Then rose spires and monoliths that were
184+
weedy but not remembered; terrible spires and monoliths of lands that men never
185+
knew were lands...",
186+
4 => "
187+
There was a night when winds from unknown spaces whirled us irresistibly into
188+
limitless vacuum beyond all thought and entity. Perceptions of the most
189+
maddeningly untransmissible sort thronged upon us; perceptions of infinity
190+
which at the time convulsed us with joy, yet which are now partly lost to my
191+
memory and partly incapable of presentation to others.",
192+
_ => "You've met with a terrible fate, haven't you?"
193+
};
194+
rterrln!("{}", "");
195+
rterrln!("{}", quote);
196+
rterrln!("{}", "");
147197
rterrln!("fatal runtime error: {}", msg);
148198
unsafe { intrinsics::abort(); }
149199
}

branches/auto/src/libstd/sys/windows/condvar.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ impl Condvar {
2727

2828
#[inline]
2929
pub unsafe fn wait(&self, mutex: &Mutex) {
30-
let r = ffi::SleepConditionVariableCS(self.inner.get(),
31-
mutex::raw(mutex),
32-
libc::INFINITE);
30+
let r = ffi::SleepConditionVariableSRW(self.inner.get(),
31+
mutex::raw(mutex),
32+
libc::INFINITE,
33+
0);
3334
debug_assert!(r != 0);
3435
}
3536

3637
pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool {
37-
let r = ffi::SleepConditionVariableCS(self.inner.get(),
38-
mutex::raw(mutex),
39-
dur.num_milliseconds() as DWORD);
38+
let r = ffi::SleepConditionVariableSRW(self.inner.get(),
39+
mutex::raw(mutex),
40+
dur.num_milliseconds() as DWORD,
41+
0);
4042
if r == 0 {
4143
const ERROR_TIMEOUT: DWORD = 0x5B4;
4244
debug_assert_eq!(os::errno() as uint, ERROR_TIMEOUT as uint);

0 commit comments

Comments
 (0)