Skip to content

Commit 122d73a

Browse files
committed
---
yaml --- r: 227303 b: refs/heads/auto c: 6bb1e22 h: refs/heads/master i: 227301: ea61fa9 227299: b82ce5b 227295: a60447f v: v3
1 parent 646ac2f commit 122d73a

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
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 8d98877112d4deb3786de521457418757e010c69
11+
refs/heads/auto: 6bb1e2291195a518ddeef6e64337f4edb1432a72
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/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)