Skip to content

Commit ed8c7a5

Browse files
committed
---
yaml --- r: 50653 b: refs/heads/try c: 9c32de5 h: refs/heads/master i: 50651: 092f2d9 v: v3
1 parent 5749a7e commit ed8c7a5

File tree

9 files changed

+115
-228
lines changed

9 files changed

+115
-228
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
5-
refs/heads/try: 4d8ddff52a60d3785052f1e0a231cb95c98fdc24
5+
refs/heads/try: 9c32de59acc898746806053acee0674fda3d15da
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/RELEASES.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Version 0.6 (March 2013)
1010
* Remove `static` keyword
1111
* Static method syntax
1212
* `as Trait`
13-
* `copy` removed?
13+
* `copy` removed, replaced with `Clone`?
14+
* `std::map` removed, replaced with `core::hashmap`
1415

1516
* Syntax changes
1617
* The self type parameter in traits is now spelled `Self`
@@ -38,7 +39,8 @@ Version 0.6 (March 2013)
3839
* Trait implementations no longer support visibility modifiers
3940

4041
* Semantic changes
41-
* Linear types move by default, eliminating the `move` keyword
42+
* Types with owned pointers or custom destructors move by default,
43+
eliminating the `move` keyword
4244
* All foreign functions are considered unsafe
4345
* &mut is now unaliasable
4446
* Writes to borrowed @mut pointers are prevented dynamically
@@ -57,16 +59,19 @@ Version 0.6 (March 2013)
5759
improve inference and eliminate unsoundness
5860

5961
* Libraries
60-
* Lots of effort to organize the container API's around `core::container`
61-
* `core::send_map` renamed to `core::hashmap`
6262
* Added big integers to `std::bigint`
6363
* Removed `core::oldcomm` module
6464
* Added pipe-based `core::comm` module
65-
* Reimplemented `std::treemap`
6665
* Numeric traits have been reorganized under `core::num`
67-
* `core::dvec` removed. Use `@mut ~[T]` or other language types
6866
* `vec::slice` finally returns a slice
6967
* `debug!` and friends don't require a format string, e.g. `debug!(Foo)`
68+
* Containers reorganized around traits in `core::container`
69+
* `core::dvec` removed, `~[T]` is a drop-in replacement
70+
* `core::send_map` renamed to `core::hashmap`
71+
* `std::treemap` reimplemented as an owned balanced tree
72+
* `std::deque` and `std::smallintmap` reimplemented as owned containers
73+
* `core::trie` added as a fast ordered map for integer keys
74+
* Set types added to `core::hashmap`, `core::trie` and `std::treemap`
7075

7176
* Tools
7277
* Replaced the 'cargo' package manager with 'rustpkg'

branches/try/mk/tests.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,6 @@ ifeq ($(CFG_GDB),)
386386
CTEST_DISABLE_debuginfo = "no gdb found"
387387
endif
388388

389-
ifeq ($(CFG_OSTYPE),apple-darwin)
390-
CTEST_DISABLE_debuginfo = "gdb on darwing needs root"
391-
endif
392-
393389
define DEF_CTEST_VARS
394390

395391
# All the per-stage build rules you might want to call from the

branches/try/src/compiletest/runtest.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,6 @@ actual:\n\
225225
}
226226

227227
fn run_debuginfo_test(config: config, props: TestProps, testfile: &Path) {
228-
// do not optimize debuginfo tests
229-
let config = match config.rustcflags {
230-
Some(flags) => config {
231-
rustcflags: Some(str::replace(flags, ~"-O", ~"")),
232-
.. config
233-
},
234-
None => config
235-
};
236-
237228
// compile test file (it shoud have 'compile-flags:-g' in the header)
238229
let mut ProcRes = compile_test(config, props, testfile);
239230
if ProcRes.status != 0 {
@@ -276,8 +267,8 @@ fn run_debuginfo_test(config: config, props: TestProps, testfile: &Path) {
276267
}
277268
}
278269
if i != num_check_lines {
279-
fatal_ProcRes(fmt!("line not found in debugger output: %s"
280-
props.check_lines[i]), ProcRes);
270+
fatal(fmt!("line not found in debugger output: %s",
271+
props.check_lines[i]));
281272
}
282273
}
283274
}

branches/try/src/librustc/middle/trans/debuginfo.rs

Lines changed: 86 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -356,31 +356,7 @@ fn create_basic_type(cx: @CrateContext, t: ty::t, span: span)
356356
option::None => ()
357357
}
358358

