Skip to content

Commit 8aba74e

Browse files
committed
---
yaml --- r: 138974 b: refs/heads/try2 c: efc7f82 h: refs/heads/master v: v3
1 parent 947454c commit 8aba74e

File tree

21 files changed

+499
-167
lines changed

21 files changed

+499
-167
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: 67b0f3d5b2d88ea9b5c0a667fc3dbdf794e5c054
8+
refs/heads/try2: efc7f82bc44926c864c52caca8764816ab9150dd
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/rt/thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct Thread {
2222
impl Thread {
2323
static fn start(main: ~fn()) -> Thread {
2424
fn substart(main: &fn()) -> *raw_thread {
25-
unsafe { rust_raw_thread_start(main) }
25+
unsafe { rust_raw_thread_start(&main) }
2626
}
2727
let raw = substart(main);
2828
Thread {
@@ -39,6 +39,6 @@ impl Drop for Thread {
3939
}
4040

4141
extern {
42-
pub unsafe fn rust_raw_thread_start(f: &fn()) -> *raw_thread;
42+
pub unsafe fn rust_raw_thread_start(f: &(&fn())) -> *raw_thread;
4343
pub unsafe fn rust_raw_thread_join_delete(thread: *raw_thread);
4444
}

branches/try2/src/libcore/unstable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ mod rustrt {
4747
pub unsafe fn rust_lock_little_lock(lock: rust_little_lock);
4848
pub unsafe fn rust_unlock_little_lock(lock: rust_little_lock);
4949

50-
pub unsafe fn rust_raw_thread_start(f: &fn()) -> *raw_thread;
50+
pub unsafe fn rust_raw_thread_start(f: &(&fn())) -> *raw_thread;
5151
pub unsafe fn rust_raw_thread_join_delete(thread: *raw_thread);
5252
}
5353
}
@@ -72,7 +72,7 @@ pub fn run_in_bare_thread(f: ~fn()) {
7272
let closure: &fn() = || {
7373
f()
7474
};
75-
let thread = rustrt::rust_raw_thread_start(closure);
75+
let thread = rustrt::rust_raw_thread_start(&closure);
7676
rustrt::rust_raw_thread_join_delete(thread);
7777
chan.send(());
7878
}

branches/try2/src/librust/rust.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// except according to those terms.
1010

1111
// rust - central access to other rust tools
12-
// FIXME #2238 Make commands run and test emit proper file endings on winds
13-
// FIXME #2238 Make run only accept source that emits an executable
12+
// XXX: Make commands run and test emit proper file endings on winds
13+
// XXX: Make run only accept source that emits an executable
1414

1515
#[deny(deprecated_self)];
1616

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ pub mod llvm {
14431443
/** Prepares inline assembly. */
14441444
pub unsafe fn LLVMInlineAsm(Ty: TypeRef, AsmString: *c_char,
14451445
Constraints: *c_char, SideEffects: Bool,
1446-
AlignStack: Bool, Dialect: AsmDialect)
1446+
AlignStack: Bool, Dialect: c_uint)
14471447
-> ValueRef;
14481448
}
14491449
}

branches/try2/src/librustc/middle/lint.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ pub enum lint {
7878
deprecated_self,
7979
deprecated_mutable_fields,
8080
deprecated_drop,
81+
foreign_mode,
8182

8283
managed_heap_memory,
8384
owned_heap_memory,
@@ -182,6 +183,13 @@ pub fn get_lint_dict() -> LintDict {
182183
default: warn
183184
}),
184185

186+
(@~"foreign_mode",
187+
@LintSpec {
188+
lint: foreign_mode,
189+
desc: "warn about deprecated uses of modes in foreign fns",
190+
default: warn
191+
}),
192+
185193
(@~"deprecated_pattern",
186194
@LintSpec {
187195
lint: deprecated_pattern,
@@ -753,6 +761,20 @@ fn check_item_ctypes(cx: ty::ctxt, it: @ast::item) {
753761

754762
fn check_foreign_fn(cx: ty::ctxt, fn_id: ast::node_id,
755763
decl: &ast::fn_decl) {
764+
// warn about `&&` mode on foreign functions, both because it is
765+
// deprecated and because its semantics have changed recently:
766+
for decl.inputs.eachi |i, arg| {
767+
match ty::resolved_mode(cx, arg.mode) {
768+
ast::by_val | ast::by_copy => {}
769+
ast::by_ref => {
770+
cx.sess.span_lint(
771+
foreign_mode, fn_id, fn_id, arg.ty.span,
772+
fmt!("foreign function uses `&&` mode \
773+
on argument %u", i));
774+
}
775+
}
776+
}
777+
756778
let tys = vec::map(decl.inputs, |a| a.ty );
757779
for vec::each(vec::append_one(tys, decl.output)) |ty| {
758780
match ty.node {
@@ -785,7 +807,7 @@ fn check_item_ctypes(cx: ty::ctxt, it: @ast::item) {
785807
if attr::foreign_abi(it.attrs) !=
786808
either::Right(ast::foreign_abi_rust_intrinsic) => {
787809
for nmod.items.each |ni| {
788-
match /*bad*/copy ni.node {
810+
match ni.node {
789811
ast::foreign_item_fn(ref decl, _, _) => {
790812
check_foreign_fn(cx, it.id, decl);
791813
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ pub fn in_lpad_scope_cx(bcx: block, f: &fn(+si: &mut scope_info)) {
867867
let mut bcx = bcx;
868868
loop {
869869
{
870-
// FIXME #4280: Borrow check bug workaround.
870+
// XXX: Borrow check bug workaround.
871871
let kind: &mut block_kind = &mut *bcx.kind;
872872
match *kind {
873873
block_scope(ref mut inf) => {
@@ -1272,7 +1272,7 @@ pub fn cleanup_and_leave(bcx: block,
12721272
}
12731273

12741274
{
1275-
// FIXME #4280: Borrow check bug workaround.
1275+
// XXX: Borrow check bug workaround.
12761276
let kind: &mut block_kind = &mut *cur.kind;
12771277
match *kind {
12781278
block_scope(ref mut inf) if !inf.cleanups.is_empty() => {
@@ -1850,7 +1850,8 @@ pub fn trans_enum_variant(ccx: @CrateContext,
18501850
};
18511851
let fcx = new_fn_ctxt_w_id(ccx, ~[], llfndecl, variant.node.id, None,
18521852
param_substs, None);
1853-
let raw_llargs = create_llargs_for_fn_args(fcx, no_self, fn_args);
1853+
// XXX: Bad copy.
1854+
let raw_llargs = create_llargs_for_fn_args(fcx, no_self, copy fn_args);
18541855
let ty_param_substs = match param_substs {
18551856
Some(ref substs) => /*bad*/copy substs.tys,
18561857
None => ~[]

branches/try2/src/librustc/middle/trans/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ pub fn InlineAsmCall(cx: block, asm: *c_char, cons: *c_char,
885885
886886
let llfty = T_fn(~[], T_void());
887887
let v = llvm::LLVMInlineAsm(llfty, asm, cons, volatile,
888-
alignstack, dia);
888+
alignstack, dia as c_uint);
889889
890890
Call(cx, v, ~[])
891891
}

branches/try2/src/librustc/middle/trans/callee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ pub fn trans_arg_expr(bcx: block,
757757

758758
if formal_ty.ty != arg_datum.ty {
759759
// this could happen due to e.g. subtyping
760-
let llformal_ty = type_of::type_of_explicit_arg(ccx, formal_ty);
760+
let llformal_ty = type_of::type_of_explicit_arg(ccx, &formal_ty);
761761
debug!("casting actual type (%s) to match formal (%s)",
762762
bcx.val_str(val), bcx.llty_str(llformal_ty));
763763
val = PointerCast(bcx, val, llformal_ty);

0 commit comments

Comments
 (0)