Skip to content

Conversation

@dlowe
Copy link

@dlowe dlowe commented Apr 30, 2025

WIP for early feedback.

known TODOs assuming I'm on the right track:

  • MAYBE: better testing?
  • MAYBE: consider propagating the rust #[deprecated] annotation to the generated (rust) shim function? This probably doesn't really accomplish anything, since it covers calling the shim function from rust code, which is already very weird, I think?
  • parse the #[deprecated] attribute on non-fn elements
  • support for the #[deprecated(note = "foo")] attribute syntax
  • emit csharp doxygen deprecated tagged docstring
  • emit csharp ObsoleteAttribute annotations
  • documentation

@dlowe dlowe self-assigned this Apr 30, 2025
lang: Language,
docs: &'_ [&'_ str],
// an Option<&str> passed as an empty or exactly-one-element slice... is there a better way?
deprecated: &'_ [&'static str],
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielhenrymantilla I don't love this, any better ideas?

abort_on_unwind_guard = #ඞ::UnwindGuard(#export_name_str),
unsafe {
#layout::into_raw(
#[allow(deprecated)]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could make this allow conditional on the function actually being deprecated, I suppose? It doesn't seem worth the effort, but I could be persuaded.

mk_out!(indent, ctx.out());

if docs.is_empty() {
if docs.is_empty() && deprecated.is_none() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't exactly right, but I think getting it exactly right requires a bit of a deeper refactor.

@dlowe dlowe force-pushed the deprecation-support branch from fa98633 to 7fffc09 Compare May 7, 2025 16:29
@dlowe dlowe changed the base branch from master to deburr May 7, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants