rust icon indicating copy to clipboard operation
rust copied to clipboard

Implement 'note'

Open graydon opened this issue 15 years ago • 7 comments

When unwinding, we should log things marked with 'note' in the unwinding block. Currently we have no support for this, despite excited claims in the manual.

graydon avatar May 26 '11 21:05 graydon

A simple version of this can probably be implemented with a library function and a macro. @nikomatsakis has been pining for the feature lately.

brson avatar Apr 17 '12 21:04 brson

Changing this to an enhancement for doing what @brson suggested as a library.

catamorphism avatar Oct 11 '12 21:10 catamorphism

I have written a note macro, although I'm not sure if this is what you had in mind: https://gist.github.com/4262524

14427 avatar Dec 11 '12 21:12 14427

D provides this functionality as part of their scope guard support, by allowing you to install them for one of exit, success or failure. Macros for all 3 cases would probably make sense in Rust too.

thestinger avatar Mar 15 '13 22:03 thestinger

Can someone point me at the spec for this? I cannot judge whether the note macro proposed in 14427's comment would suffice.

pnkfelix avatar Jun 18 '13 10:06 pnkfelix

(bug triage) Milestone seems right.

catamorphism avatar Aug 05 '13 17:08 catamorphism

Replaced with #9835, based on recent movement towards RAII idioms. The ability to run code on success or on exit regardless of failure is useful too.

thestinger avatar Oct 13 '13 16:10 thestinger