Skip to content

Commit fe3b860

Browse files
committed
---
yaml --- r: 148639 b: refs/heads/try2 c: e901c4c h: refs/heads/master i: 148637: ed93b43 148635: 1700285 148631: 13c3724 148623: 95004ca 148607: 621c762 v: v3
1 parent e4d1e35 commit fe3b860

File tree

140 files changed

+2423
-1838
lines changed

Some content is hidden

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

140 files changed

+2423
-1838
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b3d10f43833f065ec0e635ce6cdb2332f4ee5049
8+
refs/heads/try2: e901c4caf30353f6adf12e6b10a46a4de517ec9d
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,10 @@ src/.DS_Store
7575
/doc/latex
7676
/doc/std
7777
/doc/extra
78-
/doc/flate
7978
/doc/green
8079
/doc/native
8180
/doc/rustc
8281
/doc/syntax
83-
/doc/rustdoc
8482
/doc/rustuv
8583
/doc/rustpkg
8684
/nd/

branches/try2/doc/guide-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ implemented in user-space.
176176
The primary concern of an M:N runtime is that a Rust task cannot block itself in
177177
a syscall. If this happens, then the entire OS thread is frozen and unavailable
178178
for running more Rust tasks, making this a (M-1):N runtime (and you can see how
179-
this can reach 0/deadlock). By using asynchronous I/O under the hood (all I/O
179+
this can reach 0/deadlock. By using asynchronous I/O under the hood (all I/O
180180
still looks synchronous in terms of code), OS threads are never blocked until
181181
the appropriate time comes.
182182

branches/try2/mk/tests.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,7 @@ 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 \
348-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.native
347+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.green
349348
else
350349
STDTESTDEP_$(1)_$(2)_$(3)_$(4) =
351350
endif

branches/try2/src/etc/generate-deriving-span-tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def write_file(name, string):
118118
for (trait, supers, errs) in [('Rand', [], 1),
119119
('Clone', [], 1), ('DeepClone', ['Clone'], 1),
120120
('Eq', [], 2), ('Ord', [], 8),
121-
('TotalEq', [], 1), ('TotalOrd', ['TotalEq'], 1)]:
121+
('TotalEq', [], 2), ('TotalOrd', ['TotalEq'], 2)]:
122122
traits[trait] = (ALL, supers, errs)
123123

124124
for (trait, (types, super_traits, error_count)) in traits.items():

branches/try2/src/libextra/dlist.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,13 @@ struct Node<T> {
4747
}
4848

4949
/// Double-ended DList iterator
50+
#[deriving(Clone)]
5051
pub struct Items<'a, T> {
5152
priv head: &'a Link<T>,
5253
priv tail: Rawlink<Node<T>>,
5354
priv nelem: uint,
5455
}
5556

56-
// FIXME #11820: the &'a Option<> of the Link stops clone working.
57-
impl<'a, T> Clone for Items<'a, T> {
58-
fn clone(&self) -> Items<'a, T> { *self }
59-
}
60-
6157
/// Double-ended mutable DList iterator
6258
pub struct MutItems<'a, T> {
6359
priv list: &'a mut DList<T>,

branches/try2/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/try2/src/libnative/io/net.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,17 @@ impl TcpListener {
348348
let (addr, len) = addr_to_sockaddr(addr);
349349
let addrp = &addr as *libc::sockaddr_storage;
350350
let ret = TcpListener { fd: fd };
351+
// On platforms with Berkeley-derived sockets, this allows
352+
// to quickly rebind a socket, without needing to wait for
353+
// the OS to clean up the previous one.
354+
if cfg!(unix) {
355+
match setsockopt(fd, libc::SOL_SOCKET,
356+
libc::SO_REUSEADDR,
357+
1 as libc::c_int) {
358+
Err(n) => { return Err(n); },
359+
Ok(..) => { }
360+
}
361+
}
351362
match libc::bind(fd, addrp as *libc::sockaddr,
352363
len as libc::socklen_t) {
353364
-1 => Err(super::last_error()),

branches/try2/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/try2/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/try2/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/try2/src/librustc/front/feature_gate.rs

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

5250
// These are used to test this portion of the compiler, they don't actually
5351
// mean anything
@@ -172,13 +170,6 @@ impl Visitor<()> for Context {
172170
}
173171
}
174172

175-
ast::ItemStruct(..) => {
176-
if attr::contains_name(i.attrs, "simd") {
177-
self.gate_feature("simd", i.span,
178-
"SIMD types are experimental and possibly buggy");
179-
}
180-
}
181-
182173
_ => {}
183174
}
184175

@@ -202,10 +193,6 @@ impl Visitor<()> for Context {
202193
self.gate_feature("log_syntax", path.span, "`log_syntax!` is not \
203194
stable enough for use and is subject to change");
204195
}
205-
else if path.segments.last().unwrap().identifier == self.sess.ident_of("trace_macros") {
206-
self.gate_feature("trace_macros", path.span, "`trace_macros` is not \
207-
stable enough for use and is subject to change");
208-
}
209196
}
210197

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

branches/try2/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/try2/src/librustc/lib/llvm.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,11 +1493,6 @@ pub mod llvm {
14931493
Dialect: c_uint)
14941494
-> ValueRef;
14951495

1496-
pub static LLVMRustDebugMetadataVersion: u32;
1497-
1498-
pub fn LLVMRustAddModuleFlag(M: ModuleRef,
1499-
name: *c_char,
1500-
value: u32);
15011496

15021497
pub fn LLVMDIBuilderCreate(M: ModuleRef) -> DIBuilderRef;
15031498

branches/try2/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/try2/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,

0 commit comments

Comments
 (0)