Skip to content

Commit 3617868

Browse files
committed
Add compile fail test for unboxed_closures feature
1 parent bfe4597 commit 3617868

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(fn_traits)]
12+
13+
struct Test;
14+
15+
impl FnOnce<(u32, u32)> for Test {
16+
type Output = u32;
17+
18+
extern "rust-call" fn call_once(self, (a, b): (u32, u32)) -> u32 {
19+
a + b
20+
}
21+
}
22+
23+
fn main() {
24+
assert_eq!(Test(1u32, 2u32), 3u32);
25+
}

src/tools/tidy/src/features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn check(path: &Path, bad: &mut bool) {
168168
let whitelist = vec![
169169
"abi_ptx", "simd",
170170
"cfg_target_has_atomic",
171-
"unboxed_closures", "stmt_expr_attributes",
171+
"stmt_expr_attributes",
172172
"cfg_target_thread_local", "unwind_attributes",
173173
"inclusive_range_syntax"
174174
];

0 commit comments

Comments
 (0)