Skip to content

Commit 5cc33e8

Browse files
committed
---
yaml --- r: 103598 b: refs/heads/try c: 0d38e1f h: refs/heads/master v: v3
1 parent 95c9c1b commit 5cc33e8

Some content is hidden

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

108 files changed

+2309
-1638
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: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
5-
refs/heads/try: 4176343073d0b28380b478fea941913567ebdd5c
5+
refs/heads/try: 0d38e1f9c1998d15fdd8a7d6f5064f27d7826ab3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/mk/tests.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ ifeq ($(NO_REBUILD),)
344344
STDTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
345345
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.extra \
346346
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.rustuv \
347-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.green
347+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.green \
348+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.native
348349
else
349350
STDTESTDEP_$(1)_$(2)_$(3)_$(4) =
350351
endif

branches/try/src/libextra/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ pub fn run_test(force_ignore: bool,
895895
return;
896896
}
897897
StaticBenchFn(benchfn) => {
898-
let bs = ::test::bench::benchmark(|harness| benchfn(harness));
898+
let bs = ::test::bench::benchmark(benchfn);
899899
monitor_ch.send((desc, TrBench(bs)));
900900
return;
901901
}

branches/try/src/librustc/back/abi.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ pub static general_code_alignment: uint = 16u;
4242

4343
pub static tydesc_field_size: uint = 0u;
4444
pub static tydesc_field_align: uint = 1u;
45-
pub static tydesc_field_drop_glue: uint = 2u;
46-
pub static tydesc_field_visit_glue: uint = 3u;
47-
pub static tydesc_field_name_offset: uint = 4u;
48-
pub static n_tydesc_fields: uint = 5u;
45+
pub static tydesc_field_take_glue: uint = 2u;
46+
pub static tydesc_field_drop_glue: uint = 3u;
47+
pub static tydesc_field_visit_glue: uint = 4u;
48+
pub static tydesc_field_name_offset: uint = 5u;
49+
pub static n_tydesc_fields: uint = 6u;
4950

5051
// The two halves of a closure: code and environment.
5152
pub static fn_field_code: uint = 0u;

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

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -897,56 +897,42 @@ pub fn build_session_options(binary: ~str,
897897
return sopts;
898898
}
899899

900-
pub fn build_session(sopts: @session::Options,
901-
local_crate_source_file: Option<Path>,
902-
demitter: @diagnostic::Emitter)
900+
pub fn build_session(sopts: @session::Options, demitter: @diagnostic::Emitter)
903901
-> Session {
904902
let codemap = @codemap::CodeMap::new();
905903
let diagnostic_handler =
906904
diagnostic::mk_handler(Some(demitter));
907905
let span_diagnostic_handler =
908906
diagnostic::mk_span_handler(diagnostic_handler, codemap);
909-
910-
build_session_(sopts, local_crate_source_file, codemap, demitter, span_diagnostic_handler)
907+
build_session_(sopts, codemap, demitter, span_diagnostic_handler)
911908
}
912909

