Skip to content

Commit 0873974

Browse files
committed
Rollup merge of rust-lang#49417 - TimNN:fix-ios, r=alexcrichton
Update compiler-rt with fix for 32bit iOS ARM
2 parents b4bc2b0 + 5b1a600 commit 0873974

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/librustc_allocator/expand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl<'a> AllocFnFactory<'a> {
145145
let result = self.call_allocator(method.name, args);
146146
let (output_ty, output_expr) =
147147
self.ret_ty(&method.output, &mut abi_args, mk, result);
148-
let kind = ItemKind::Fn(self.cx.fn_decl(abi_args, output_ty),
148+
let kind = ItemKind::Fn(self.cx.fn_decl(abi_args, ast::FunctionRetTy::Ty(output_ty)),
149149
Unsafety::Unsafe,
150150
dummy_spanned(Constness::NotConst),
151151
Abi::Rust,

src/libsyntax/ext/build.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ pub trait AstBuilder {
214214

215215
fn arg(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> ast::Arg;
216216
// FIXME unused self
217-
fn fn_decl(&self, inputs: Vec<ast::Arg> , output: P<ast::Ty>) -> P<ast::FnDecl>;
217+
fn fn_decl(&self, inputs: Vec<ast::Arg> , output: ast::FunctionRetTy) -> P<ast::FnDecl>;
218218

219219
fn item_fn_poly(&self,
220220
span: Span,
@@ -924,7 +924,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
924924
-> P<ast::Expr> {
925925
let fn_decl = self.fn_decl(
926926
ids.iter().map(|id| self.arg(span, *id, self.ty_infer(span))).collect(),
927-
self.ty_infer(span));
927+
ast::FunctionRetTy::Default(span));
928928

929929
// FIXME -- We are using `span` as the span of the `|...|`
930930
// part of the lambda, but it probably (maybe?) corresponds to
@@ -970,10 +970,10 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
970970
}
971971

972972
// FIXME unused self
973-
fn fn_decl(&self, inputs: Vec<ast::Arg>, output: P<ast::Ty>) -> P<ast::FnDecl> {
973+
fn fn_decl(&self, inputs: Vec<ast::Arg>, output: ast::FunctionRetTy) -> P<ast::FnDecl> {
974974
P(ast::FnDecl {
975975
inputs,
976-
output: ast::FunctionRetTy::Ty(output),
976+
output,
977977
variadic: false
978978
})
979979
}
@@ -1003,7 +1003,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
10031003
self.item(span,
10041004
name,
10051005
Vec::new(),
1006-
ast::ItemKind::Fn(self.fn_decl(inputs, output),
1006+
ast::ItemKind::Fn(self.fn_decl(inputs, ast::FunctionRetTy::Ty(output)),
10071007
ast::Unsafety::Normal,
10081008
dummy_spanned(ast::Constness::NotConst),
10091009
Abi::Rust,

src/libsyntax/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ fn mk_main(cx: &mut TestCtxt) -> P<ast::Item> {
547547
// pub fn main() { ... }
548548
let main_ret_ty = ecx.ty(sp, ast::TyKind::Tup(vec![]));
549549
let main_body = ecx.block(sp, vec![call_test_main]);
550-
let main = ast::ItemKind::Fn(ecx.fn_decl(vec![], main_ret_ty),
550+
let main = ast::ItemKind::Fn(ecx.fn_decl(vec![], ast::FunctionRetTy::Ty(main_ret_ty)),
551551
ast::Unsafety::Normal,
552552
dummy_spanned(ast::Constness::NotConst),
553553
::abi::Abi::Rust, ast::Generics::default(), main_body);

src/libsyntax_ext/deriving/encodable.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ fn encodable_substructure(cx: &mut ExtCtxt,
228228
}
229229

230230
// unit structs have no fields and need to return Ok()
231-
if stmts.is_empty() {
231+
let blk = if stmts.is_empty() {
232232
let ok = cx.expr_ok(trait_span, cx.expr_tuple(trait_span, vec![]));
233-
let ret_ok = cx.expr(trait_span, ExprKind::Ret(Some(ok)));
234-
stmts.push(cx.stmt_expr(ret_ok));
235-
}
233+
cx.lambda1(trait_span, ok, blkarg)
234+
} else {
235+
cx.lambda_stmts_1(trait_span, stmts, blkarg)
236+
};
236237

237-
let blk = cx.lambda_stmts_1(trait_span, stmts, blkarg);
238238
cx.expr_method_call(trait_span,
239239
encoder,
240240
cx.ident_of("emit_struct"),

src/libsyntax_ext/deriving/generic/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ impl<'a> MethodDef<'a> {
962962
let ret_type = self.get_ret_ty(cx, trait_, generics, type_ident);
963963

964964
let method_ident = cx.ident_of(self.name);
965-
let fn_decl = cx.fn_decl(args, ret_type);
965+
let fn_decl = cx.fn_decl(args, ast::FunctionRetTy::Ty(ret_type));
966966
let body_block = cx.block_expr(body);
967967

968968
let unsafety = if self.is_unsafe {

0 commit comments

Comments
 (0)