-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any plans to support "compile-fail" tests? #521
Comments
It checks the text of the |
I didn't know about |
This is also nice to have to writing compiler plugins / syntax extensions. |
I've personally always wanted these as well! (and I know many others have as well). I think the easiest way forward on this is something like rust-lang/rust#12335 (as @sfackler mentioned). |
@alexcrichton do you think the right way forward there would be to distribute compiletest through the main rustc distribution? We could also potentially mirror it in a separate repo and have that pulled in via cargo. |
(I ask because it seems like a bit of a niche thing to install everywhere that rustc is). |
We probably don't want to distribute it into everyone's |
I'd rather not pull it in specially into cargo because it's dynamically linked and for now tied to exactly one rustc distribution. |
Funny enough, I was just getting this to work yesterday. Here's what I ended up with. Would agree that this would be very nice to include in Cargo. |
Closing in favor of rust-lang/rust#12335 as this will pretty much hinge on that if we're going to take this route. |
Like the ones in the rust repository
These kind of tests are useful if you are creating data structures from scratch (with raw pointers in it) and you want to make sure you added the proper markers (
ContravariantLifetime
!) to them. For example:Could be a compile-fail test that checks that a view doesn't outlives its "parent".
Also, this feature would help to build rust with cargo.
So, is anything like this in scope for cargo?
(Slighty on topic: Anyone knows if the rust test suite checks that the
//~ ERROR: patterns
match the compiler output on each test, or simply checks that the compilation failed?)The text was updated successfully, but these errors were encountered: