Skip to content

Commit f07e3c8

Browse files
committed
---
yaml --- r: 103599 b: refs/heads/try c: daf60f0 h: refs/heads/master i: 103597: 95c9c1b 103595: 3ffceaf 103591: e9cbbd4 103583: 275c974 v: v3
1 parent 5cc33e8 commit f07e3c8

Some content is hidden

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

107 files changed

+1637
-2307
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: 0d38e1f9c1998d15fdd8a7d6f5064f27d7826ab3
5+
refs/heads/try: daf60f0c4fa27b293aa239746755b665a3b95da4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

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(benchfn);
898+
let bs = ::test::bench::benchmark(|harness| benchfn(harness));
899899
monitor_ch.send((desc, TrBench(bs)));
900900
return;
901901
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ 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_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;
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;
5049

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

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

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

900-
pub fn build_session(sopts: @session::Options, demitter: @diagnostic::Emitter)
900+
pub fn build_session(sopts: @session::Options,
901+
local_crate_source_file: Option<Path>,
902+
demitter: @diagnostic::Emitter)
901903
-> Session {
902904
let codemap = @codemap::CodeMap::new();
903905
let diagnostic_handler =
904906
diagnostic::mk_handler(Some(demitter));
905907
let span_diagnostic_handler =
906908
diagnostic::mk_span_handler(diagnostic_handler, codemap);
907-
build_session_(sopts, codemap, demitter, span_diagnostic_handler)
909+
910+
build_session_(sopts, local_crate_source_file, codemap, demitter, span_diagnostic_handler)
908911
}
909912

910913
pub fn build_session_(sopts: @session::Options,
911-
cm: @codemap::CodeMap,
914+
local_crate_source_file: Option<Path>,
915+
codemap: @codemap::CodeMap,
912916
demitter: @diagnostic::Emitter,
913917
span_diagnostic_handler: @diagnostic::SpanHandler)
914918
-> Session {
915919
let target_cfg = build_target_config(sopts, demitter);
916-
let p_s = parse::new_parse_sess_special_handler(span_diagnostic_handler,
917-
cm);
920+
let p_s = parse::new_parse_sess_special_handler(span_diagnostic_handler, codemap);
918921
let cstore = @CStore::new(token::get_ident_interner());
919922
let filesearch = @filesearch::FileSearch::new(
920923
&sopts.maybe_sysroot,
921924
sopts.target_triple,
922925
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+
923936
@Session_ {
924937
targ_cfg: target_cfg,
925938
opts: sopts,
926939
cstore: cstore,
927940
parse_sess: p_s,
928-
codemap: cm,
941+
codemap: codemap,
929942
// For a library crate, this is always none
930943
entry_fn: RefCell::new(None),
931944
entry_type: Cell::new(None),
932945
macro_registrar_fn: RefCell::new(None),
933946
span_diagnostic: span_diagnostic_handler,
934947
filesearch: filesearch,
935948
building_library: Cell::new(false),
949+
local_crate_source_file: local_crate_source_file,
936950
working_dir: os::getcwd(),
937951
lints: RefCell::new(HashMap::new()),
938952
node_id: Cell::new(1),
@@ -1164,13 +1178,8 @@ mod test {
11641178
Ok(m) => m,
11651179
Err(f) => fail!("test_switch_implies_cfg_test: {}", f.to_err_msg())
11661180
};
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);
1181+
let sessopts = build_session_options(~"rustc", matches, @diagnostic::DefaultEmitter);
1182+
let sess = build_session(sessopts, None, @diagnostic::DefaultEmitter);
11741183
let cfg = build_configuration(sess);
11751184
assert!((attr::contains_name(cfg, "test")));
11761185
}
@@ -1187,13 +1196,8 @@ mod test {
11871196
f.to_err_msg());
11881197
}
11891198
};
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);
1199+
let sessopts = build_session_options(~"rustc", matches, @diagnostic::DefaultEmitter);
1200+
let sess = build_session(sessopts, None, @diagnostic::DefaultEmitter);
11971201
let cfg = build_configuration(sess);
11981202
let mut test_items = cfg.iter().filter(|m| "test" == m.name());
11991203
assert!(test_items.next().is_some());

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ 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>,
214217
working_dir: Path,
215218
lints: RefCell<HashMap<ast::NodeId,
216219
~[(lint::Lint, codemap::Span, ~str)]>>,

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

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

