@@ -142,7 +142,7 @@ fn entry_point_type(sess: &Session, item: &ast::Item, depth: usize) -> EntryPoin
142
142
ast:: ItemKind :: Fn ( ..) => {
143
143
if sess. contains_name ( & item. attrs , sym:: start) {
144
144
EntryPointType :: Start
145
- } else if sess. contains_name ( & item. attrs , sym:: main ) {
145
+ } else if sess. contains_name ( & item. attrs , sym:: rustc_main ) {
146
146
EntryPointType :: MainAttr
147
147
} else if item. ident . name == sym:: main {
148
148
if depth == 1 {
@@ -187,7 +187,7 @@ impl<'a> MutVisitor for EntryPointCleaner<'a> {
187
187
let attrs = attrs
188
188
. into_iter ( )
189
189
. filter ( |attr| {
190
- !self . sess . check_name ( attr, sym:: main )
190
+ !self . sess . check_name ( attr, sym:: rustc_main )
191
191
&& !self . sess . check_name ( attr, sym:: start)
192
192
} )
193
193
. chain ( iter:: once ( allow_dead_code) )
@@ -220,7 +220,7 @@ fn generate_test_harness(
220
220
let expn_id = ext_cx. resolver . expansion_for_ast_pass (
221
221
DUMMY_SP ,
222
222
AstPass :: TestHarness ,
223
- & [ sym:: main , sym :: test, sym:: rustc_attrs] ,
223
+ & [ sym:: test, sym:: rustc_attrs] ,
224
224
None ,
225
225
) ;
226
226
let def_site = DUMMY_SP . with_def_site_ctxt ( expn_id) ;
@@ -247,7 +247,7 @@ fn generate_test_harness(
247
247
/// By default this expands to
248
248
///
249
249
/// ```
250
- /// #[main ]
250
+ /// #[rustc_main ]
251
251
/// pub fn main() {
252
252
/// extern crate test;
253
253
/// test::test_main_static(&[
@@ -297,8 +297,8 @@ fn mk_main(cx: &mut TestCtxt<'_>) -> P<ast::Item> {
297
297
let test_extern_stmt =
298
298
ecx. stmt_item ( sp, ecx. item ( sp, test_id, vec ! [ ] , ast:: ItemKind :: ExternCrate ( None ) ) ) ;
299
299
300
- // #[main ]
301
- let main_meta = ecx. meta_word ( sp, sym:: main ) ;
300
+ // #[rustc_main ]
301
+ let main_meta = ecx. meta_word ( sp, sym:: rustc_main ) ;
302
302
let main_attr = ecx. attribute ( main_meta) ;
303
303
304
304
// pub fn main() { ... }
0 commit comments