This website requires JavaScript.
Explore
Help
Register
Sign In
rust-lang
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Actions
1
Packages
Projects
Releases
Wiki
Activity
Files
fff3c25b85f7ea02f6512edbc441ab2742ea4268
rust
/
src
/
test
/
ui
/
rustc-error.rs
7 lines
93 B
Rust
Raw
Normal View
History
Unescape
Escape
Fix tests for rustc_*
2015-02-17 01:51:41 +05:30
#![
feature(rustc_attrs)
]
Add `#[rustc_error]` annotation, which causes trans to signal an error if found on the `main()` function. This lets you write tests that live in `compile-fail` but are expected to compile successfully. This is handy when you have many small variations on a theme that you want to keep together, and you are just testing the type checker, not the runtime semantics.
2015-02-12 12:53:31 -05:00
#[
rustc_error
]
fn
main
(
)
{
//~^ ERROR compilation successful
}
Reference in New Issue
Copy Permalink