-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 @deprecated
#22898
Open
kristoff-it
wants to merge
12
commits into
ziglang:master
Choose a base branch
from
kristoff-it:deprecated-proposal
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Implement @deprecated
#22898
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kristoff-it
commented
Feb 15, 2025
kristoff-it
commented
Feb 15, 2025
kristoff-it
commented
Feb 15, 2025
kristoff-it
commented
Feb 15, 2025
a46c2b2
to
a9d609a
Compare
Can't wait to use this immediately, like this: if (std.meta.hasMethod(T, "format")) {
if (fmt.len > 0 and fmt[0] == 'f') {
return value.format(fmt[1..], options, bw);
} else {
@deprecated();
// After 0.14.0 is tagged, uncomment this next line:
//@compileError("ambiguous format string; specify {f} to call format method, or {any} to skip it");
//and then delete the `hasMethod` condition
return value.format(fmt, options, bw);
}
} |
@andrewrk rewiew it and it's all yours :^) |
mlugg
requested changes
Feb 20, 2025
cb77a45
to
0382720
Compare
Failure looks related:
|
alexrp
reviewed
Feb 24, 2025
54bb964
to
9be963b
Compare
mlugg suggested a better way of implementing analysis of an istruction that cannot be referenced by other instructions.
This implementation looks at the builder of each module in the build graph instead of storing a boolean for each module.
Inheriting allow-deprecation from parent modules doesn't make too much sense, so instead make them default to disallow unless otherwise specified. This allows build system to avoid redundant `-fno-allow-deprecated` args. This makes the generated CLIs smaller, and makes zig1.wasm update not needed. Also represented `is_root` differently (moved to field of graph).
"found" -> "reached" to match "reached unreachable code"
9be963b
to
2d29c85
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements #22822
The part I'm most unsure about this implementation relates to how the build system represents
-fallow-deprecated
and-fno-allow-deprecated
internally and how then this is reflected in the CLI invocation ofbuild-exe
and related subcommands.