Skip to content

Commit 033d81e

Browse files
committed
---
yaml --- r: 42878 b: refs/heads/try c: 53688ad h: refs/heads/master v: v3
1 parent acfb31f commit 033d81e

Some content is hidden

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

77 files changed

+448
-421
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: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5-
refs/heads/try: 6fb4239bb361a927582a8ffd53a2ae649d810fdf
5+
refs/heads/try: 53688addaa4484f1a317bb0938cf453381810427
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/doc/rust.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,9 @@ mod quux {
851851

852852
In this example, the module `quux` re-exports all of the public names defined in `foo`.
853853

854+
Also note that the paths contained in `use` items are relative to the crate root; so, in the previous
855+
example, the use refers to `quux::foo::*`, and not simply to `foo::*`.
856+
854857
### Functions
855858

856859
A _function item_ defines a sequence of [statements](#statements) and an optional final [expression](#expressions), along with a name and a set of parameters.

branches/try/mk/target.mk

Lines changed: 0 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
# $(2) is the target triple
1515
# $(3) is the host triple
1616

17-
# If you are making non-backwards compatible changes to the runtime
18-
# (resp. corelib), set this flag to 1. It will cause stage1 to use
19-
# the snapshot runtime (resp. corelib) rather than the runtime
20-
# (resp. corelib) from the working directory.
21-
USE_SNAPSHOT_RUNTIME=0
22-
USE_SNAPSHOT_CORELIB=0
23-
USE_SNAPSHOT_STDLIB=0
2417

2518
define TARGET_STAGE_N
2619

@@ -59,86 +52,17 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX): \
5952
@$$(call E, compile_and_link: $$@)
6053
$$(STAGE$(1)_T_$(2)_H_$(3)) $(BORROWCK) -o $$@ $$< && touch $$@
6154

62-
endef
63-
64-
# The stage0 (snapshot) compiler produces binaries that expect the
65-
# snapshot runtime. Normally the working directory runtime and
66-
# snapshot runtime are compatible, so this is no problem. But
67-
# sometimes we want to make non-backwards-compatible changes. In
68-
# those cases, the stage1 compiler and libraries (which are produced
69-
# by stage0) should use the runtime from the snapshot. The stage2
70-
# compiler and libraries (which are produced by stage1) will be the
71-
# first that are expecting to run against the runtime as defined in
72-
# the working directory.
73-
#
74-
# The catch is that you may not add new functions to the runtime
75-
# in this case!
76-
#
77-
# Arguments are the same as for TARGET_BASE_STAGE_N
78-
define TARGET_RT_FROM_SNAPSHOT
79-
80-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUNTIME): \
81-
$$(HLIB$(1)_H_$(3))/$$(CFG_RUNTIME)
82-
@$$(call E, cp: $$@)
83-
$$(Q)cp $$< $$@
84-
85-
endef
86-
87-
# This rule copies from the runtime for the working directory. It
88-
# applies to targets produced by stage1 or later. See comment on
89-
# previous rule.
90-
#
91-
# Arguments are the same as for TARGET_BASE_STAGE_N
92-
define TARGET_RT_FROM_WD
93-
9455
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUNTIME): \
9556
rt/$(2)/$$(CFG_RUNTIME)
9657
@$$(call E, cp: $$@)
9758
$$(Q)cp $$< $$@
9859

99-
endef
100-
101-
# As above, but builds the corelib either by taking it out of the
102-
# snapshot or from the working directory.
103-
104-
define TARGET_CORELIB_FROM_SNAPSHOT
105-
106-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB): \
107-
$$(HLIB$(1)_H_$(3))/$$(CFG_CORELIB) \
108-
$$(CORELIB_INPUTS) \
109-
$$(TSREQ$(1)_T_$(2)_H_$(3))
110-
@$$(call E, cp: $$@)
111-
$$(Q)cp $$< $$@
112-
$$(Q)cp $$(HLIB$(1)_H_$(3))/$$(CORELIB_GLOB) \
113-
$$(TLIB$(1)_T_$(2)_H_$(3))
114-
115-
endef
116-
117-
define TARGET_CORELIB_FROM_WD
118-
11960
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB): \
12061
$$(CORELIB_CRATE) $$(CORELIB_INPUTS) \
12162
$$(TSREQ$(1)_T_$(2)_H_$(3))
12263
@$$(call E, compile_and_link: $$@)
12364
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
12465

