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

package.edition gives confusing error when integer passed instead of string #11132

Closed
clarfonthey opened this issue Sep 22, 2022 · 3 comments
Closed
Labels
C-bug Category: bug

Comments

@clarfonthey
Copy link
Contributor

clarfonthey commented Sep 22, 2022

Problem

With the following in Cargo.toml: package.edition = 2021

You get the below error:

error: failed to parse manifest at `<dir>/Cargo.toml`

Caused by:
  data did not match any variant of untagged enum MaybeWorkspace for key `package.edition`

Ideally, this would point out to the user that only strings are allowed, not integers, since the current edition markers are all integer years.

@clarfonthey clarfonthey added the C-bug Category: bug label Sep 22, 2022
@Muscraft
Copy link
Member

Thanks for the report!

This is related to #10997 and caused by a problem with how cargo deserializes toml files and enum variants.

@weihanglo
Copy link
Member

I believe it got improved with #11113. Closing. Thank you!

@clarfonthey
Copy link
Contributor Author

Oh awesome, thank you for pointing this out. I tried to search for an existing error but couldn't find one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants