Skip to content

Commit bdd01e8

Browse files
committed
---
yaml --- r: 58205 b: refs/heads/auto c: 3532350 h: refs/heads/master i: 58203: 80168c2 v: v3
1 parent 589370f commit bdd01e8

File tree

4 files changed

+24
-28
lines changed

4 files changed

+24
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 1d7a13614525f2a3ec6c57aa3ac4afad2e21487e
17+
refs/heads/auto: 35323500163a17fc9c6fbbd2298d31ad171b4296
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ endif
101101

102102
ifdef CFG_ENABLE_DEBUG
103103
$(info cfg: enabling more debugging (CFG_ENABLE_DEBUG))
104-
CFG_RUSTC_FLAGS +=
104+
CFG_RUSTC_FLAGS += --cfg debug
105105
CFG_GCCISH_CFLAGS += -DRUST_DEBUG
106106
else
107107
CFG_GCCISH_CFLAGS += -DRUST_NDEBUG

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,19 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
13111311
// Extract the function signature from `in_fty`.
13121312
let fn_sty = structure_of(fcx, f.span, fn_ty);
13131313

1314+
// FIXME(#3678) For now, do not permit calls to C abi functions.
1315+
match fn_sty {
1316+
ty::ty_bare_fn(ty::BareFnTy {abis, _}) => {
1317+
if !abis.is_rust() {
1318+
fcx.tcx().sess.span_err(
1319+
call_expr.span,
1320+
fmt!("Calls to C ABI functions are not (yet) \
1321+
supported; be patient, dear user"));
1322+
}
1323+
}
1324+
_ => {}
1325+
}
1326+
13141327
let fn_sig = match fn_sty {
13151328
ty::ty_bare_fn(ty::BareFnTy {sig: sig, _}) |
13161329
ty::ty_closure(ty::ClosureTy {sig: sig, _}) => sig,
@@ -3594,7 +3607,7 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
35943607
};
35953608
let fty = ty::mk_bare_fn(tcx, ty::BareFnTy {
35963609
purity: ast::unsafe_fn,
3597-
abis: AbiSet::Intrinsic(),
3610+
abis: AbiSet::Rust(),
35983611
sig: FnSig {bound_lifetime_names: opt_vec::Empty,
35993612
inputs: inputs,
36003613
output: output}

branches/auto/src/librustc/middle/typeck/collect.rs

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ impl AstConv for CrateCtxt {
134134
Some(&ast_map::node_item(item, _)) => {
135135
ty_of_item(self, item)
136136
}
137-
Some(&ast_map::node_foreign_item(foreign_item, abis, _, _)) => {
138-
ty_of_foreign_item(self, foreign_item, abis)
137+
Some(&ast_map::node_foreign_item(foreign_item, _, _, _)) => {
138+
ty_of_foreign_item(self, foreign_item)
139139
}
140140
ref x => {
141141
self.tcx.sess.bug(fmt!("unexpected sort of item \
@@ -932,20 +932,7 @@ pub fn convert_foreign(ccx: &CrateCtxt, i: @ast::foreign_item) {
932932
// As above, this call populates the type table with the converted
933933
// type of the foreign item. We simply write it into the node type
934934
// table.
935-
936-
// For reasons I cannot fully articulate, I do so hate the AST
937-
// map, and I regard each time that I use it as a personal and
938-
// moral failing, but at the moment it seems like the only
939-
// convenient way to extract the ABI. - ndm
940-
let abis = match ccx.tcx.items.find(&i.id) {
941-
Some(&ast_map::node_foreign_item(_, abis, _, _)) => abis,
942-
ref x => {
943-
ccx.tcx.sess.bug(fmt!("unexpected sort of item \
944-
in get_item_ty(): %?", (*x)));
945-
}
946-
};
947-
948-
let tpt = ty_of_foreign_item(ccx, i, abis);
935+
let tpt = ty_of_foreign_item(ccx, i);
949936
write_ty_to_tcx(ccx.tcx, i.id, tpt.ty);
950937
ccx.tcx.tcache.insert(local_def(i.id), tpt);
951938
}
@@ -1116,17 +1103,14 @@ pub fn ty_of_item(ccx: &CrateCtxt, it: @ast::item)
11161103
}
11171104
}
11181105
1119-
pub fn ty_of_foreign_item(ccx: &CrateCtxt,
1120-
it: @ast::foreign_item,
1121-
abis: AbiSet) -> ty::ty_param_bounds_and_ty
1122-
{
1106+
pub fn ty_of_foreign_item(ccx: &CrateCtxt, it: @ast::foreign_item)
1107+
-> ty::ty_param_bounds_and_ty {
11231108
match it.node {
11241109
ast::foreign_item_fn(ref fn_decl, _, ref generics) => {
11251110
ty_of_foreign_fn_decl(ccx,
11261111
fn_decl,
11271112
local_def(it.id),
1128-
generics,
1129-
abis)
1113+
generics)
11301114
}
11311115
ast::foreign_item_const(t) => {
11321116
ty::ty_param_bounds_and_ty {
@@ -1213,8 +1197,7 @@ pub fn ty_generics(ccx: &CrateCtxt,
12131197
pub fn ty_of_foreign_fn_decl(ccx: &CrateCtxt,
12141198
decl: &ast::fn_decl,
12151199
def_id: ast::def_id,
1216-
ast_generics: &ast::Generics,
1217-
abis: AbiSet)
1200+
ast_generics: &ast::Generics)
12181201
-> ty::ty_param_bounds_and_ty {
12191202
let ty_generics = ty_generics(ccx, None, ast_generics, 0);
12201203
let region_param_names = RegionParamNames::from_generics(ast_generics);
@@ -1225,7 +1208,7 @@ pub fn ty_of_foreign_fn_decl(ccx: &CrateCtxt,
12251208
let t_fn = ty::mk_bare_fn(
12261209
ccx.tcx,
12271210
ty::BareFnTy {
1228-
abis: abis,
1211+
abis: AbiSet::Rust(),
12291212
purity: ast::unsafe_fn,
12301213
sig: ty::FnSig {bound_lifetime_names: opt_vec::Empty,
12311214
inputs: input_tys,

0 commit comments

Comments
 (0)