5051
// These are used to test this portion of the compiler, they don't actually
5152
// mean anything
@@ -193,6 +194,10 @@ impl Visitor<()> for Context {
193194
self.gate_feature("log_syntax", path.span, "`log_syntax!` is not \
194195
stable enough for use and is subject to change");
195196
}
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+
}
196201
}
197202

198203
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 = match matches.free.len() {
233+
let (input, input_file_path) = 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())
239+
(d::StrInput(src.to_managed()), None)
240240
} else {
241-
d::FileInput(Path::new(ifile))
241+
(d::FileInput(Path::new(ifile)), Some(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, demitter);
248+
let sess = d::build_session(sopts, input_file_path, 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: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,24 +176,23 @@ 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;
180179

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;
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;
184183

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

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

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

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;
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;
197196

198197
pub static tag_region_param_def: uint = 0x100;
199198
pub static tag_region_param_def_ident: uint = 0x101;

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,6 @@ 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-
240230
pub fn item_type(_item_id: ast::DefId, item: ebml::Doc,
241231
tcx: ty::ctxt, cdata: Cmd) -> ty::t {
242232
doc_type(item, tcx, cdata)
@@ -781,9 +771,9 @@ fn get_explicit_self(item: ebml::Doc) -> ast::ExplicitSelf_ {
781771
let explicit_self_kind = string[0];
782772
match explicit_self_kind as char {
783773
's' => ast::SelfStatic,
784-
'v' => ast::SelfValue(get_mutability(string[1])),
774+
'v' => ast::SelfValue,
785775
'@' => ast::SelfBox,
786-
'~' => ast::SelfUniq(get_mutability(string[1])),
776+
'~' => ast::SelfUniq,
787777
// FIXME(#4846) expl. region
788778
'&' => ast::SelfRegion(None, get_mutability(string[1])),
789779
_ => fail!("unknown self type code: `{}`", explicit_self_kind as char)
@@ -847,7 +837,6 @@ pub fn get_method(intr: @IdentInterner, cdata: Cmd, id: ast::NodeId,
847837
let type_param_defs = item_ty_param_defs(method_doc, tcx, cdata,
848838
tag_item_method_tps);
849839
let rp_defs = item_region_param_defs(method_doc, tcx, cdata);
850-
let transformed_self_ty = doc_transformed_self_ty(method_doc, tcx, cdata);
851840
let fty = doc_method_fty(method_doc, tcx, cdata);
852841
let vis = item_visibility(method_doc);
853842
let explicit_self = get_explicit_self(method_doc);
@@ -859,7 +848,6 @@ pub fn get_method(intr: @IdentInterner, cdata: Cmd, id: ast::NodeId,
859848
type_param_defs: type_param_defs,
860849
region_param_defs: rp_defs,
861850
},
862-
transformed_self_ty,
863851
fty,
864852
explicit_self,
865853
vis,

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

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,6 @@ 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-
274264
fn encode_method_fty(ecx: &EncodeContext,
275265
ebml_w: &mut writer::Encoder,
276266
typ: &ty::BareFnTy) {
@@ -679,23 +669,13 @@ fn encode_explicit_self(ebml_w: &mut writer::Encoder, explicit_self: ast::Explic
679669

680670
// Encode the base self type.
681671
match explicit_self {
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-
}
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 ]),
689676
SelfRegion(_, m) => {
690677
// FIXME(#4846) encode custom lifetime
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 ]);
678+
ebml_w.writer.write(&['&' as u8]);
699679
encode_mutability(ebml_w, m);
700680
}
701681
}
@@ -807,7 +787,6 @@ fn encode_method_ty_fields(ecx: &EncodeContext,
807787
encode_ty_type_param_defs(ebml_w, ecx,
808788
method_ty.generics.type_param_defs,
809789
tag_item_method_tps);
810-
encode_transformed_self_ty(ecx, ebml_w, method_ty.transformed_self_ty);
811790
encode_method_fty(ecx, ebml_w, &method_ty.fty);
812791
encode_visibility(ebml_w, method_ty.vis);
813792
encode_explicit_self(ebml_w, method_ty.explicit_self);

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,6 @@ 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-
}
381377
'#' => {
382378
let pos = parse_hex(st);
383379
assert_eq!(next(st), ':');

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,6 @@ 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-
}
334330
ty::ty_struct(def, ref substs) => {
335331
mywrite!(w, "a[{}|", (cx.ds)(def));
336332
enc_substs(w, cx, substs);

branches/try/src/librustc/middle/astencode.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@ impl tr for ast::Def {
435435
ast::DefMethod(did0.tr(xcx), did1.map(|did1| did1.tr(xcx)))
436436
}
437437
ast::DefSelfTy(nid) => { ast::DefSelfTy(xcx.tr_id(nid)) }
438-
ast::DefSelf(nid, m) => { ast::DefSelf(xcx.tr_id(nid), m) }
439438
ast::DefMod(did) => { ast::DefMod(did.tr(xcx)) }
440439
ast::DefForeignMod(did) => { ast::DefForeignMod(did.tr(xcx)) }
441440
ast::DefStatic(did, m) => { ast::DefStatic(did.tr(xcx), m) }
@@ -579,16 +578,8 @@ trait read_method_map_entry_helper {
579578
-> method_map_entry;
580579
}
581580

582-
fn encode_method_map_entry(ecx: &e::EncodeContext,
583-
ebml_w: &mut writer::Encoder,
584-
mme: method_map_entry) {
581+
fn encode_method_map_entry(ebml_w: &mut writer::Encoder, mme: method_map_entry) {
585582
ebml_w.emit_struct("method_map_entry", 3, |ebml_w| {
586-
ebml_w.emit_struct_field("self_ty", 0u, |ebml_w| {
587-
ebml_w.emit_ty(ecx, mme.self_ty);
588-
});
589-
ebml_w.emit_struct_field("explicit_self", 2u, |ebml_w| {
590-
mme.explicit_self.encode(ebml_w);
591-
});
592583
ebml_w.emit_struct_field("origin", 1u, |ebml_w| {
593584
mme.origin.encode(ebml_w);
594585
});
@@ -600,15 +591,6 @@ impl<'a> read_method_map_entry_helper for reader::Decoder<'a> {
600591
-> method_map_entry {
601592
self.read_struct("method_map_entry", 3, |this| {
602593
method_map_entry {
603-
self_ty: this.read_struct_field("self_ty", 0u, |this| {
604-
this.read_ty(xcx)
605-
}),
606-
explicit_self: this.read_struct_field("explicit_self",
607-
2,
608-
|this| {
609-
let explicit_self: ast::ExplicitSelf_ = Decodable::decode(this);
610-
explicit_self
611-
}),
612594
origin: this.read_struct_field("origin", 1, |this| {
613595
let method_origin: method_origin =
614596
Decodable::decode(this);
@@ -1043,7 +1025,7 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
10431025
ebml_w.tag(c::tag_table_method_map, |ebml_w| {
10441026
ebml_w.id(id);
10451027
ebml_w.tag(c::tag_table_val, |ebml_w| {
1046-
encode_method_map_entry(ecx, ebml_w, *mme)
1028+
encode_method_map_entry(ebml_w, *mme)
10471029
})
10481030
})
10491031
}

0 commit comments

Comments
 (0)