-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Don't recommend const fns on a stable build without a note about nightlies #28507
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
"function calls in {}s are limited to \ | ||
struct and enum constructors", v.msg()); | ||
v.tcx.sess.span_note(e.span, | ||
"A limited form of compile-time function \ |
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.
I believe our error messages and such conventionally start with a lowercase letter
Looks like there's a travis failure as well |
a0d1954
to
7d72de1
Compare
Ah, I'd forgotten to push after fixing build errors. Addressed. |
} else { | ||
span_err!(v.tcx.sess, e.span, E0015, | ||
"function calls in {}s are limited to \ | ||
constant functions, \ |
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.
Did you intend to mention "constant functions" on stable Rust?
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.
Yes, I did. That's why I mention that "it is available on nightlies".
I'm okay with suggesting unstable features on a stable compiler, as long as it is mentioned that they are only available on nightlies (so that the user can evaluate switching to a nightly if constfn was indeed what they wanted). I want to avoid the bad UX of "compiler suggests thing, try thing, thing doesn't work because stable".
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.
Oh, I see what you mean. Fixed.
7d72de1
to
dcf49b5
Compare
Fixes #28490
cc #24111