Skip to content

Commit da38e5e

Browse files
committed
---
yaml --- r: 232725 b: refs/heads/try c: 8320a3a h: refs/heads/master i: 232723: ddbe18a v: v3
1 parent 5a28a5b commit da38e5e

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 0112e7bd159968d2ad2e5ea6727564c200b7c35f
4+
refs/heads/try: 8320a3a048717f2a09ba5e5cddb2b634047da647
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/libsyntax/test.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ impl fold::Folder for EntryPointCleaner {
202202
let folded = fold::noop_fold_item(i, self).expect_one("noop did something");
203203
self.depth -= 1;
204204

205-
// Remove any #[main] from the AST so it doesn't clash with
206-
// the one we're going to add, but mark it as
205+
// Remove any #[main] or #[start] from the AST so it doesn't
206+
// clash with the one we're going to add, but mark it as
207207
// #[allow(dead_code)] to avoid printing warnings.
208208
let folded = match entry::entry_point_type(&*folded, self.depth) {
209209
EntryPointType::MainNamed |
@@ -221,13 +221,10 @@ impl fold::Folder for EntryPointCleaner {
221221
ast::Item {
222222
id: id,
223223
ident: ident,
224-
attrs: attrs.into_iter().filter_map(|attr| {
225-
if !attr.check_name("main") {
226-
Some(attr)
227-
} else {
228-
None
229-
}
230-
})
224+
attrs: attrs.into_iter()
225+
.filter(|attr| {
226+
!attr.check_name("main") && !attr.check_name("start")
227+
})
231228
.chain(iter::once(allow_dead_code))
232229
.collect(),
233230
node: node,
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2015 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+
// compile-flags: --test
12+
13+
#![feature(start)]
14+
15+
#[start]
16+
fn start(_: isize, _: *const *const u8) -> isize { panic!(); }

0 commit comments

Comments
 (0)