Skip to content

Commit 818cfb8

Browse files
committed
---
yaml --- r: 103612 b: refs/heads/try c: e90a8c4 h: refs/heads/master v: v3
1 parent 0bb438d commit 818cfb8

Some content is hidden

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

54 files changed

+361
-271
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: b315aba7e4a0c426299f5b48db03d53646a480d8
5+
refs/heads/try: e90a8c4a35bffe6f0b9b46185147f907b79191ca
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ src/.DS_Store
7575
/doc/latex
7676
/doc/std
7777
/doc/extra
78+
/doc/flate
7879
/doc/green
7980
/doc/native
8081
/doc/rustc
8182
/doc/syntax
83+
/doc/rustdoc
8284
/doc/rustuv
8385
/doc/rustpkg
8486
/nd/

branches/try/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/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/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', [], 2), ('TotalOrd', ['TotalEq'], 2)]:
121+
('TotalEq', [], 1), ('TotalOrd', ['TotalEq'], 1)]:
122122
traits[trait] = (ALL, supers, errs)
123123

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

branches/try/src/libextra/dlist.rs

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

4949
/// Double-ended DList iterator
50-
#[deriving(Clone)]
5150
pub struct Items<'a, T> {
5251
priv head: &'a Link<T>,
5352
priv tail: Rawlink<Node<T>>,
5453
priv nelem: uint,
5554
}
5655

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+
5761
/// Double-ended mutable DList iterator
5862
pub struct MutItems<'a, T> {
5963
priv list: &'a mut DList<T>,

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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
4747
("macro_registrar", Active),
4848
("log_syntax", Active),
4949
("trace_macros", Active),
50+
("simd", Active),
5051

5152
// These are used to test this portion of the compiler, they don't actually
5253
// mean anything
@@ -171,6 +172,13 @@ impl Visitor<()> for Context {
171172
}
172173
}
173174

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+
174182
_ => {}
175183
}
176184

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/middle/kind.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -184,9 +184,6 @@ fn with_appropriate_checker(cx: &Context,
184184
let id = ast_util::def_id_of_def(fv.def).node;
185185
let var_t = ty::node_id_to_type(cx.tcx, id);
186186

187-
// check that only immutable variables are implicitly copied in
188-
check_imm_free_var(cx, fv.def, fv.span);
189-
190187
check_freevar_bounds(cx, fv.span, var_t, bounds, None);
191188
}
192189

@@ -447,23 +444,6 @@ pub fn check_trait_cast_bounds(cx: &Context, sp: Span, ty: ty::t,
447444
});
448445
}
449446