359-
let (name, encoding) = match ty::get(t).sty {
360-
ty::ty_nil | ty::ty_bot => (~"uint", DW_ATE_unsigned),
361-
ty::ty_bool => (~"bool", DW_ATE_boolean),
362-
ty::ty_int(int_ty) => match int_ty {
363-
ast::ty_i => (~"int", DW_ATE_signed),
364-
ast::ty_char => (~"char", DW_ATE_signed_char),
365-
ast::ty_i8 => (~"i8", DW_ATE_signed),
366-
ast::ty_i16 => (~"i16", DW_ATE_signed),
367-
ast::ty_i32 => (~"i32", DW_ATE_signed),
368-
ast::ty_i64 => (~"i64", DW_ATE_signed)
369-
},
370-
ty::ty_uint(uint_ty) => match uint_ty {
371-
ast::ty_u => (~"uint", DW_ATE_unsigned),
372-
ast::ty_u8 => (~"u8", DW_ATE_unsigned),
373-
ast::ty_u16 => (~"i16", DW_ATE_unsigned),
374-
ast::ty_u32 => (~"u32", DW_ATE_unsigned),
375-
ast::ty_u64 => (~"u64", DW_ATE_unsigned)
376-
},
377-
ty::ty_float(float_ty) => match float_ty {
378-
ast::ty_f => (~"float", DW_ATE_float),
379-
ast::ty_f32 => (~"f32", DW_ATE_float),
380-
ast::ty_f64 => (~"f64", DW_ATE_float)
381-
},
382-
_ => cx.sess.bug(~"debuginfo::create_basic_type - t is invalid type")
383-
};
359+
let (name, encoding) = (~"uint", DW_ATE_unsigned);
384360

385361
let fname = filename_from_span(cx, span);
386362
let file_node = create_file(cx, fname);
@@ -497,53 +473,6 @@ fn add_member(cx: @mut StructCtxt,
497473
cx.total_size += size * 8;
498474
}
499475

