-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add a way for macros to check and report errors #3174
Comments
+1 for static_assert :) |
Yay static_assert! |
See https://botbot.me/irc.mozilla.org/rust/msg/2999973/ and following conversation. static_assert, static_warn etc would be very useful when building for a platform lacking certain things. |
static_assert added as attribute in #6670, but it doesn't fix this, this would require CTFE. Setting far future. |
I don't actually think we need compile time function evaluation (CTFE) for what I originally had in mind. I was just thinking a macro like |
Oh... I just read what my initial report said, and that wasn't what my most recent comment was. Still, I think the way to factor this is with a |
@eholk well macros are a form of CTFE I think? |
@cmr, I suppose so, given that they are Turing complete. I'd say Scheme's |
(bug triage) Milestone looks right. |
https://github.com/huonw/compile_msg looks like it might be a solution to this issue? |
Yup! |
miri script: fix RUSTC_GIT error message Making this a flag is tricky since our command-line parsing is pretty crude. Fixes rust-lang/miri#3173
Bumps [tests/perf/s2n-quic](https://github.com/aws/s2n-quic) from `1436af7` to `6dd41e0`. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/aws/s2n-quic/commit/6dd41e09195bc22dbac93a48f8ab35f8063726dc"><code>6dd41e0</code></a> build: fix clippy warnings for 1.78 (<a href="https://redirect.github.com/aws/s2n-quic/issues/2199">#2199</a>)</li> <li><a href="https://github.com/aws/s2n-quic/commit/de5c33e800ffff14c235ed0ae7d695222f84dcca"><code>de5c33e</code></a> refactor(s2n-quic-core): improve reassembler error handling (<a href="https://redirect.github.com/aws/s2n-quic/issues/2197">#2197</a>)</li> <li><a href="https://github.com/aws/s2n-quic/commit/b085808f4c898f6d4d4e68b14d6a762170fb19b1"><code>b085808</code></a> chore(s2n-quic-crypto): remove custom aesgcm implementation (<a href="https://redirect.github.com/aws/s2n-quic/issues/2186">#2186</a>)</li> <li><a href="https://github.com/aws/s2n-quic/commit/7188ce4081096256267e44d63f532a40d2c7df64"><code>7188ce4</code></a> feat(dc): DcSupportedVersions transport parameter (<a href="https://redirect.github.com/aws/s2n-quic/issues/2193">#2193</a>)</li> <li>See full diff in <a href="https://github.com/aws/s2n-quic/compare/1436af712b6e73edc11640dc7c3cae23e456c0a8...6dd41e09195bc22dbac93a48f8ab35f8063726dc">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
It'd be helpful to have something like
macro_error!
orstatic_assert!
, that evaluates a condition and possible reports an error at compile time.In my HTML parser macro, it'd allow the macro to make sure closing tags actually close what they should.
The text was updated successfully, but these errors were encountered: