Skip to content

Add error explanation for E0014 #26029

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

Merged
merged 1 commit into from
Jun 8, 2015
Merged

Conversation

GuillaumeGomez
Copy link
Member

Part of #24407.

@rust-highfive
Copy link
Contributor

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@GuillaumeGomez
Copy link
Member Author

cc @michaelsproul

@GuillaumeGomez
Copy link
Member Author

r? @steveklabnik

@rust-highfive rust-highfive assigned steveklabnik and unassigned nrc Jun 7, 2015
@michaelsproul
Copy link
Contributor

Sorry for the slow reply, I've been meaning to comment!

Glancing at the short error message (about paths) I thought this might be triggered using a module, type or static in a const, but upon testing it seems these give other errors (due to namespacing). I haven't been able to find an example better than the one you've listed, so with a few tweaks I think this is fine for merging.

@@ -227,6 +227,23 @@ const Y: i32 = A;
```
"##,

E0014: r##"
Constant variables' value can only be a constant value or a function. Bad
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variables' thing is a bit awkward, perhaps something like:

Constants can only be initialized by a constant value or, in a future version of Rust, a call to a const function. This error indicates the use of a path (like a::b, or x) denoting something other than one of these allowed items. Example:

@GuillaumeGomez
Copy link
Member Author

@michaelsproul: No problem. Thanks for your help as always !

@michaelsproul
Copy link
Contributor

@GuillaumeGomez: Thanks for your perseverance!

I think we can summon @Manishearth 😄

@Manishearth
Copy link
Member

@bors: r+

YOU DARE WAKE ME FROM MY SLUMBER??!

@bors
Copy link
Collaborator

bors commented Jun 8, 2015

📌 Commit ae550bd has been approved by Manishearth

@michaelsproul
Copy link
Contributor

thank you oh great one bows

@GuillaumeGomez
Copy link
Member Author

Where did I land ? O.o

PS: https://github.com/KokaKiwi/rust-sixsixsix

@GuillaumeGomez
Copy link
Member Author

And even more : KokaKiwi/rust-sixsixsix#2

@bors
Copy link
Collaborator

bors commented Jun 8, 2015

⌛ Testing commit ae550bd with merge 1ade076...

bors added a commit that referenced this pull request Jun 8, 2015
@bors bors merged commit ae550bd into rust-lang:master Jun 8, 2015
@GuillaumeGomez GuillaumeGomez deleted the const_check branch June 8, 2015 16:16
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.

7 participants