Skip to content

Commit 55ac86e

Browse files
committed
---
yaml --- r: 232365 b: refs/heads/try c: 6bb1e22 h: refs/heads/master i: 232363: 5ac6aae v: v3
1 parent 66d4ae4 commit 55ac86e

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 8d98877112d4deb3786de521457418757e010c69
4+
refs/heads/try: 6bb1e2291195a518ddeef6e64337f4edb1432a72
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc_typeck/check/mod.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,12 @@ fn check_argument_types<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
24322432
1
24332433
};
24342434

2435+
// All the input types from the fn signature must outlive the call
2436+
// so as to validate implied bounds.
2437+
for &fn_input_ty in fn_inputs {
2438+
fcx.register_wf_obligation(fn_input_ty, sp, traits::MiscObligation);
2439+
}
2440+
24352441
let mut expected_arg_tys = expected_arg_tys;
24362442
let expected_arg_count = fn_inputs.len();
24372443
let formal_tys = if tuple_arguments == TupleArguments {
@@ -3541,16 +3547,18 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
35413547
}
35423548
ast::ExprCall(ref callee, ref args) => {
35433549
callee::check_call(fcx, expr, &**callee, &args[..], expected);
3550+
3551+
// we must check that return type of called functions is WF:
3552+
let ret_ty = fcx.expr_ty(expr);
3553+
fcx.register_wf_obligation(ret_ty, expr.span, traits::MiscObligation);
35443554
}
35453555
ast::ExprMethodCall(ident, ref tps, ref args) => {
3546-
check_method_call(fcx, expr, ident, &args[..], &tps[..], expected, lvalue_pref);
3547-
let arg_tys = args.iter().map(|a| fcx.expr_ty(&**a));
3548-
let args_err = arg_tys.fold(false,
3549-
|rest_err, a| {
3550-
rest_err || a.references_error()});
3551-
if args_err {
3552-
fcx.write_error(id);
3553-
}
3556+
check_method_call(fcx, expr, ident, &args[..], &tps[..], expected, lvalue_pref);
3557+
let arg_tys = args.iter().map(|a| fcx.expr_ty(&**a));
3558+
let args_err = arg_tys.fold(false, |rest_err, a| rest_err || a.references_error());
3559+
if args_err {
3560+
fcx.write_error(id);
3561+
}
35543562
}
35553563
ast::ExprCast(ref e, ref t) => {
35563564
if let ast::TyFixedLengthVec(_, ref count_expr) = t.node {

0 commit comments

Comments
 (0)