diff options
| author | bors <bors@rust-lang.org> | 2016-04-13 11:28:30 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-04-13 11:28:30 -0700 |
| commit | 35dca7fb7b7304cfa8da027d1be6eea7142d90d6 (patch) | |
| tree | a60302779e6e49f13acb662d1914e3191ba3a84d /src/test | |
| parent | 525aa6102250ec2a33c7066dfb966524f0ce3e21 (diff) | |
| parent | de82fc4dc6bbb87e50618f40e8fc671fb016f815 (diff) | |
| download | rust-35dca7fb7b7304cfa8da027d1be6eea7142d90d6.tar.gz rust-35dca7fb7b7304cfa8da027d1be6eea7142d90d6.zip | |
Auto merge of #32780 - soltanmm:consider-the-following, r=nikomatsakis
Replace consider_unification_despite_ambiguity with new obligation variant Is work towards #32730. Addresses part one of #32286. Addresses #24210 and #26046 to some degree. r? @nikomatsakis
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/closure-wrong-kind.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/compile-fail/closure-wrong-kind.rs b/src/test/compile-fail/closure-wrong-kind.rs new file mode 100644 index 00000000000..6792414c367 --- /dev/null +++ b/src/test/compile-fail/closure-wrong-kind.rs @@ -0,0 +1,22 @@ +// 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. + +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +struct X; +fn foo<T>(_: T) {} +fn bar<T: Fn(u32)>(_: T) {} + +fn main() { + let x = X; + let closure = |_| foo(x); //~ ERROR E0524 + bar(closure); +} |
