-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Implement fail as a macro/library function #2232
Comments
(c) seems to argue for a macro. The macro could also address (a) without requiring two distinct forms. (b) seems easy enough to solve using generic types. |
I opened an issue - #2245 - for the #file and #line macros that we need for this. |
#2245 is implemented now |
I thought another key feature of fail was that typestate knew it never returned and could stop checking after branches that fail. Can we do that with a macro? |
eholk: we also have the '!' return type that gives us the same information, so we can presumably declare in intrinsic that returns |
Oh right, I forgot about that. |
With this issue, do we intend to tear out the unwinding bits in the runtime, too? Or just have it call into task::fail which calls rustrt::rust_task_fail? |
This has been (partially) implemented in de82a9b, although the current version is a very thin wrapper around the C runtime. Eventually (i.e. when I finish GC), the GC will handle running any destructors on the stack, making unwinding unnecessary. I've got a partial patch at https://github.com/elliottslaughter/rust/commits/unique-ptrs, but it doesn't yet know about non-pointer resources on the stack. |
I think this is done now. |
Done as of 172c29f |
Always show stderr on test failure. fixes rust-lang#2224 I overengineered the original thing to the point where it became fragile. Let's just always print stderr, unless it was already printed
This change re-enable the build cache in Kani. For that, we also added a new dummy option that includes Kani's version, which will ensure that the cache gets refreshed when the user upgrades Kani. We also enabled an option to force rebuild: `--force-build` Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
It will not be difficult to eliminate fail from the language, but there are some considerations: a) it has to work with or without an argument (we could just have two); b) in the future it will probably need to accept any sendable type argument, not just a string; c) it has to report the correct location of the error.
The text was updated successfully, but these errors were encountered: