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

Don't recommend const fns on a stable build without a note about nightlies #28507

Merged
merged 1 commit into from
Sep 20, 2015

Conversation

Manishearth
Copy link
Member

Fixes #28490

cc #24111

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(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 \
Copy link
Member

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

@alexcrichton
Copy link
Member

Looks like there's a travis failure as well

@Manishearth
Copy link
Member Author

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, \
Copy link
Contributor

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?

Copy link
Member Author

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".

Copy link
Member Author

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.

@alexcrichton
Copy link
Member

@bors: r+ dcf49b5

Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 20, 2015
bors added a commit that referenced this pull request Sep 20, 2015
@bors bors merged commit dcf49b5 into rust-lang:master Sep 20, 2015
@Manishearth Manishearth deleted the const-stable branch September 20, 2015 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants