Skip to content
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

Closed
brson opened this issue Apr 17, 2012 · 11 comments
Closed

Implement fail as a macro/library function #2232

brson opened this issue Apr 17, 2012 · 11 comments
Labels
A-codegen Area: Code generation A-grammar Area: The grammar of Rust A-typesystem Area: The type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Apr 17, 2012

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.

@nikomatsakis
Copy link
Contributor

(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.

@catamorphism
Copy link
Contributor

I opened an issue - #2245 - for the #file and #line macros that we need for this.

@kud1ing
Copy link

kud1ing commented May 24, 2012

#2245 is implemented now

@eholk
Copy link
Contributor

eholk commented May 25, 2012

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?

@brson
Copy link
Contributor Author

brson commented May 26, 2012

eholk: we also have the '!' return type that gives us the same information, so we can presumably declare in intrinsic that returns !

@eholk
Copy link
Contributor

eholk commented May 26, 2012

Oh right, I forgot about that.

@ghost ghost assigned bblum Jul 6, 2012
@bblum
Copy link
Contributor

bblum commented Jul 18, 2012

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?

@elliottslaughter
Copy link
Contributor

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.

@elliottslaughter
Copy link
Contributor

This issue seems like a subset of #2861, yes?

Edit: No, actually. This involves language changes, whereas #2861 is only concerned with the runtime implementation.

@z0w0
Copy link
Contributor

z0w0 commented Feb 16, 2013

I think this is done now.

@catamorphism
Copy link
Contributor

Done as of 172c29f

bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
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
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-grammar Area: The grammar of Rust A-typesystem Area: The type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

8 participants