450-
fn check_imm_free_var(cx: &Context, def: Def, sp: Span) {
451-
match def {
452-
DefLocal(_, BindByValue(MutMutable)) => {
453-
cx.tcx.sess.span_err(
454-
sp,
455-
"mutable variables cannot be implicitly captured");
456-
}
457-
DefLocal(..) | DefArg(..) | DefBinding(..) => { /* ok */ }
458-
DefUpvar(_, def1, _, _) => { check_imm_free_var(cx, *def1, sp); }
459-
_ => {
460-
cx.tcx.sess.span_bug(
461-
sp,
462-
format!("unknown def for free variable: {:?}", def));
463-
}
464-
}
465-
}
466-
467447
fn check_copy(cx: &Context, ty: ty::t, sp: Span, reason: &str) {
468448
debug!("type_contents({})={}",
469449
ty_to_str(cx.tcx, ty),

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,17 @@ struct BindingInfo {
399399

400400
type BindingsMap = HashMap<Ident, BindingInfo>;
401401

402-
#[deriving(Clone)]
403402
struct ArmData<'a,'b> {
404403
bodycx: &'b Block<'b>,
405404
arm: &'a ast::Arm,
406405
bindings_map: @BindingsMap
407406
}
408407

408+
// FIXME #11820: method resolution is unreliable with &
409+
impl<'a,'b> Clone for ArmData<'a, 'b> {
410+
fn clone(&self) -> ArmData<'a, 'b> { *self }
411+
}
412+
409413
/**
410414
* Info about Match.
411415
* If all `pats` are matched then arm `data` will be executed.
@@ -2227,5 +2231,3 @@ fn bind_irrefutable_pat<'a>(
22272231
}
22282232
return bcx;
22292233
}
2230-
2231-

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

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -777,16 +777,16 @@ pub fn iter_structural_ty<'r,
777777
let variant_cx =
778778
fcx.new_temp_block(~"enum-iter-variant-" +
779779
variant.disr_val.to_str());
780-
let variant_cx =
781-
iter_variant(variant_cx, repr, av, *variant,
782-
substs.tps, |x,y,z| f(x,y,z));
783780
match adt::trans_case(cx, repr, variant.disr_val) {
784781
_match::single_result(r) => {
785782
AddCase(llswitch, r.val, variant_cx.llbb)
786783
}
787784
_ => ccx.sess.unimpl("value from adt::trans_case \
788785
in iter_structural_ty")
789786
}
787+
let variant_cx =
788+
iter_variant(variant_cx, repr, av, *variant,
789+
substs.tps, |x,y,z| f(x,y,z));
790790
Br(variant_cx, next_cx.llbb);
791791
}
792792
cx = next_cx;
@@ -1458,16 +1458,16 @@ pub fn build_return_block(fcx: &FunctionContext, ret_cx: &Block) {
14581458
// trans_closure: Builds an LLVM function out of a source function.
14591459
// If the function closes over its environment a closure will be
14601460
// returned.
1461-
pub fn trans_closure(ccx: @CrateContext,
1462-
path: ast_map::Path,
1463-
decl: &ast::FnDecl,
1464-
body: &ast::Block,
1465-
llfndecl: ValueRef,
1466-
param_substs: Option<@param_substs>,
1467-
id: ast::NodeId,
1468-
_attributes: &[ast::Attribute],
1469-
output_type: ty::t,
1470-
maybe_load_env: |&FunctionContext|) {
1461+
pub fn trans_closure<'a>(ccx: @CrateContext,
1462+
path: ast_map::Path,
1463+
decl: &ast::FnDecl,
1464+
body: &ast::Block,
1465+
llfndecl: ValueRef,
1466+
param_substs: Option<@param_substs>,
1467+
id: ast::NodeId,
1468+
_attributes: &[ast::Attribute],
1469+
output_type: ty::t,
1470+
maybe_load_env: |&'a Block<'a>| -> &'a Block<'a>) {
14711471
ccx.stats.n_closures.set(ccx.stats.n_closures.get() + 1);
14721472

14731473
let _icx = push_ctxt("trans_closure");
@@ -1500,7 +1500,7 @@ pub fn trans_closure(ccx: @CrateContext,
15001500

15011501
bcx = copy_args_to_allocas(&fcx, arg_scope, bcx, decl.inputs, arg_datums);
15021502

1503-
maybe_load_env(&fcx);
1503+
bcx = maybe_load_env(bcx);
15041504

15051505
// Up until here, IR instructions for this function have explicitly not been annotated with
15061506
// source code location, so we don't step into call setup code. From here on, source location
@@ -1558,16 +1558,8 @@ pub fn trans_fn(ccx: @CrateContext,
15581558
debug!("trans_fn(param_substs={})", param_substs.repr(ccx.tcx));
15591559
let _icx = push_ctxt("trans_fn");
15601560
let output_type = ty::ty_fn_ret(ty::node_id_to_type(ccx.tcx, id));
1561-
trans_closure(ccx,
1562-
path.clone(),
1563-
decl,
1564-
body,
1565-
llfndecl,
1566-
param_substs,
1567-
id,
1568-
attrs,
1569-
output_type,
1570-
|_fcx| { });
1561+
trans_closure(ccx, path.clone(), decl, body, llfndecl,
1562+
param_substs, id, attrs, output_type, |bcx| bcx);
15711563
}
15721564

15731565
pub fn trans_enum_variant(ccx: @CrateContext,
@@ -2678,15 +2670,15 @@ pub fn trans_crate(sess: session::Session,
26782670
let link_meta = link::build_link_meta(sess, crate.attrs, output,
26792671
&mut symbol_hasher);
26802672

2681-
// Append ".rc" to crate name as LLVM module identifier.
2673+
// Append ".rs" to crate name as LLVM module identifier.
26822674
//
26832675
// LLVM code generator emits a ".file filename" directive
26842676
// for ELF backends. Value of the "filename" is set as the
26852677
// LLVM module identifier. Due to a LLVM MC bug[1], LLVM
26862678
// crashes if the module identifer is same as other symbols
26872679
// such as a function name in the module.
26882680
// 1. http://llvm.org/bugs/show_bug.cgi?id=11479
2689-
let llmod_id = link_meta.crateid.name.clone() + ".rc";
2681+
let llmod_id = link_meta.crateid.name.clone() + ".rs";
26902682

26912683
let ccx = @CrateContext::new(sess,
26922684
llmod_id,

0 commit comments

Comments
 (0)