500-
fn create_struct(cx: @CrateContext, t: ty::t, fields: ~[ty::field],
501-
span: span) -> @Metadata<TyDescMetadata> {
502-
let fname = filename_from_span(cx, span);
503-
let file_node = create_file(cx, fname);
504-
let scx = create_structure(file_node, @ty_to_str(cx.tcx, t),
505-
line_from_span(cx.sess.codemap, span) as int);
506-
for fields.each |field| {
507-
let field_t = field.mt.ty;
508-
let ty_md = create_ty(cx, field_t, span);
509-
let (size, align) = size_and_align_of(cx, field_t);
510-
add_member(scx, *cx.sess.str_of(field.ident),
511-
line_from_span(cx.sess.codemap, span) as int,
512-
size as int, align as int, ty_md.node);
513-
}
514-
let mdval = @Metadata {
515-
node: finish_structure(scx),
516-
data: TyDescMetadata {
517-
hash: ty::type_id(t)
518-
}
519-
};
520-
return mdval;
521-
}
522-
523-
fn create_tuple(cx: @CrateContext, t: ty::t, elements: ~[ty::t], span: span)
524-
-> @Metadata<TyDescMetadata> {
525-
let fname = filename_from_span(cx, span);
526-
let file_node = create_file(cx, fname);
527-
let scx = create_structure(file_node,
528-
cx.sess.str_of(
529-
((/*bad*/copy cx.dbg_cx).get().names)
530-
(~"tuple")),
531-
line_from_span(cx.sess.codemap, span) as int);
532-
for elements.each |element| {
533-
let ty_md = create_ty(cx, *element, span);
534-
let (size, align) = size_and_align_of(cx, *element);
535-
add_member(scx, ~"", line_from_span(cx.sess.codemap, span) as int,
536-
size as int, align as int, ty_md.node);
537-
}
538-
let mdval = @Metadata {
539-
node: finish_structure(scx),
540-
data: TyDescMetadata {
541-
hash: ty::type_id(t)
542-
}
543-
};
544-
return mdval;
545-
}
546-
547476
fn create_boxed_type(cx: @CrateContext, outer: ty::t, _inner: ty::t,
548477
span: span, boxed: @Metadata<TyDescMetadata>)
549478
-> @Metadata<TyDescMetadata> {
@@ -609,10 +538,11 @@ fn create_composite_type(type_tag: int, name: &str, file: ValueRef,
609538
}
610539

611540
fn create_vec(cx: @CrateContext, vec_t: ty::t, elem_t: ty::t,
612-
vec_ty_span: codemap::span) -> @Metadata<TyDescMetadata> {
541+
vec_ty_span: codemap::span, elem_ty: @ast::Ty)
542+
-> @Metadata<TyDescMetadata> {
613543
let fname = filename_from_span(cx, vec_ty_span);
614544
let file_node = create_file(cx, fname);
615-
let elem_ty_md = create_ty(cx, elem_t, vec_ty_span);
545+
let elem_ty_md = create_ty(cx, elem_t, elem_ty);
616546
let scx = create_structure(file_node,
617547
@/*bad*/ copy ty_to_str(cx.tcx, vec_t), 0);
618548
let size_t_type = create_basic_type(cx, ty::mk_uint(cx.tcx), vec_ty_span);
@@ -637,60 +567,94 @@ fn create_vec(cx: @CrateContext, vec_t: ty::t, elem_t: ty::t,
637567
}
638568
}
639569

640-
fn create_ty(cx: @CrateContext, t: ty::t, span: span)
570+
fn create_ty(_cx: @CrateContext, _t: ty::t, _ty: @ast::Ty)
641571
-> @Metadata<TyDescMetadata> {
642-
debug!("create_ty: %?", ty::get(t));
643572
/*let cache = get_cache(cx);
644573
match cached_metadata::<@Metadata<TyDescMetadata>>(
645574
cache, tg, {|md| t == md.data.hash}) {
646575
option::Some(md) { return md; }
647576
option::None {}
648577
}*/
649578

650-
let sty = copy ty::get(t).sty;
651-
match copy sty {
652-
ty::ty_nil | ty::ty_bot | ty::ty_bool | ty::ty_int(_) | ty::ty_uint(_)
653-
| ty::ty_float(_) => create_basic_type(cx, t, span),
654-
ty::ty_estr(_vstore) => {
655-
cx.sess.span_bug(span, ~"debuginfo for estr NYI")
656-
},
657-
ty::ty_enum(_did, _substs) => {
658-
cx.sess.span_bug(span, ~"debuginfo for enum NYI")
659-
}
660-
ty::ty_box(_mt) => {
661-
cx.sess.span_bug(span, ~"debuginfo for box NYI")
662-
},
663-
ty::ty_uniq(_mt) => {
664-
cx.sess.span_bug(span, ~"debuginfo for uniq NYI")
665-
},
666-
ty::ty_evec(_mt, _vstore) => {
667-
cx.sess.span_bug(span, ~"debuginfo for evec NYI")
668-
},
669-
ty::ty_ptr(mt) => {
670-
let pointee = create_ty(cx, mt.ty, span);
671-
create_pointer_type(cx, t, span, pointee)
672-
},
673-
ty::ty_rptr(_region, _mt) => {
674-
cx.sess.span_bug(span, ~"debuginfo for rptr NYI")
675-
},
676-
ty::ty_bare_fn(_barefnty) => {
677-
cx.sess.span_bug(span, ~"debuginfo for bare_fn NYI")
678-
},
679-
ty::ty_closure(_closurety) => {
680-
cx.sess.span_bug(span, ~"debuginfo for closure NYI")
681-
},
682-
ty::ty_trait(_did, _substs, _vstore) => {
683-
cx.sess.span_bug(span, ~"debuginfo for trait NYI")
684-
},
685-
ty::ty_struct(did, substs) => {
686-
let fields = ty::struct_fields(cx.tcx, did, &substs);
687-
create_struct(cx, t, fields, span)
688-
},
689-
ty::ty_tup(elements) => {
690-
create_tuple(cx, t, elements, span)
691-
},
692-
_ => cx.sess.bug(~"debuginfo: unexpected type in create_ty")
579+
/* FIXME (#2012): disabled this code as part of the patch that moves
580+
* recognition of named builtin types into resolve. I tried to fix
581+
* it, but it seems to already be broken -- it's only called when
582+
* --xg is given, and compiling with --xg fails on trivial programs.
583+
*
584+
* Generating an ast::ty from a ty::t seems like it should not be
585+
* needed. It is only done to track spans, but you will not get the
586+
* right spans anyway -- types tend to refer to stuff defined
587+
* elsewhere, not be self-contained.
588+
*/
589+
590+
fail!();
591+
/*
592+
fn t_to_ty(cx: CrateContext, t: ty::t, span: span) -> @ast::ty {
593+
let ty = match ty::get(t).struct {
594+
ty::ty_nil { ast::ty_nil }
595+
ty::ty_bot { ast::ty_bot }
596+
ty::ty_bool { ast::ty_bool }
597+
ty::ty_int(t) { ast::ty_int(t) }
598+
ty::ty_float(t) { ast::ty_float(t) }
599+
ty::ty_uint(t) { ast::ty_uint(t) }
600+
ty::ty_box(mt) { ast::ty_box({ty: t_to_ty(cx, mt.ty, span),
601+
mutbl: mt.mutbl}) }
602+
ty::ty_uniq(mt) { ast::ty_uniq({ty: t_to_ty(cx, mt.ty, span),
603+
mutbl: mt.mutbl}) }
604+
ty::ty_vec(mt) { ast::ty_vec({ty: t_to_ty(cx, mt.ty, span),
605+
mutbl: mt.mutbl}) }
606+
_ {
607+
cx.sess.span_bug(span, "t_to_ty: Can't handle this type");
608+
}
609+
};
610+
return @{node: ty, span: span};
693611
}
612+
613+
match ty.node {
614+
ast::ty_box(mt) {
615+
let inner_t = match ty::get(t).struct {
616+
ty::ty_box(boxed) { boxed.ty }
617+
_ { cx.sess.span_bug(ty.span, "t_to_ty was incoherent"); }
618+
};
619+
let md = create_ty(cx, inner_t, mt.ty);
620+
let box = create_boxed_type(cx, t, inner_t, ty.span, md);
621+
return create_pointer_type(cx, t, ty.span, box);
622+
}
623+
624+
ast::ty_uniq(mt) {
625+
let inner_t = match ty::get(t).struct {
626+
ty::ty_uniq(boxed) { boxed.ty }
627+
// Hoping we'll have a way to eliminate this check soon.
628+
_ { cx.sess.span_bug(ty.span, "t_to_ty was incoherent"); }
629+
};
630+
let md = create_ty(cx, inner_t, mt.ty);
631+
return create_pointer_type(cx, t, ty.span, md);
632+
}
633+
634+
ast::ty_infer {
635+
let inferred = t_to_ty(cx, t, ty.span);
636+
return create_ty(cx, t, inferred);
637+
}
638+
639+
ast::ty_vec(mt) {
640+
let inner_t = ty::sequence_element_type(cx.tcx, t);
641+
let inner_ast_t = t_to_ty(cx, inner_t, mt.ty.span);
642+
let v = create_vec(cx, t, inner_t, ty.span, inner_ast_t);
643+
return create_pointer_type(cx, t, ty.span, v);
644+
}
645+
646+
ast::ty_path(_, id) {
647+
match cx.tcx.def_map.get(id) {
648+
ast::def_prim_ty(pty) {
649+
return create_basic_type(cx, t, pty, ty.span);
650+
}
651+
_ {}
652+
}
653+
}
654+
655+
_ {}
656+
};
657+
*/
694658
}
695659

696660
fn filename_from_span(cx: @CrateContext, sp: codemap::span) -> ~str {
@@ -729,7 +693,7 @@ pub fn create_local_var(bcx: block, local: @ast::local)
729693
};
730694
let loc = cx.sess.codemap.lookup_char_pos(local.span.lo);
731695
let ty = node_id_type(bcx, local.node.id);
732-
let tymd = create_ty(cx, ty, local.node.ty.span);
696+
let tymd = create_ty(cx, ty, local.node.ty);
733697
let filemd = create_file(cx, /*bad*/copy loc.file.name);
734698
let context = match bcx.parent {
735699
None => create_function(bcx.fcx).node,
@@ -779,11 +743,8 @@ pub fn create_arg(bcx: block, arg: ast::arg, sp: span)
779743
}
780744
781745
let loc = cx.sess.codemap.lookup_char_pos(sp.lo);
782-
if loc.file.name == ~"<intrinsic>" {
783-
return None;
784-
}
785746
let ty = node_id_type(bcx, arg.id);
786-
let tymd = create_ty(cx, ty, arg.ty.span);
747+
let tymd = create_ty(cx, ty, arg.ty);
787748
let filemd = create_file(cx, /*bad*/copy loc.file.name);
788749
let context = create_function(bcx.fcx);
789750
@@ -895,8 +856,7 @@ pub fn create_function(fcx: fn_ctxt) -> @Metadata<SubProgramMetadata> {
895856
let ty_node = if cx.sess.opts.extra_debuginfo {
896857
match ret_ty.node {
897858
ast::ty_nil => llnull(),
898-
_ => create_ty(cx, ty::node_id_to_type(cx.tcx, id),
899-
ret_ty.span).node
859+
_ => create_ty(cx, ty::node_id_to_type(cx.tcx, id), ret_ty).node
900860
}
901861
} else {
902862
llnull()

branches/try/src/libuv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 218ab86721eefd7b7e97fa6d9f95a80a1fa8686c
1+
Subproject commit 576ab1db8ea03889eb7b2274654afe7c5c867230

0 commit comments

Comments
 (0)