Skip to content

Conversation

@WalterBright
Copy link
Member

Fix omission from #2453 (comment)

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@joseph-wakeling-frequenz

Thanks @WalterBright!

FWIW here is the phrasing that was deleted from the spec when changes were made to reflect -dip1000:
https://github.com/dlang/dlang.org/pull/2453/files#diff-291012f1595e64cfa146ae8b4283c199ce2bc2b6bf83ce94818f330121a08da9L30-L31

`@safe` functions. For this reason they should be very limited in the scope of their use. Typical uses of
`@trusted` functions include wrapping system calls that take buffer pointer and length arguments separately so that
@safe` functions may call them with arrays.)
@safe` functions may call them with arrays. `@trusted` functions must have an `@safe` interface.)

Choose a reason for hiding this comment

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

It might be better to phrase this as:

`@trusted` functions must have a safe interface

or:

`@trusted` functions must have a memory-safe interface

to avoid confusion between safe and @safe (if that makes sense). Cf. how things were phrased in the original version of the spec (link in separate comment by me).

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be useful to provide an example of a "memory-safe interface"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be useful to provide an example of a "memory-safe interface"?

We already have examples on another page: https://dlang.org/spec/function.html#safe-interfaces. Don't repeat all that. Just link there.

@dlang-bot dlang-bot merged commit 325c392 into dlang:master Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants