forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove obsolete no-op #[main] attribute from compiler.
- Loading branch information
1 parent
f52c318
commit 475e4ee
Showing
5 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#[main] //~ ERROR cannot find attribute `main` in this scope | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: cannot find attribute `main` in this scope | ||
--> $DIR/main-removed-1.rs:1:3 | ||
| | ||
LL | #[main] | ||
| ^^^^ | ||
| | ||
= note: `main` is in scope, but it is a function, not an attribute | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// force-host | ||
// no-prefer-dynamic | ||
|
||
#![crate_type = "proc-macro"] | ||
|
||
extern crate proc_macro; | ||
use proc_macro::TokenStream; | ||
|
||
#[proc_macro_attribute] | ||
pub fn main(_: TokenStream, input: TokenStream) -> TokenStream { | ||
"fn main() { println!(\"Hello Tokyo!\"); }".parse().unwrap() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// run-pass | ||
// aux-build:tokyo.rs | ||
// compile-flags:--extern tokyo | ||
// edition:2021 | ||
|
||
use tokyo::main; | ||
|
||
#[main] | ||
fn main() { | ||
panic!("the #[main] macro should replace this with non-panicking code") | ||
} |