Skip to content

Commit 35b336f

Browse files
committed
---
yaml --- r: 95727 b: refs/heads/dist-snap c: 5dd1583 h: refs/heads/master i: 95725: b7a98bf 95723: 94db7d9 95719: 2153e0b 95711: b9303b0 v: v3
1 parent 12a5314 commit 35b336f

File tree

40 files changed

+317
-309
lines changed

40 files changed

+317
-309
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: e6650c87a3800264a043b7f129e6a4841c4cc3f7
9+
refs/heads/dist-snap: 5dd1583c57fbee9a07ac1111858871c241a24c50
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libextra/future.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ impl<A:Clone> Future<A> {
5151

5252
impl<A> Future<A> {
5353
/// Gets the value from this future, forcing evaluation.
54-
pub fn unwrap(mut self) -> A {
55-
self.get_ref();
56-
let state = replace(&mut self.state, Evaluating);
54+
pub fn unwrap(self) -> A {
55+
let mut this = self;
56+
this.get_ref();
57+
let state = replace(&mut this.state, Evaluating);
5758
match state {
5859
Forced(v) => v,
5960
_ => fail!( "Logic error." ),

branches/dist-snap/src/librustc/lib/llvm.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,6 @@ pub mod llvm {
693693
pub fn LLVMAddReturnAttribute(Fn: ValueRef, PA: c_uint);
694694
pub fn LLVMRemoveReturnAttribute(Fn: ValueRef, PA: c_uint);
695695

696-
pub fn LLVMAddColdAttribute(Fn: ValueRef);
697-
698696
pub fn LLVMRemoveFunctionAttr(Fn: ValueRef,
699697
PA: c_ulonglong,
700698
HighPA: c_ulonglong);

branches/dist-snap/src/librustc/middle/moves.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ impl VisitContext {
420420
// specified and (2) have a type that
421421
// moves-by-default:
422422
let consume_with = with_fields.iter().any(|tf| {
423-
!fields.iter().any(|f| f.ident.node.name == tf.ident.name) &&
423+
!fields.iter().any(|f| f.ident.name == tf.ident.name) &&
424424
ty::type_moves_by_default(self.tcx, tf.mt.ty)
425425
});
426426

branches/dist-snap/src/librustc/middle/privacy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,15 +716,15 @@ impl<'self> Visitor<()> for PrivacyVisitor<'self> {
716716
match ty::get(ty::expr_ty(self.tcx, expr)).sty {
717717
ty::ty_struct(id, _) => {
718718
for field in (*fields).iter() {
719-
self.check_field(expr.span, id, field.ident.node);
719+
self.check_field(expr.span, id, field.ident);
720720
}
721721
}
722722
ty::ty_enum(_, _) => {
723723
match self.tcx.def_map.get_copy(&expr.id) {
724724
ast::DefVariant(_, variant_id, _) => {
725725
for field in fields.iter() {
726726
self.check_field(expr.span, variant_id,
727-
field.ident.node);
727+
field.ident);
728728
}
729729
}
730730
_ => self.tcx.sess.span_bug(expr.span,

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -202,21 +202,19 @@ pub fn get_extern_fn(externs: &mut ExternMap, llmod: ModuleRef, name: &str,
202202
f
203203
}
204204

205-
fn get_extern_rust_fn(ccx: &mut CrateContext, inputs: &[ty::t], output: ty::t,
206-
name: &str, did: ast::DefId) -> ValueRef {
205+
pub fn get_extern_rust_fn(ccx: &mut CrateContext, inputs: &[ty::t], output: ty::t,
206+
name: &str) -> ValueRef {
207207
match ccx.externs.find_equiv(&name) {
208208
Some(n) => return *n,
209209
None => ()
210210
}
211211
let f = decl_rust_fn(ccx, inputs, output, name);
212-
do csearch::get_item_attrs(ccx.tcx.cstore, did) |meta_items| {
213-
set_llvm_fn_attrs(meta_items.iter().map(|&x| attr::mk_attr(x)).to_owned_vec(), f)
214-
}
215212
ccx.externs.insert(name.to_owned(), f);
216213
f
217214
}
218215

219-
fn decl_rust_fn(ccx: &mut CrateContext, inputs: &[ty::t], output: ty::t, name: &str) -> ValueRef {
216+
pub fn decl_rust_fn(ccx: &mut CrateContext, inputs: &[ty::t], output: ty::t,
217+
name: &str) -> ValueRef {
220218
let llfty = type_of_rust_fn(ccx, inputs, output);
221219
let llfn = decl_cdecl_fn(ccx.llmod, name, llfty);
222220

@@ -483,10 +481,6 @@ pub fn set_llvm_fn_attrs(attrs: &[ast::Attribute], llfn: ValueRef) {
483481
if contains_name(attrs, "no_split_stack") {
484482
set_no_split_stack(llfn);
485483
}
486-
487-
if contains_name(attrs, "cold") {
488-
unsafe { llvm::LLVMAddColdAttribute(llfn) }
489-
}
490484
}
491485

492486
pub fn set_always_inline(f: ValueRef) {
@@ -846,7 +840,7 @@ pub fn trans_external_path(ccx: &mut CrateContext, did: ast::DefId, t: ty::t) ->
846840
ty::ty_bare_fn(ref fn_ty) => {
847841
match fn_ty.abis.for_arch(ccx.sess.targ_cfg.arch) {
848842
Some(Rust) | Some(RustIntrinsic) => {
849-
get_extern_rust_fn(ccx, fn_ty.sig.inputs, fn_ty.sig.output, name, did)
843+
get_extern_rust_fn(ccx, fn_ty.sig.inputs, fn_ty.sig.output, name)
850844
}
851845
Some(*) | None => {
852846
let c = foreign::llvm_calling_convention(ccx, fn_ty.abis);
@@ -857,7 +851,7 @@ pub fn trans_external_path(ccx: &mut CrateContext, did: ast::DefId, t: ty::t) ->
857851
}
858852
}
859853
ty::ty_closure(ref f) => {
860-
get_extern_rust_fn(ccx, f.sig.inputs, f.sig.output, name, did)
854+
get_extern_rust_fn(ccx, f.sig.inputs, f.sig.output, name)
861855
}
862856
_ => {
863857
let llty = type_of(ccx, t);
@@ -2850,8 +2844,6 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
28502844
ifn!(intrinsics, "llvm.umul.with.overflow.i64",
28512845
[Type::i64(), Type::i64()], Type::struct_([Type::i64(), Type::i1()], false));
28522846

2853-
ifn!(intrinsics, "llvm.expect.i1", [Type::i1(), Type::i1()], Type::i1());
2854-
28552847
return intrinsics;
28562848
}
28572849

branches/dist-snap/src/librustc/middle/trans/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ fn const_expr_unadjusted(cx: @mut CrateContext,
508508
|discr, field_tys| {
509509
let cs = field_tys.iter().enumerate()
510510
.map(|(ix, &field_ty)| {
511-
match fs.iter().find(|f| field_ty.ident.name == f.ident.node.name) {
511+
match fs.iter().find(|f| field_ty.ident.name == f.ident.name) {
512512
Some(f) => const_expr(cx, (*f).expr),
513513
None => {
514514
match base_val {

branches/dist-snap/src/librustc/middle/trans/expr.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -981,9 +981,7 @@ fn trans_lvalue_unadjusted(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock {
981981
debug!("trans_index: len {}", bcx.val_to_str(len));
982982

983983
let bounds_check = ICmp(bcx, lib::llvm::IntUGE, ix_val, len);
984-
let expect = ccx.intrinsics.get_copy(&("llvm.expect.i1"));
985-
let expected = Call(bcx, expect, [bounds_check, C_i1(false)], []);
986-
let bcx = do with_cond(bcx, expected) |bcx| {
984+
let bcx = do with_cond(bcx, bounds_check) |bcx| {
987985
controlflow::trans_fail_bounds_check(bcx, index_expr.span, ix_val, len)
988986
};
989987
let elt = InBoundsGEP(bcx, base, [ix_val]);
@@ -1211,7 +1209,7 @@ fn trans_rec_or_struct(bcx: @mut Block,
12111209
let numbered_fields = do fields.map |field| {
12121210
let opt_pos =
12131211
field_tys.iter().position(|field_ty|
1214-
field_ty.ident.name == field.ident.node.name);
1212+
field_ty.ident.name == field.ident.name);
12151213
match opt_pos {
12161214
Some(i) => {
12171215
need_base[i] = false;

branches/dist-snap/src/librustc/middle/typeck/check/mod.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,6 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
20092009
}
20102010

20112011
fn check_struct_or_variant_fields(fcx: @mut FnCtxt,
2012-
struct_ty: ty::t,
20132012
span: Span,
20142013
class_id: ast::DefId,
20152014
node_id: ast::NodeId,
@@ -2031,30 +2030,28 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
20312030
for field in ast_fields.iter() {
20322031
let mut expected_field_type = ty::mk_err();
20332032

2034-
let pair = class_field_map.find(&field.ident.node.name).map(|x| *x);
2033+
let pair = class_field_map.find(&field.ident.name).map(|x| *x);
20352034
match pair {
20362035
None => {
2037-
fcx.type_error_message(
2038-
field.ident.span,
2039-
|actual| {
2040-
format!("structure `{}` has no field named `{}`",
2041-
actual, tcx.sess.str_of(field.ident.node))
2042-
}, struct_ty, None);
2036+
tcx.sess.span_err(
2037+
field.span,
2038+
format!("structure has no field named `{}`",
2039+
tcx.sess.str_of(field.ident)));
20432040
error_happened = true;
20442041
}
20452042
Some((_, true)) => {
20462043
tcx.sess.span_err(
2047-
field.ident.span,
2044+
field.span,
20482045
format!("field `{}` specified more than once",
2049-
tcx.sess.str_of(field.ident.node)));
2046+
tcx.sess.str_of(field.ident)));
20502047
error_happened = true;
20512048
}
20522049
Some((field_id, false)) => {
20532050
expected_field_type =
20542051
ty::lookup_field_type(
20552052
tcx, class_id, field_id, &substitutions);
20562053
class_field_map.insert(
2057-
field.ident.node.name, (field_id, true));
2054+
field.ident.name, (field_id, true));
20582055
fields_found += 1;
20592056
}
20602057
}
@@ -2164,7 +2161,6 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
21642161
// Look up and check the fields.
21652162
let class_fields = ty::lookup_struct_fields(tcx, class_id);
21662163
check_struct_or_variant_fields(fcx,
2167-
struct_type,
21682164
span,
21692165
class_id,
21702166
id,
@@ -2252,7 +2248,6 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
22522248
// Look up and check the enum variant fields.
22532249
let variant_fields = ty::lookup_struct_fields(tcx, variant_id);
22542250
check_struct_or_variant_fields(fcx,
2255-
enum_type,
22562251
span,
22572252
variant_id,
22582253
id,

branches/dist-snap/src/librustpkg/package_source.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,6 @@ impl PkgSrc {
422422
fail!("Bad kind in build_crates")
423423
});
424424
}
425-
debug!("Compiling crate {}; its output will be in {}",
426-
subpath.display(), sub_dir.display());
427425
let result = compile_crate(&subcx,
428426
exec,
429427
&id,
@@ -475,8 +473,8 @@ impl PkgSrc {
475473
let tests = self.tests.clone();
476474
let benchs = self.benchs.clone();
477475
debug!("Building libs in {}, destination = {}",
478-
self.source_workspace.display(),
479-
self.build_workspace().display());
476+
self.destination_workspace.display(),
477+
self.destination_workspace.display());
480478
self.build_crates(build_context,
481479
&mut deps,
482480
libs,

branches/dist-snap/src/librustpkg/rustpkg.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,8 @@ impl CtxMethods for BuildContext {
587587
build_inputs,
588588
&pkg_src.destination_workspace,
589589
&id).map(|s| Path::new(s.as_slice()));
590+
debug!("install: id = {}, about to call discover_outputs, {:?}",
591+
id.to_str(), result.map(|p| p.display().to_str()));
590592
installed_files = installed_files + result;
591593
note(format!("Installed package {} to {}",
592594
id.to_str(),

branches/dist-snap/src/librustpkg/tests.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,30 +1511,6 @@ fn rust_path_hack_build_no_arg() {
15111511
assert!(!built_library_exists(&source_dir, "foo"));
15121512
}
15131513

1514-
#[test]
1515-
fn rust_path_hack_build_with_dependency() {
1516-
let foo_id = PkgId::new("foo");
1517-
let dep_id = PkgId::new("dep");
1518-
// Tests that when --rust-path-hack is in effect, dependencies get built
1519-
// into the destination workspace and not the source directory
1520-
let work_dir = create_local_package(&foo_id);
1521-
let work_dir = work_dir.path();
1522-
let dep_workspace = create_local_package(&dep_id);
1523-
let dep_workspace = dep_workspace.path();
1524-
let dest_workspace = mk_emptier_workspace("dep");
1525-
let dest_workspace = dest_workspace.path();
1526-
let source_dir = work_dir.join_many(["src", "foo-0.1"]);
1527-
writeFile(&source_dir.join("lib.rs"), "extern mod dep; pub fn f() { }");
1528-
let dep_dir = dep_workspace.join_many(["src", "dep-0.1"]);
1529-
let rust_path = Some(~[(~"RUST_PATH",
1530-
format!("{}:{}",
1531-
dest_workspace.display(),
1532-
dep_dir.display()))]);
1533-
command_line_test_with_env([~"build", ~"--rust-path-hack", ~"foo"], work_dir, rust_path);
1534-
assert_built_library_exists(dest_workspace, "dep");
1535-
assert!(!built_library_exists(dep_workspace, "dep"));
1536-
}
1537-
15381514
#[test]
15391515
fn rust_path_install_target() {
15401516
let dir_for_path = TempDir::new(

branches/dist-snap/src/librustpkg/util.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -465,31 +465,22 @@ impl<'self> Visitor<()> for ViewItemVisitor<'self> {
465465
// Find all the workspaces in the RUST_PATH that contain this package.
466466
let workspaces = pkg_parent_workspaces(&self.context.context,
467467
&pkg_id);
468-
// Three cases:
468+
// Two cases:
469469
// (a) `workspaces` is empty. That means there's no local source
470470
// for this package. In that case, we pass the default workspace
471471
// into `PkgSrc::new`, so that if it exists as a remote repository,
472-
// its sources will be fetched into it. We also put the output in the
473-
// same workspace.
474-
// (b) We're using the Rust path hack. In that case, the output goes
475-
// in the destination workspace.
476-
// (c) `workspaces` is non-empty -- we found a local source for this
477-
// package and will build in that workspace.
478-
let (source_workspace, dest_workspace) = if workspaces.is_empty() {
479-
(default_workspace(), default_workspace())
480-
} else {
481-
if self.context.context.use_rust_path_hack {
482-
(workspaces[0], default_workspace())
483-
} else {
484-
(workspaces[0].clone(), workspaces[0])
485-
}
486-
};
472+
// its sources will be fetched into it.
473+
// (b) `workspaces` is non-empty -- we found a local source for this
474+
// package.
475+
let dest_workspace = if workspaces.is_empty() {
476+
default_workspace()
477+
} else { workspaces[0] };
487478
// In this case, the source and destination workspaces are the same:
488479
// Either it's a remote package, so the local sources don't exist
489480
// and the `PkgSrc` constructor will detect that;
490481
// or else it's already in a workspace and we'll build into that
491482
// workspace
492-
let pkg_src = PkgSrc::new(source_workspace,
483+
let pkg_src = PkgSrc::new(dest_workspace.clone(),
493484
dest_workspace,
494485
// Use the rust_path_hack to search for dependencies iff
495486
// we were already using it

branches/dist-snap/src/libstd/rt/borrowck.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ pub fn clear_task_borrow_list() {
5757
let _ = try_take_task_borrow_list();
5858
}
5959

60-
#[cold]
6160
unsafe fn fail_borrowed(box: *mut raw::Box<()>, file: *c_char, line: size_t) -> ! {
6261
debug_borrow("fail_borrowed: ", box, 0, 0, file, line);
6362

0 commit comments

Comments
 (0)