913910
pub fn build_session_(sopts: @session::Options,
914-
local_crate_source_file: Option<Path>,
915-
codemap: @codemap::CodeMap,
911+
cm: @codemap::CodeMap,
916912
demitter: @diagnostic::Emitter,
917913
span_diagnostic_handler: @diagnostic::SpanHandler)
918914
-> Session {
919915
let target_cfg = build_target_config(sopts, demitter);
920-
let p_s = parse::new_parse_sess_special_handler(span_diagnostic_handler, codemap);
916+
let p_s = parse::new_parse_sess_special_handler(span_diagnostic_handler,
917+
cm);
921918
let cstore = @CStore::new(token::get_ident_interner());
922919
let filesearch = @filesearch::FileSearch::new(
923920
&sopts.maybe_sysroot,
924921
sopts.target_triple,
925922
sopts.addl_lib_search_paths);
926-
927-
// Make the path absolute, if necessary
928-
let local_crate_source_file = local_crate_source_file.map(|path|
929-
if path.is_absolute() {
930-
path.clone()
931-
} else {
932-
os::getcwd().join(path.clone())
933-
}
934-
);
935-
936923
@Session_ {
937924
targ_cfg: target_cfg,
938925
opts: sopts,
939926
cstore: cstore,
940927
parse_sess: p_s,
941-
codemap: codemap,
928+
codemap: cm,
942929
// For a library crate, this is always none
943930
entry_fn: RefCell::new(None),
944931
entry_type: Cell::new(None),
945932
macro_registrar_fn: RefCell::new(None),
946933
span_diagnostic: span_diagnostic_handler,
947934
filesearch: filesearch,
948935
building_library: Cell::new(false),
949-
local_crate_source_file: local_crate_source_file,
950936
working_dir: os::getcwd(),
951937
lints: RefCell::new(HashMap::new()),
952938
node_id: Cell::new(1),
@@ -1178,8 +1164,13 @@ mod test {
11781164
Ok(m) => m,
11791165
Err(f) => fail!("test_switch_implies_cfg_test: {}", f.to_err_msg())
11801166
};
1181-
let sessopts = build_session_options(~"rustc", matches, @diagnostic::DefaultEmitter);
1182-
let sess = build_session(sessopts, None, @diagnostic::DefaultEmitter);
1167+
let sessopts = build_session_options(
1168+
~"rustc",
1169+
matches,
1170+
@diagnostic::DefaultEmitter as @diagnostic::Emitter);
1171+
let sess = build_session(sessopts,
1172+
@diagnostic::DefaultEmitter as
1173+
@diagnostic::Emitter);
11831174
let cfg = build_configuration(sess);
11841175
assert!((attr::contains_name(cfg, "test")));
11851176
}
@@ -1196,8 +1187,13 @@ mod test {
11961187
f.to_err_msg());
11971188
}
11981189
};
1199-
let sessopts = build_session_options(~"rustc", matches, @diagnostic::DefaultEmitter);
1200-
let sess = build_session(sessopts, None, @diagnostic::DefaultEmitter);
1190+
let sessopts = build_session_options(
1191+
~"rustc",
1192+
matches,
1193+
@diagnostic::DefaultEmitter as @diagnostic::Emitter);
1194+
let sess = build_session(sessopts,
1195+
@diagnostic::DefaultEmitter as
1196+
@diagnostic::Emitter);
12011197
let cfg = build_configuration(sess);
12021198
let mut test_items = cfg.iter().filter(|m| "test" == m.name());
12031199
assert!(test_items.next().is_some());

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,6 @@ pub struct Session_ {
211211
macro_registrar_fn: RefCell<Option<ast::DefId>>,
212212
filesearch: @filesearch::FileSearch,
213213
building_library: Cell<bool>,
214-
// The name of the root source file of the crate, in the local file system. The path is always
215-
// expected to be absolute. `None` means that there is no source file.
216-
local_crate_source_file: Option<Path>,
217214
working_dir: Path,
218215
lints: RefCell<HashMap<ast::NodeId,
219216
~[(lint::Lint, codemap::Span, ~str)]>>,

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
4646
("phase", Active),
4747
("macro_registrar", Active),
4848
("log_syntax", Active),
49-
("trace_macros", Active),
5049

5150
// These are used to test this portion of the compiler, they don't actually
5251
// mean anything
@@ -194,10 +193,6 @@ impl Visitor<()> for Context {
194193
self.gate_feature("log_syntax", path.span, "`log_syntax!` is not \
195194
stable enough for use and is subject to change");
196195
}
197-
else if path.segments.last().unwrap().identifier == self.sess.ident_of("trace_macros") {
198-
self.gate_feature("trace_macros", path.span, "`trace_macros` is not \
199-
stable enough for use and is subject to change");
200-
}
201196
}
202197

203198
fn visit_ty(&mut self, t: &ast::Ty, _: ()) {

branches/try/src/librustc/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,22 +230,22 @@ pub fn run_compiler(args: &[~str], demitter: @diagnostic::Emitter) {
230230
version(binary);
231231
return;
232232
}
233-
let (input, input_file_path) = match matches.free.len() {
233+
let input = match matches.free.len() {
234234
0u => d::early_error(demitter, "no input filename given"),
235235
1u => {
236236
let ifile = matches.free[0].as_slice();
237237
if "-" == ifile {
238238
let src = str::from_utf8_owned(io::stdin().read_to_end()).unwrap();
239-
(d::StrInput(src.to_managed()), None)
239+
d::StrInput(src.to_managed())
240240
} else {
241-
(d::FileInput(Path::new(ifile)), Some(Path::new(ifile)))
241+
d::FileInput(Path::new(ifile))
242242
}
243243
}
244244
_ => d::early_error(demitter, "multiple input filenames provided")
245245
};
246246

247247
let sopts = d::build_session_options(binary, matches, demitter);
248-
let sess = d::build_session(sopts, input_file_path, demitter);
248+
let sess = d::build_session(sopts, demitter);
249249
let odir = matches.opt_str("out-dir").map(|o| Path::new(o));
250250
let ofile = matches.opt_str("o").map(|o| Path::new(o));
251251
let cfg = d::build_configuration(sess);

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,23 +176,24 @@ pub static tag_link_args_arg: uint = 0x7a;
176176

177177
pub static tag_item_method_tps: uint = 0x7b;
178178
pub static tag_item_method_fty: uint = 0x7c;
179+
pub static tag_item_method_transformed_self_ty: uint = 0x7d;
179180

180-
pub static tag_mod_child: uint = 0x7d;
181-
pub static tag_misc_info: uint = 0x7e;
182-
pub static tag_misc_info_crate_items: uint = 0x7f;
181+
pub static tag_mod_child: uint = 0x7e;
182+
pub static tag_misc_info: uint = 0x7f;
183+
pub static tag_misc_info_crate_items: uint = 0x80;
183184

184-
pub static tag_item_method_provided_source: uint = 0x80;
185-
pub static tag_item_impl_vtables: uint = 0x81;
185+
pub static tag_item_method_provided_source: uint = 0x81;
186+
pub static tag_item_impl_vtables: uint = 0x82;
186187

187-
pub static tag_impls: uint = 0x82;
188-
pub static tag_impls_impl: uint = 0x83;
188+
pub static tag_impls: uint = 0x83;
189+
pub static tag_impls_impl: uint = 0x84;
189190

190-
pub static tag_items_data_item_inherent_impl: uint = 0x84;
191-
pub static tag_items_data_item_extension_impl: uint = 0x85;
191+
pub static tag_items_data_item_inherent_impl: uint = 0x85;
192+
pub static tag_items_data_item_extension_impl: uint = 0x86;
192193

193-
pub static tag_path_elem_pretty_name: uint = 0x86;
194-
pub static tag_path_elem_pretty_name_ident: uint = 0x87;
195-
pub static tag_path_elem_pretty_name_extra: uint = 0x88;
194+
pub static tag_path_elem_pretty_name: uint = 0x87;
195+
pub static tag_path_elem_pretty_name_ident: uint = 0x88;
196+
pub static tag_path_elem_pretty_name_extra: uint = 0x89;
196197

197198
pub static tag_region_param_def: uint = 0x100;
198199
pub static tag_region_param_def_ident: uint = 0x101;

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,16 @@ fn doc_method_fty(doc: ebml::Doc, tcx: ty::ctxt, cdata: Cmd) -> ty::BareFnTy {
227227
|_, did| translate_def_id(cdata, did))
228228
}
229229

230+
fn doc_transformed_self_ty(doc: ebml::Doc,
231+
tcx: ty::ctxt,
232+
cdata: Cmd) -> Option<ty::t>
233+
{
234+
reader::maybe_get_doc(doc, tag_item_method_transformed_self_ty).map(|tp| {
235+
parse_ty_data(tp.data, cdata.cnum, tp.start, tcx,
236+
|_, did| translate_def_id(cdata, did))
237+
})
238+
}
239+
230240
pub fn item_type(_item_id: ast::DefId, item: ebml::Doc,
231241
tcx: ty::ctxt, cdata: Cmd) -> ty::t {
232242
doc_type(item, tcx, cdata)
@@ -771,9 +781,9 @@ fn get_explicit_self(item: ebml::Doc) -> ast::ExplicitSelf_ {
771781
let explicit_self_kind = string[0];
772782
match explicit_self_kind as char {
773783
's' => ast::SelfStatic,
774-
'v' => ast::SelfValue,
784+
'v' => ast::SelfValue(get_mutability(string[1])),
775785
'@' => ast::SelfBox,
776-
'~' => ast::SelfUniq,
786+
'~' => ast::SelfUniq(get_mutability(string[1])),
777787
// FIXME(#4846) expl. region
778788
'&' => ast::SelfRegion(None, get_mutability(string[1])),
779789
_ => fail!("unknown self type code: `{}`", explicit_self_kind as char)
@@ -837,6 +847,7 @@ pub fn get_method(intr: @IdentInterner, cdata: Cmd, id: ast::NodeId,
837847
let type_param_defs = item_ty_param_defs(method_doc, tcx, cdata,
838848
tag_item_method_tps);
839849
let rp_defs = item_region_param_defs(method_doc, tcx, cdata);
850+
let transformed_self_ty = doc_transformed_self_ty(method_doc, tcx, cdata);
840851
let fty = doc_method_fty(method_doc, tcx, cdata);
841852
let vis = item_visibility(method_doc);
842853
let explicit_self = get_explicit_self(method_doc);
@@ -848,6 +859,7 @@ pub fn get_method(intr: @IdentInterner, cdata: Cmd, id: ast::NodeId,
848859
type_param_defs: type_param_defs,
849860
region_param_defs: rp_defs,
850861
},
862+
transformed_self_ty,
851863
fty,
852864
explicit_self,
853865
vis,

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

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,16 @@ fn encode_type(ecx: &EncodeContext,
261261
ebml_w.end_tag();
262262
}
263263

264+
fn encode_transformed_self_ty(ecx: &EncodeContext,
265+
ebml_w: &mut writer::Encoder,
266+
opt_typ: Option<ty::t>) {
267+
for &typ in opt_typ.iter() {
268+
ebml_w.start_tag(tag_item_method_transformed_self_ty);
269+
write_type(ecx, ebml_w, typ);
270+
ebml_w.end_tag();
271+
}
272+
}
273+
264274
fn encode_method_fty(ecx: &EncodeContext,
265275
ebml_w: &mut writer::Encoder,
266276
typ: &ty::BareFnTy) {
@@ -669,13 +679,23 @@ fn encode_explicit_self(ebml_w: &mut writer::Encoder, explicit_self: ast::Explic
669679

670680
// Encode the base self type.
671681
match explicit_self {
672-
SelfStatic => ebml_w.writer.write(&[ 's' as u8 ]),
673-
SelfValue => ebml_w.writer.write(&[ 'v' as u8 ]),
674-
SelfBox => ebml_w.writer.write(&[ '@' as u8 ]),
675-
SelfUniq => ebml_w.writer.write(&[ '~' as u8 ]),
682+
SelfStatic => {
683+
ebml_w.writer.write(&[ 's' as u8 ]);
684+
}
685+
SelfValue(m) => {
686+
ebml_w.writer.write(&[ 'v' as u8 ]);
687+
encode_mutability(ebml_w, m);
688+
}
676689
SelfRegion(_, m) => {
677690
// FIXME(#4846) encode custom lifetime
678-
ebml_w.writer.write(&['&' as u8]);
691+
ebml_w.writer.write(&[ '&' as u8 ]);
692+
encode_mutability(ebml_w, m);
693+
}
694+
SelfBox => {
695+
ebml_w.writer.write(&[ '@' as u8 ]);
696+
}
697+
SelfUniq(m) => {
698+
ebml_w.writer.write(&[ '~' as u8 ]);
679699
encode_mutability(ebml_w, m);
680700
}
681701
}
@@ -787,6 +807,7 @@ fn encode_method_ty_fields(ecx: &EncodeContext,
787807
encode_ty_type_param_defs(ebml_w, ecx,
788808
method_ty.generics.type_param_defs,
789809
tag_item_method_tps);
810+
encode_transformed_self_ty(ecx, ebml_w, method_ty.transformed_self_ty);
790811
encode_method_fty(ecx, ebml_w, &method_ty.fty);
791812
encode_visibility(ebml_w, method_ty.vis);
792813
encode_explicit_self(ebml_w, method_ty.explicit_self);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
374374
return ty::mk_bare_fn(st.tcx, parse_bare_fn_ty(st, |x,y| conv(x,y)));
375375
}
376376
'Y' => return ty::mk_type(st.tcx),
377+
'C' => {
378+
let sigil = parse_sigil(st);
379+
return ty::mk_opaque_closure_ptr(st.tcx, sigil);
380+
}
377381
'#' => {
378382
let pos = parse_hex(st);
379383
assert_eq!(next(st), ':');

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ fn enc_sty(w: &mut MemWriter, cx: @ctxt, st: &ty::sty) {
327327
mywrite!(w, "s{}|", (cx.ds)(did));
328328
}
329329
ty::ty_type => mywrite!(w, "Y"),
330+
ty::ty_opaque_closure_ptr(p) => {
331+
mywrite!(w, "C&");
332+
enc_sigil(w, p);
333+
}
330334
ty::ty_struct(def, ref substs) => {
331335
mywrite!(w, "a[{}|", (cx.ds)(def));
332336
enc_substs(w, cx, substs);

0 commit comments

Comments
 (0)