| Crates.io | whichever-compiles |
| lib.rs | whichever-compiles |
| version | 1.0.0 |
| created_at | 2021-03-08 08:38:21.90093+00 |
| updated_at | 2021-03-08 08:38:21.90093+00 |
| description | Please do not use this. |
| homepage | |
| repository | https://github.com/m-ou-se/whichever-compiles |
| max_upload_size | |
| id | 365630 |
| size | 5,293 |
The whichever_compiles!{} macro fork()s the compiler to try out different
alternatives to find one that compiles.
https://twitter.com/m_ou_se/status/1368632701448818691
Please do not use this.
use whichever_compiles::whichever_compiles;
fn main() {
whichever_compiles! {
try { thisfunctiondoesntexist(); }
try { invalid syntax 1 2 3 }
try { println!("missing arg: {}"); }
try { println!("hello {}", world()); }
try { 1 + 2 }
}
}
whichever_compiles! {
try { }
try { fn world() {} }
try { fn world() -> &'static str { "world" } }
}
$ cargo run
hello world