Skip to content

Commit e51dcc3

Browse files
committed
---
yaml --- r: 152722 b: refs/heads/try2 c: abdbaa2 h: refs/heads/master v: v3
1 parent d158a60 commit e51dcc3

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
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: db9af1d505809c965e719bf4ad775ff984ee3da6
8+
refs/heads/try2: abdbaa2e19dcf6859ae781bb9b44fed483181229
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -934,22 +934,17 @@ pub fn lltype_for_foreign_fn(ccx: &CrateContext, ty: ty::t) -> Type {
934934

935935
fn add_argument_attributes(tys: &ForeignTypes,
936936
llfn: ValueRef) {
937-
let mut i = 0;
938-
939-
if tys.fn_ty.ret_ty.is_indirect() {
940-
match tys.fn_ty.ret_ty.attr {
941-
Some(attr) => {
942-
let llarg = get_param(llfn, i);
943-
unsafe {
944-
llvm::LLVMAddAttribute(llarg, attr as c_uint);
945-
}
946-
}
947-
None => {}
948-
}
937+
let mut i = if tys.fn_ty.ret_ty.is_indirect() { 1 } else { 0 };
949938

950-
i += 1;
939+
match tys.fn_ty.ret_ty.attr {
940+
Some(attr) => unsafe {
941+
llvm::LLVMAddFunctionAttribute(llfn, i as c_uint, attr as u64);
942+
},
943+
None => {}
951944
}
952945

946+
i += 1;
947+
953948
for &arg_ty in tys.fn_ty.arg_tys.iter() {
954949
if arg_ty.is_ignore() {
955950
continue;
@@ -958,12 +953,9 @@ fn add_argument_attributes(tys: &ForeignTypes,
958953
if arg_ty.pad.is_some() { i += 1; }
959954

960955
match arg_ty.attr {
961-
Some(attr) => {
962-
let llarg = get_param(llfn, i);
963-
unsafe {
964-
llvm::LLVMAddAttribute(llarg, attr as c_uint);
965-
}
966-
}
956+
Some(attr) => unsafe {
957+
llvm::LLVMAddFunctionAttribute(llfn, i as c_uint, attr as u64);
958+
},
967959
None => ()
968960
}
969961

branches/try2/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2651,7 +2651,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
26512651
let error = if vst == ast::ExprVstoreSlice {
26522652
"`&\"string\"` has been removed; use `\"string\"` instead"
26532653
} else {
2654-
"`box \"string\"` has been removed; use `\"string\".to_string()` instead"
2654+
"`~\"string\"` has been removed; use `\"string\".to_string()` instead"
26552655
};
26562656
tcx.sess.span_err(expr.span, error);
26572657
ty::mk_err()

0 commit comments

Comments
 (0)