View source code
Display the source code in dmd/safe.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aBugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinglocal clone.
Function dmd.safe.setUnsafePreview
Like setUnsafe, but for safety errors still behind preview switches
bool setUnsafePreview(
dmd .dscope .Scope* sc,
FeatureState fs,
bool gag,
Loc loc,
const(char)* format,
scope RootObject[] args...
);
Given a FeatureState fs, for example dip1000 / dip25 / systemVariables,
the behavior changes based on the setting:
- In case of -revert=fs, it does nothing.
- In case of -preview=fs, it's the same as setUnsafe
- By default, print a deprecation in @safe functions, or store an attribute violation in inferred functions.
Parameters
| Name | Description |
|---|---|
| sc | used to find affected function/variable, and for checking whether we are in a deprecated / speculative scope |
| fs | feature state from the preview flag |
| gag | surpress error message |
| loc | location of error |
| format | printf-style format string |
| args | arguments for format string |
Returns
whether an actual safe error (not deprecation) occured
Authors
License
Copyright © 1999-2025 by the D Language Foundation | Page generated by ddox.