diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2016-11-28 05:09:28 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2016-11-28 05:09:28 +0200 |
| commit | 36d33d6b71cb99ad9d9403295daec8d8a8f5c976 (patch) | |
| tree | 8721020e8babd68c3b6c545a3db99f1df0b205e6 /src/test | |
| parent | 9aaf26e7aa4068d7e5643b136fb70ecd689a746d (diff) | |
| download | rust-36d33d6b71cb99ad9d9403295daec8d8a8f5c976.tar.gz rust-36d33d6b71cb99ad9d9403295daec8d8a8f5c976.zip | |
rustc_privacy: visit Ty instead of HIR types in EmbargoVisitor.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/impl-trait/auxiliary/xcrate.rs | 15 | ||||
| -rw-r--r-- | src/test/run-pass/impl-trait/xcrate.rs | 17 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/test/run-pass/impl-trait/auxiliary/xcrate.rs b/src/test/run-pass/impl-trait/auxiliary/xcrate.rs new file mode 100644 index 00000000000..be353f6d563 --- /dev/null +++ b/src/test/run-pass/impl-trait/auxiliary/xcrate.rs @@ -0,0 +1,15 @@ +// 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. + +#![feature(conservative_impl_trait)] + +pub fn fourway_add(a: i32) -> impl Fn(i32) -> impl Fn(i32) -> impl Fn(i32) -> i32 { + move |b| move |c| move |d| a + b + c + d +} diff --git a/src/test/run-pass/impl-trait/xcrate.rs b/src/test/run-pass/impl-trait/xcrate.rs new file mode 100644 index 00000000000..fe3ed7b3465 --- /dev/null +++ b/src/test/run-pass/impl-trait/xcrate.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. + +// aux-build:xcrate.rs + +extern crate xcrate; + +fn main() { + assert_eq!(xcrate::fourway_add(1)(2)(3)(4), 10); +} |
