-
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
check that first arg to panic!()
in const is &str
#80734
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
3c21bf7
to
6412cba
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this affect any tests? If not, please add a test in a test that has the const_panic
feature activated.
Yep, I was getting to that. I just wanted to post as draft for early feedback on the error message. |
oh duh, I should have read your main PR message properly.. |
f437c33
to
c6c1997
Compare
This comment has been minimized.
This comment has been minimized.
9511e21
to
a5e15c7
Compare
This comment has been minimized.
This comment has been minimized.
9bcdbad
to
aa12833
Compare
I went ahead and made sure to cover |
You can have more than one |
@RalfJung well the problem I had with arrays is that it seems their length expressions get const-evaluated in an earlier pass than |
That's a good point, thanks. Maybe add a comment in the array-length-test-file explaining why this is a separate file. |
It seems like this is waiting on rather minor changes, is that right? @RalfJung I'm happy to push this forward if so. |
@SergioBenitez I left some comments that are all minor, yes (see the open discussions). I don't know if @oli-obk has further comments; he is more familiar with the const-checking code. |
aa12833
to
1920ef5
Compare
@RalfJung sorry, been busy with work. I think that's your nits addressed now.
|
@rustbot label: +S-waiting-on-review -S-waiting-on-author |
9b4f2a0
to
8765a3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit, then this lgtm
8765a3d
to
5a33f53
Compare
@bors r+ |
📌 Commit 5a33f53 has been approved by |
…laumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#80734 (check that first arg to `panic!()` in const is `&str`) - rust-lang#81932 (Always compile rustdoc with debug logging enabled when `download-rustc` is set) - rust-lang#82018 (Remove the dummy cache in `DocContext`; delete RenderInfo) - rust-lang#82598 (Check stability and feature attributes in rustdoc) - rust-lang#82655 (Highlight identifier span instead of whole pattern span in `unused` lint) - rust-lang#82662 (Warn about unknown doc attributes) - rust-lang#82676 (Change twice used large const table to static) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
closes #66693
TODO: regression testcc @RalfJung for error message wording