125-
endef
126-
127-
define TARGET_STDLIB_FROM_SNAPSHOT
128-
129-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB): \
130-
$$(HLIB$(1)_H_$(3))/$$(CFG_STDLIB) \
131-
$$(STDLIB_INPUTS) \
132-
$$(TSREQ$(1)_T_$(2)_H_$(3))
133-
@$$(call E, cp: $$@)
134-
$$(Q)cp $$< $$@
135-
$$(Q)cp $$(HLIB$(1)_H_$(3))/$$(STDLIB_GLOB) \
136-
$$(TLIB$(1)_T_$(2)_H_$(3))
137-
138-
endef
139-
140-
define TARGET_STDLIB_FROM_WD
141-
14266
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB): \
14367
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
14468
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB) \
@@ -155,52 +79,3 @@ $(foreach source,$(CFG_TARGET_TRIPLES), \
15579
$(eval $(call TARGET_STAGE_N,1,$(target),$(source))) \
15680
$(eval $(call TARGET_STAGE_N,2,$(target),$(source))) \
15781
$(eval $(call TARGET_STAGE_N,3,$(target),$(source)))))
158-
159-
# Host triple either uses the snapshot runtime or runtime from
160-
# working directory, depending on the USE_SNAPSHOT_RUNTIME var.
161-
ifeq ($(USE_SNAPSHOT_RUNTIME),1)
162-
$(foreach src,$(CFG_HOST_TRIPLE),\
163-
$(eval $(call TARGET_RT_FROM_SNAPSHOT,0,$(src),$(src))))
164-
else
165-
$(foreach src,$(CFG_HOST_TRIPLE),\
166-
$(eval $(call TARGET_RT_FROM_WD,0,$(src),$(src))))
167-
endif
168-
169-
ifeq ($(USE_SNAPSHOT_CORELIB),1)
170-
$(foreach src,$(CFG_HOST_TRIPLE),\
171-
$(eval $(call TARGET_CORELIB_FROM_SNAPSHOT,0,$(src),$(src))))
172-
else
173-
$(foreach src,$(CFG_HOST_TRIPLE),\
174-
$(eval $(call TARGET_CORELIB_FROM_WD,0,$(src),$(src))))
175-
endif
176-
177-
ifeq ($(USE_SNAPSHOT_STDLIB),1)
178-
$(foreach src,$(CFG_HOST_TRIPLE),\
179-
$(eval $(call TARGET_STDLIB_FROM_SNAPSHOT,0,$(src),$(src))))
180-
else
181-
$(foreach src,$(CFG_HOST_TRIPLE),\
182-
$(eval $(call TARGET_STDLIB_FROM_WD,0,$(src),$(src))))
183-
endif
184-
185-
# Non-host triples build the stage0 runtime from the working directory
186-
$(foreach source,$(CFG_TARGET_TRIPLES), \
187-
$(foreach target,$(NON_HOST_TRIPLES), \
188-
$(eval $(call TARGET_RT_FROM_WD,0,$(target),$(source))) \
189-
$(eval $(call TARGET_CORELIB_FROM_WD,0,$(target),$(source))) \
190-
$(eval $(call TARGET_STDLIB_FROM_WD,0,$(target),$(source))) \
191-
))
192-
193-
# After stage0, always build the stage0 runtime from the working directory
194-
$(foreach source,$(CFG_TARGET_TRIPLES), \
195-
$(foreach target,$(CFG_TARGET_TRIPLES), \
196-
$(eval $(call TARGET_RT_FROM_WD,1,$(target),$(source))) \
197-
$(eval $(call TARGET_RT_FROM_WD,2,$(target),$(source))) \
198-
$(eval $(call TARGET_RT_FROM_WD,3,$(target),$(source))) \
199-
$(eval $(call TARGET_CORELIB_FROM_WD,1,$(target),$(source))) \
200-
$(eval $(call TARGET_CORELIB_FROM_WD,2,$(target),$(source))) \
201-
$(eval $(call TARGET_CORELIB_FROM_WD,3,$(target),$(source))) \
202-
$(eval $(call TARGET_STDLIB_FROM_WD,1,$(target),$(source))) \
203-
$(eval $(call TARGET_STDLIB_FROM_WD,2,$(target),$(source))) \
204-
$(eval $(call TARGET_STDLIB_FROM_WD,3,$(target),$(source))) \
205-
))
206-

