Skip to content
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

Allow producing warnings at compile-time #7714

Open
asterite opened this issue Mar 14, 2025 · 1 comment · May be fixed by #7723
Open

Allow producing warnings at compile-time #7714

asterite opened this issue Mar 14, 2025 · 1 comment · May be fixed by #7723
Labels
enhancement New feature or request

Comments

@asterite
Copy link
Collaborator

Problem

Right now one can use assert, assert_eq and panic (which uses assert under the hood) to produce errors at compile-time. However, there's no equivalent to produce warnings.

Happy Case

There's a way to produce warnings at compile-time.

There could be this function in the stdlib:

#[builtin(warn)]
pub comptime fn warn<T, let N: u32>(message: fmtstr<N, T>) {}

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@asterite asterite added the enhancement New feature or request label Mar 14, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Mar 14, 2025
@TomAFrench
Copy link
Member

https://doc.rust-lang.org/proc_macro/struct.Diagnostic.html

Something to consider when designing this.

@asterite asterite linked a pull request Mar 14, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

2 participants