about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-30 04:24:38 -0700
committerGitHub <noreply@github.com>2016-09-30 04:24:38 -0700
commit1d64acdceb6f0eebbc5e8774972b86e4cf192a0f (patch)
treede8b45e4fd0f47abc75aa67ac0e284a0aa66aa22 /src/test
parentc88ed2a1a7c5e11932f2f2b315e527933d3f7ebf (diff)
parentec2e05194f02fea51ad19de3498b9f6818166f1c (diff)
downloadrust-1d64acdceb6f0eebbc5e8774972b86e4cf192a0f.tar.gz
rust-1d64acdceb6f0eebbc5e8774972b86e4cf192a0f.zip
Auto merge of #36822 - Aatch:resolve-callee-expr, r=luqmana
Resolve the callee type in check_call before autoderef

If the callee type is an associated type, then it needs to be normalized
before trying to deref it. This matches the behaviour of
`check_method_call` for autoderef behaviour in calls.

Fixes #36786
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issue-36786-resolve-call.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-36786-resolve-call.rs b/src/test/run-pass/issue-36786-resolve-call.rs
new file mode 100644
index 00000000000..0d718c7ba46
--- /dev/null
+++ b/src/test/run-pass/issue-36786-resolve-call.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Ensure that types that rely on obligations are autoderefed
+// correctly
+
+fn main() {
+    let x : Vec<Box<Fn()>> = vec![Box::new(|| ())];
+    x[0]()
+}