branches/try/src/libcargo/cargo.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ pub fn parse_source(name: ~str, j: &json::Json) -> @Source {
460460
json::Object(j) => {
461461
let mut url = match j.find(&~"url") {
462462
Some(&json::String(u)) => copy u,
463-
_ => die!(~"needed 'url' field in source")
463+
_ => fail ~"needed 'url' field in source"
464464
};
465465
let method = match j.find(&~"method") {
466466
Some(&json::String(u)) => copy u,

branches/try/src/libcore/dvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl<A> DVec<A> {
179179
let mut data = cast::reinterpret_cast(&null::<()>());
180180
data <-> self.data;
181181
let data_ptr: *() = cast::reinterpret_cast(&data);
182-
if data_ptr.is_null() { die!(~"Recursive use of dvec"); }
182+
if data_ptr.is_null() { fail ~"Recursive use of dvec"; }
183183
self.data = move ~[move t];
184184
self.data.push_all_move(move data);
185185
}

branches/try/src/libcore/hashmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ pub mod linear {
386386
pure fn get(&self, k: &K) -> &self/V {
387387
match self.find(k) {
388388
Some(v) => v,
389-
None => die!(fmt!("No entry found for key: %?", k)),
389+
None => fail fmt!("No entry found for key: %?", k),
390390
}
391391
}
392392
}

branches/try/src/libcore/pipes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ impl<T:Owned,Tbuffer:Owned> SendPacketBuffered<T,Tbuffer> {
10201020
//forget(packet);
10211021
header
10221022
},
1023-
None => die!(~"packet already consumed")
1023+
None => fail ~"packet already consumed"
10241024
}
10251025
}
10261026

branches/try/src/libcore/task/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ fn test_spawn_linked_sup_fail_up() { // child fails; parent fails
733733
can_not_copy: None,
734734
.. b0
735735
};
736-
do b1.spawn { die!(); }
736+
do b1.spawn { fail; }
737737
po.recv(); // We should get punted awake
738738
}
739739
#[test] #[should_fail] #[ignore(cfg(windows))]
@@ -760,7 +760,7 @@ fn test_spawn_linked_sup_fail_down() { // parent fails; child fails
760760
fn test_spawn_linked_unsup_fail_up() { // child fails; parent fails
761761
let (po, _ch) = stream::<()>();
762762
// Default options are to spawn linked & unsupervised.
763-
do spawn { die!(); }
763+
do spawn { fail; }
764764
po.recv(); // We should get punted awake
765765
}
766766
#[test] #[should_fail] #[ignore(cfg(windows))]

branches/try/src/libcore/task/spawn.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -646,25 +646,25 @@ pub fn spawn_raw(opts: TaskOpts, f: fn~()) {
646646

647647
fn new_task_in_sched(opts: SchedOpts) -> *rust_task {
648648
if opts.foreign_stack_size != None {
649-
die!(~"foreign_stack_size scheduler option unimplemented");
649+
fail ~"foreign_stack_size scheduler option unimplemented";
650650
}
651651

652652
let num_threads = match opts.mode {
653-
DefaultScheduler
654-
| CurrentScheduler
655-
| ExistingScheduler(*)
656-
| PlatformThread => 0u, /* Won't be used */
657-
SingleThreaded => 1u,
658-
ThreadPerCore => unsafe { rt::rust_num_threads() },
659-
ThreadPerTask => {
660-
die!(~"ThreadPerTask scheduling mode unimplemented")
661-
}
662-
ManualThreads(threads) => {
663-
if threads == 0u {
664-
die!(~"can not create a scheduler with no threads");
665-
}
666-
threads
653+
DefaultScheduler
654+
| CurrentScheduler
655+
| ExistingScheduler(*)
656+
| PlatformThread => 0u, /* Won't be used */
657+
SingleThreaded => 1u,
658+
ThreadPerCore => unsafe { rt::rust_num_threads() },
659+
ThreadPerTask => {
660+
fail ~"ThreadPerTask scheduling mode unimplemented"
661+
}
662+
ManualThreads(threads) => {
663+
if threads == 0u {
664+
fail ~"can not create a scheduler with no threads";
667665
}
666+
threads
667+
}
668668
};
669669

670670
unsafe {

branches/try/src/librustc/driver/session.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,12 @@ pub mod test {
346346
use syntax::ast_util;
347347

348348
pub fn make_crate_type_attr(+t: ~str) -> ast::attribute {
349-
ast_util::respan(ast_util::dummy_sp(), ast::attribute_ {
349+
ast_util::respan(codemap::dummy_sp(), ast::attribute_ {
350350
style: ast::attr_outer,
351-
value: ast_util::respan(ast_util::dummy_sp(),
351+
value: ast_util::respan(codemap::dummy_sp(),
352352
ast::meta_name_value(
353353
~"crate_type",
354-
ast_util::respan(ast_util::dummy_sp(),
354+
ast_util::respan(codemap::dummy_sp(),
355355
ast::lit_str(@t)))),
356356
is_sugared_doc: false
357357
})
@@ -361,7 +361,7 @@ pub mod test {
361361
let mut attrs = ~[];
362362
if with_bin { attrs += ~[make_crate_type_attr(~"bin")]; }
363363
if with_lib { attrs += ~[make_crate_type_attr(~"lib")]; }
364-
@ast_util::respan(ast_util::dummy_sp(), ast::crate_ {
364+
@ast_util::respan(codemap::dummy_sp(), ast::crate_ {
365365
module: ast::_mod { view_items: ~[], items: ~[] },
366366
attrs: attrs,
367367
config: ~[]

branches/try/src/librustc/front/core_inject.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use syntax::ast;
1717
use syntax::ast_util::*;
1818
use syntax::attr;
1919
use syntax::codemap;
20+
use syntax::codemap::dummy_sp;
2021
use syntax::fold;
2122

2223
const CORE_VERSION: &static/str = "0.6";
@@ -36,8 +37,8 @@ fn use_core(crate: @ast::crate) -> bool {
3637

3738
fn inject_libcore_ref(sess: Session,
3839
crate: @ast::crate) -> @ast::crate {
39-
fn spanned<T: Copy>(x: T) -> ast::spanned<T> {
40-
ast::spanned { node: x, span: dummy_sp() }
40+
fn spanned<T: Copy>(x: T) -> codemap::spanned<T> {
41+
codemap::spanned { node: x, span: dummy_sp() }
4142
}
4243

4344
let precursor = @fold::AstFoldFns {

branches/try/src/librustc/front/intrinsic_inject.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use core::prelude::*;
1313
use driver::session::Session;
1414
use syntax::parse;
1515
use syntax::ast;
16+
use syntax::codemap::spanned;
1617

1718
use core::vec;
1819

@@ -34,7 +35,7 @@ pub fn inject_intrinsic(sess: Session, crate: @ast::crate) -> @ast::crate {
3435

3536
let items = vec::append(~[item], crate.node.module.items);
3637

37-
@ast::spanned {
38+
@spanned {
3839
node: ast::crate_ {
3940
module: ast::_mod {
4041
items: items,

branches/try/src/librustc/front/test.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ use core::option;
2121
use core::vec;
2222
use syntax::ast_util::*;
2323
use syntax::attr;
24-
use syntax::codemap::span;
24+
use syntax::codemap::{dummy_sp, span};
25+
use syntax::codemap;
2526
use syntax::fold;
2627
use syntax::print::pprust;
2728
use syntax::{ast, ast_util};
@@ -237,8 +238,8 @@ fn mk_test_module(cx: test_ctxt) -> @ast::item {
237238
return @item;
238239
}
239240

240-
fn nospan<T: Copy>(t: T) -> ast::spanned<T> {
241-
ast::spanned { node: t, span: dummy_sp() }
241+
fn nospan<T: Copy>(t: T) -> codemap::spanned<T> {
242+
codemap::spanned { node: t, span: dummy_sp() }
242243
}
243244

244245
fn path_node(+ids: ~[ast::ident]) -> @ast::path {
@@ -535,7 +536,7 @@ fn mk_main(cx: test_ctxt) -> @ast::item {
535536
let body_: ast::blk_ =
536537
default_block(~[], option::Some(test_main_call_expr),
537538
cx.sess.next_node_id());
538-
let body = ast::spanned { node: body_, span: dummy_sp() };
539+
let body = codemap::spanned { node: body_, span: dummy_sp() };
539540

540541
let item_ = ast::item_fn(decl, ast::impure_fn, ~[], body);
541542
let item = ast::item {

branches/try/src/librustc/metadata/creader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::either;
2424
use core::option;
2525
use core::vec;
2626
use syntax::attr;
27-
use syntax::codemap::span;
27+
use syntax::codemap::{span, dummy_sp};
2828
use syntax::diagnostic::span_handler;
2929
use syntax::parse::token::ident_interner;
3030
use syntax::print::pprust;
@@ -294,7 +294,7 @@ fn resolve_crate_deps(e: env, cdata: @~[u8]) -> cstore::cnum_map {
294294
// This is a new one so we've got to load it
295295
// FIXME (#2404): Need better error reporting than just a bogus
296296
// span.
297-
let fake_span = ast_util::dummy_sp();
297+
let fake_span = dummy_sp();
298298
let local_cnum = resolve_crate(e, cname, cmetas,
299299
/*bad*/copy dep.hash, fake_span);
300300
cnum_map.insert(extrn_cnum, local_cnum);

branches/try/src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::ebml;
2626
use std::map::HashMap;
2727
use syntax::ast;
2828
use syntax::ast_map;
29-
use syntax::ast_util::dummy_sp;
29+
use syntax::codemap::dummy_sp;
3030
use syntax::ast_util;
3131
use syntax::diagnostic::expect;
3232
use syntax::diagnostic::span_handler;

0 commit comments

Comments
 (0)